Форумы / Cotonti / General / Correction to Documentation

Hodges
#1 25.04.2013 17:31

From http://www.cotonti.com/page/xtemplate_programming:

"...you can still use the classic way for standalone plugins. You do this by using the variables $plugin_title, $plugin_subtitle and $plugin_body. These are assigned automatically to the tags {PLUGIN_TITLE}, {PLUGIN_SUBTITLE} and {PLUGIN_BODY}. In this case, you don’t need to create your own template file (and you can omit the tpl directory). Cotonti will use the skin’s plugin.tpl instead."

This is incorrect. The variable $plugin_title no longer exists. Instead, system/plugin.php looks like this:

			'PLUGIN_TITLE' => cot_breadcrumbs($pltitle, $cfg['homebreadcrumb']),
			'PLUGIN_SUBTITLE' => $plugin_subtitle,
			'PLUGIN_BODY' => $plugin_body

So how, without our own tpl file, do we set {PLUGIN_TITLE} with a custom string (aside from $L['plu_title'] stored in the plugin language file)?

Added 24 minutes later:

I realise the answer is you probably can't. And that the real solution is to just implement custom tpl for the plugin (which, I know, is simple to do).

Regardless, the documentation needs updating.

Отредактировано: Hodges (25.04.2013 17:56, 11 лет назад)
Trustmaster
#2 26.04.2013 06:57

It's been superseded by $out['subtitle'] which is used no matter if you use $plugin_body or not.

May the Source be with you!