Forums / Cotonti / Support / Site navigation row in header.tpl

12>>>

how can I create a plugin to do that?

donP
#1 2009-08-02 19:57
Hello everybody!
I'm converting my seditio website to Cotonti.

Well... in Seditio I made hacks to several files to output the site navigation row in header.tpl...

e.g.
in skins/myskin/HEADER.TPL
I had
{PHP.out.youre}
and in system/core/page/page.inc.php
$out['youre'] = $pag['page_fulltitle'];
in system/core/list/list.inc.php
$out['youre'] = $catpath;
in system/core/forums/forums.posts.inc.php
$out['youre'] = "<a href=\"forums.php\">".$L['Forums']."</a> ".$cfg['separator']." ".sed_build_forums($s, $fs_title, $fs_category);
in system/core/plug/plug.inc.php
$out['youre'] = $out['subtitle'];

Now... how can I do the same job without those core haks and using a plugin and hooks?
in [color=#729FCF][b]BLUES[/b][/color] I trust
Kilandor
#2 2009-08-03 02:50
I recommened enabling customhf in config. This allows you to create different headers for each area.

And you can just use ex {PHP.pag.page_fulltitle} or {PHP.catpath} or {PHP.out.subtitle} for the forums one you could use...That one you would have to hack or plugin.

What are you using these for exactly?
musiconly
#3 2009-08-03 05:28
Those are breadcrumbs, right?
Trustmaster
#4 2009-08-03 14:38
These are breadcrumbs but in header.tpl rather than body. The problem is that the header is normally sent to output before the body gets executed. So either you make a plugin for header.tags hook which duplicates those actions from core (not just those variables but also the way they are received), or we need to change the execution flow from header->body->footer to body->header->footer.

But what I would recommend for now is putting breadcrumbs in body templates rather than header template. It's not such a hard thing, especially with CSS.
May the Source be with you!
donP
#5 2009-08-03 16:28
Yes, the right word to explain my needs was breadcrumbs, but I'm Italian and I don't know such a great and specific lexicon :P

Putting breadcrumbs in header .tpl is more simple (and more universally compatible with all browser) than operating with CSS and absolute positioning. In addiction, I needed to create specific breadcrumbs (with Home(link) / Section(link) / Subsection(link) / Actual Section(plain text) / NO PAGE OR TOPIC TITLE) that sometimes haven't got the appropriate TAG already included in the system... So, this was the situation of Seditio CMF... what about Cotonti CMF? Are there new tags, is there a list of them?

Another question... creating a new header.tpl for every section or category I need, will make me crazy and my Server full of many very similiar and useless tpls... (I need only to change the background Image - I was reassembling Logochanger plugin to do that - and breadcrumbs)...

Last question (considering the fact I'm very new to the wonderful world of Cotonti): the local/html/disk(template) CACHE wouldn't interfere with my need to ever change header contents?

Many thank to all of you!
THIS finally is a FANATASTIC community!
in [color=#729FCF][b]BLUES[/b][/color] I trust
Trustmaster
#6 2009-08-03 16:40
See TPL Tags

I actually wonder how {PHP.out.youre} worked in Seditio, because it did the same thing: rendered header.tpl before main part even got executed.

HTML cache only caches page text and updates every time you update the text. Template cache only caches the TPL file structure and updates every time you edit the TPL file.
May the Source be with you!
donP
#7 2009-08-03 16:48
Because PHP.out and PHP.sys are global (core defined) variables and not template tags, aren't they? So they'd have always priority...

And, speaking of that, where can I find all Cotonti .out and .sys variables?

Thank you very much ;)
in [color=#729FCF][b]BLUES[/b][/color] I trust
Trustmaster
#8 2009-08-03 17:14
And those are still global variables. But you see what happens in the script:
$t = new XTemplate('header.tpl');
// something
$t->parse('HEADER');
$t->out('HEADER');
// The template has been rendered and sent to output

$t = new XTemplate('page.tpl');
// This is where your corehack works
$out['youre'] = 'Something';
$t->parse('MAIN');
// Here it parses MAIN, not HEADER which is not accessile
$t->out('MAIN');


Added 39 seconds later:

Global tag listing
May the Source be with you!
donP
#9 2009-08-03 17:23
I don't know how could work but it worked.
Now I can't try in Cotonti cause I'm not on my PC, I'll try and tell you...

By the way, in global tag listing I didn't find the {PHP.catpath} or {PHP.pag.page_fulltitle} that Kilandor said... :/
in [color=#729FCF][b]BLUES[/b][/color] I trust
musiconly
#10 2009-08-03 17:29
I'm 99% sure that the tags you didn't find will work.
I'm using {PHP.pag.page_ownerid}, and it's working, so I think that {PHP.pag.page_fulltitle} will also work :)
Trustmaster
#11 2009-08-03 17:42
That listing is of course incomplete, because there are hundreds of variables you could possibly access via {PHP.*}
May the Source be with you!
donP
#12 2009-08-03 17:48
So, this means that every variable of every part of the core (such as page.inc, list.inc, forum.posts.inc) is accessible by any tpl (header.tpl, footer.tpl, page.tpl)?

Incredible and very usefull!!!
in [color=#729FCF][b]BLUES[/b][/color] I trust
Trustmaster
#13 2009-08-03 18:22
Yes, if it is global (i.e. not assigned within some function scope)
May the Source be with you!
donP
#14 2010-02-05 08:13
Trustmaster:
Global tag listing
That link doesn't point to a real URL... :(


How can I call sed_cat[$c]['title'] with a .tpl TAG in header?
in [color=#729FCF][b]BLUES[/b][/color] I trust
pieter
#15 2010-02-05 15:10
If it is global you can use {PHP.c.title}??

Correct me if I'm wrong.
... can we help you ...

12>>>