list ...
not what I would be looking for for a for loop (lots of for's in that line).
Would not have made that connection.
Math is not really needed because I could do something like:
/*
[[#testin]]
[(template first)]
[(template each)]`
[(list for=2-{+p0} fmt='*' join='')] [[{+p}|{+title}]]
[(template last)]
[[#end]]
*/
Starting the loop at 2
Placing a space between the end of the list function and the page allowed
for the bullets. Still a bit messy since it ends up putting UL's around
each line which causes lots of space between the lines. Could fix that
with a div around it to reclassify the UL spacing though.
I also tried and am currently using something like:
/*
[[#testin]]
[(template first)]
[(template each)]<div class='toc{+p0}'>• [[{+p}|{+title}]]</div>
[(template last)]
[[#end]]
*/
Combined with CSS like:
#main .toc2 { font-weight: bold; margin-left: 10px; }
#main .toc3 { margin-left: 40px; }
Makes the first level bold and secondary levels normal but indented.
Adding the math pluging (not part of the core) I changed it to...
/*
[[#testin]]
[(template first)]
[(template each)]<div class='toc[(math {+p0} -1 )]'>•
[[{+p}|{+title}]]</div>
[(template last)]
[[#end]]
*/
Which also works. toc's now have {+p0} -1 .
Didn't think of the math plugin either.
Good clue on the escaped newline.... would have missed that. That also
cleared up another issue I have been having I think, Have not tried it yet.
On Thu, Sep 24, 2009 at 3:36 AM, DrunkenMonk <[email protected]> wrote:
>
> I think the list function had a way to generate a forloop. Try that.
>
> [(list for=1-4 fmt=* join='')] hello
>
> will give you "hello" indented 5 times.
>
> /*
> [[#testin]]
> [(template first)]
> [(template each)]`
> [(list for=1-{+p0} fmt=* join='')][[{+p}|{+title}]]
> [(template last)]
> [[#end]]
> */
>
> Notice the escaped newline: last I checked, bullet points will only
> work as bullets if they are first on a line.
> If you need to apply math to p0, use the math function. (Is that still
> a plugin? I forget.)
>
> On Sep 24, 12:09 pm, Kevin <[email protected]> wrote:
> > Can't believe how much time I spent yesterday trying to do something
> really
> > simple...
> >
> > Using
> >
> > [(search group=bwwiki.* template="toc")]
> >
> > Gives the data I want but not the output. It gives a list pages that
> looks
> > okay, but without bullets and if you look at the output it uses a tone
> of
> > ... which is hard to style using CSS..
> >
> > So I look at it and it seems like it would be simple to do in the
> boltwire
> > snippet code but I can't figure it out.
> >
> > So something like:
> >
> > [(search group=bwwiki.* template="testin")]
> >
> > /*
> > [[#testin]]
> > [(template first)]
> > [(template each)]{+p0} [[{+p}|{+title}]]
> > [(template last)]
> > [[#end]]
> > */
> >
> > Gives me a list like I want with the number of the level and a proper
> link
> > to the page with title... Now all I need to do is convert the number into
> > the number of * - 1 and I would have the output I could use...
> >
> > In pseudo php I could do something like:
> >
> > for($i = 0 , $i < {+p0}; $i++)
> > echo "*";
> > echo " " . [[{+p}|{+title}]] . "<br>";
> >
> > and I would get output with
> >
> > * [[{+p}|{+title}]]
> > ** [[{+p}|{+title}]]
> > ** [[{+p}|{+title}]]
> > * [[{+p}|{+title}]]
> > ** [[{+p}|{+title}]]
> > ** [[{+p}|{+title}]]
> > ....
> >
> > The number of *'s depending on the level of the page - 1
> >
> > So I could create a function to do this, but isn't there a way to do this
> > without that?
> >
> > Another option would be to create CSS tags for the levels and then style
> it
> > with CSS...
> >
> > <div style='toc{+p0}'>• [[{+p}|{+title}]]</div>
> >
> > Then create CSS for the .toc2 .toc3 to do the spacing without all the
> > stuff.
> >
> > You can tell I am much better at PHP.
> >
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"BoltWire" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/boltwire?hl=en
-~----------~----~----~----~------~----~------~--~---