Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
Making sense of break tags
I have been tinkering with a plugin that gives one some control over the presentation of shared bloglines lists. I have it up and working in a rudimentary way, but would like to make it a little more full-featured so that it might be useful to others without having to muck around in the code.
What I can’t quite figure out is how breaktags are generated and output. I have poked around in the code for txp:link and so forth, but have to admit that I’m completely dazed by stuff like this:
if (is_array($out)) {
if($break ‘li’) {
return ($wraptag)
? tag(“<li>”.join(“</li>\n<li>”,$out).”</li>”,$wraptag)
: “<li>”.join(“</li>\n<li>”,$out).”</li>”;==
}
return ($wraptag)
? tag(join($break.n,$out),$wraptag)
: join($break.n,$out);
}
This seems to be the relevant bit of code, but I can’t make sense out of it enough to incorporate it into my own plugin. Anybody care to write a quick howto on this? (Alternatively, if you’re interested in the plugin, such as it is, I’d love to share it and see it improved by someone who actually knows what they’re doing.)
Last edited by schussat (2004-08-13 00:53:00)
-Alan
Offline
#2 2004-08-13 01:14:57
- zem
- Developer Emeritus
- From: Melbourne, Australia
- Registered: 2004-04-08
- Posts: 2,579
Re: Making sense of break tags
$out is an array; fill it with the things you want to display, one element per list item (try $out=array('a', 'b', 'c');
and see what happens). $break and $wraptag should be extracted from the plugin attributes. Do that, and the code you posted will work just fine.
Understanding why is left as an exercise for the reader.
Last edited by zem (2004-08-13 01:16:31)
Alex
Offline
Re: Making sense of break tags
> zem wrote:
> Understanding why is left as an exercise for the reader.
Yaaar, that’s the very thing I want to understand! :)
-Alan
-Alan
Offline
Pages: 1