[pmwiki-users] Need to fix the spacing on an Include...

sti at pooq.com sti at pooq.com
Sat Oct 13 07:23:59 CDT 2007


Ben Wilson wrote:
> I am supporting a friend's wedding planner web site. In her blog,[2]
> she wants the (read more...) tag to be at the end of the last
> paragraph. The following is the page template code. Would somebody
> mind suggesting how I can satisfy her request?
> 
> [[#teasers]]
> !!! {=$Titlespaced}
> 
> (:include {=$FullName} para=2:)([[{=$FullName}|read more]]...)
> 
> (:if equal {>$Group}:)
> (:if:)
> [[#teasersend]]
> 
> 
> [1]: http://www.weddingsinvieques.com/SandysBlog/SandysBlog

As far as I can tell from a quick reading of IncludeText(), the problem is
that the included text ends with the blank line that delimits the paragraph.
The only way I can see to fix it would involve a recipe that redefines the
(:include...:) directive to call an extended IncludeText function that has a
couple more options.

It would be nice if there were some way to use a markup expression like:

  {(chomp (:include {=$FullName} para=2:) )}

But the order of evaluation of expressions precludes it. (you'd need to define
chomp as well, but its trivial to write.)

The simplest extension (in my mind) would be one that allows you to do an
include into a variable. Thus you'd say something like:

  (:includevar $foo {=$FullName} para=2:){(chomp {$foo})}([[{=$FullName}|read
more]]...)

You could probably replace chomp with substr, but the current PmWiki docs
don't mention if it handles negative indexes and lengths in a way that would
let you drop the last blank line, and I'm late to get out the door, so I can't
take the time to work it out now.



More information about the pmwiki-users mailing list