The problem is actually in the BOLTloadpage function, not the template
selection process which is predicated on BOLTloadpage returning an
emptry string for templates that don't exist.
It could also be a relatively new bug--as I just moved all of this
processing from the various functions to the BOLTloadpage function. I
also noticed {p}# no longer works either--which is supposed to go from
the start of the page to the first anchor.
It was a bit tricky to fix because it is possible to have anchors like
[[#anchor|link]] as well as [[#anchor]] (which is why I matched for
[[#anchor. But It can be switched to a pattern and rewritten a bit
like this:
engine.php, loadpage function, ~1355
if (isset($anchor)) {
if ($anchor == '#') return substr($out, 0, strpos($out, '[[#'));
if (preg_match('/\[\['.$anchor.'(\|.+)?\]\]/', $out, $matches)
== 1) {
if ($anchor != '#') $out = substr($out, strpos($out,
$matches[0]) +
strlen($matches[0]));
if (strpos($out, "[[#") !== false) return substr($out,
0,
strpos($out, "[[#"));
}
return;
}
Will put in the next release. It seems to solve the problem.
Cheers,
Dan
On Fri, Sep 25, 2009 at 7:12 AM, DrunkenMonk <[email protected]> wrote:
>
> I can't believe we have noticed this till now.
>
> Since "[[#toc" matches [[#tocolate]] the template on this page is used
> instead of templates.toc.
> Since tocolate]] is longer than toc]] the result is gibberish.
>
> ---
> [(search group=* template=toc)]
>
> /*
> [[#tocolate]]
> [(template each)] This is the wrong template to use.
> [[#end]]
> */
> ---
> >
>
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---