Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2009-03-09 22:01:39

phual
Member
From: UK
Registered: 2008-02-19
Posts: 26
Website

Returning section name rather than section title from plugin

I’m trying to make a small change to poe_bbclone (an unsupported, but still functioning plugin), but am lacking in the programming and Textpattern knowledge necessary to make the change.

The plugin outputs the section title to bbclone to allow visitor monitoring. I simply want to output the section name rather than the title (e.g. “history_aston” rather than “History of Aston” The plugin obtains the name with this line of code:

$bbcsubtitle = substr(page_title(array()), strlen($sitename)+2);

As far as I can tell, this is the ONLY interaction that the plugin has with Textpattern (no other definitions etc. prior to this code), so I’m fairly certain that this is the source of the section title. Can if figure out how to change it to return section title? Can I heck!

Suggestions?

Stuart

Offline

#2 2009-03-09 22:24:44

jm
Plugin Author
From: Missoula, MT
Registered: 2005-11-27
Posts: 1,746
Website

Re: Returning section name rather than section title from plugin

If you want to return just the section name, then try:

$bbcsubtitle = section(array());

Offline

#3 2009-03-10 06:21:08

phual
Member
From: UK
Registered: 2008-02-19
Posts: 26
Website

Re: Returning section name rather than section title from plugin

That was the bunny! Thanks!

Just out of curiosity, did that suggestion come purely from experience , or is there a resource that I’ve been unable to find that lists functions / global variables / whatever?

Thanks again.

Stuart

Offline

#4 2009-03-10 06:30:36

jm
Plugin Author
From: Missoula, MT
Registered: 2005-11-27
Posts: 1,746
Website

Re: Returning section name rather than section title from plugin

A combination of both :). Every <txp:tag_/>, except for article and article_custom, maps to a function in /textpattern/publish/taghandlers.php (function _tag). So <txp:section/> is function section($atts, $thing=''). For global variables, add the following to your template:

<txp:php>print_r($GLOBALS);</txp:php>

Hope that helps!

Offline

Board footer

Powered by FluxBB