On Wed, Oct 7, 2009 at 7:44 AM, Hans <[email protected]> wrote:
>
> I am testing various search templates.
> The doc page http://www.boltwire.com/index.php?p=docs.concepts.search.template
> says:
>
> Several system templates exist including:
> count count number of pages
> csv a csv list of pages
> list a vertical list of pages
> title returns a list of clickable page titles
> toc A nice indented table of contents list
> breadcrumb returns a breadcrumb of each page (default template)
...
> Of these formats toc, count, csv and list work.
> The other don't.
> fmt=breadcrumb returns text 'breadcrumb' for each page.
To get the breadcrumbs, just don't assign a template/fmt. There is no
breadcrumb template--breadcrumbs are the template if nothing else is
set.
> fmt=default returns unresolved entries as text like '[(breadcrumb
> test.abcdefg name=link)]'
When no template is set, it translates to template=default (which can
be found at template.default--so it is changeable. Obviously you can
do template=default directly.
But here's why your results are unresolved. If you use template= the
whole markup table is processed on each page separately, like PmWiki,
and then escaped. If you use fmt, it gets returned unprocessed into
the page and the output gets processed with the rest of the page. Very
different process. The advantage is, it is much faster. The
disadvantage is, markup table items already processed before the
search function is called--will not get called again on the output. So
templates always work, fmts work if the output is relatively simple.
In your specific case [( )] functions are called before the search
output is generated so there is no further processing of the output.
We could get further mileage with the default template to change it to
<( )> instead of [( )], so the markup can get picked up later. Esp
with the default, we want as must useability as possible. I just
changed the core for default and toc in this way.
> fmt=jump returns a list of items, each in two lines, first line is
> text '[(template first)]',
> second line is a drop-down box, with an entry of 'Select
> One....[(template each)]'
Try using template=jump. Fmt doesn't work with more advanced
templating capabilities, like first, last and the like. Just used for
simple output.
> Something is going wrong!
Don't really have the possible template items available in the docs
anywhere. Let me see:
A template should be able to recognize all of these:
[(template first)]
[(template each )]
[(template group )]
[(template last )]
[(template 3)]
And these vars (seems to be with or without +)
{count}
{count_total}
{count_matches}
{prev}
{next}
{index}
To refer to current page in the template use these. Without the + you
get the base page with the search on it.
{+p}, {+p1}, {+title}, {+:data}, {+::info} etc
To pass parameters from the search string to the template use
$count
$template
etc.
A few of these may work with fmt, but probably not many. They were
really designed for full templates. I've just updated the docs where
some of these things are explained, the rest I've added or clarified.
http://www.boltwire.com/index.php?p=docs.concepts.search.template
Cheers,
Dan
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---