cotonti.com : Site navigation row in header.tpl https://www.cotonti.com Последние сообщения в теме Cotonti en Thu, 09 Oct 2025 13:06:06 -0000 donP http://www.cotonti.com/forums.php?m=posts&q=5170

But we still haven't answer, I think...]]>
пн, 08 фев 2010 22:03:58 -0000
tensh пн, 08 фев 2010 20:47:18 -0000 Trustmaster вс, 07 фев 2010 00:24:51 -0000 donP
$al = sed_import('al', 'G', 'ALP');
to read alias...
but with url tranformation I have to rewrite all the plugin cause there wouldn't be page.php?al=alias anymore in the url, no?
And, more difficult, for lists, cause there wouldn't be list.php?c=categorcode in url, but only cat1/subcat1/... and so for forums...
You say he url transformation is transparent, but my plugin doesn't work if I activare url_rewrite with tat rules...]]>
сб, 06 фев 2010 19:11:17 -0000
Trustmaster mysite.net/cat1/subcat1/alias.html
you can still get alias as normal:
$al = sed_import('al', 'G', 'ALP');
(note: for page.php it will already have been imported even if you hook into header)

And so is for mysite.net/cat1/subcat1/.

URL transformation was designed to be as transparent as possible, so that all the rest works like if there was no transformation at all.]]>
сб, 06 фев 2010 14:31:43 -0000
donP My plugin already works very well now... the problem would come when I'll use url_rewrite, cause in url we wouldn't have page.php?al=alias or list.php?c=category... but

mysite.net/cat1/subcat1/alias.html

or

mysite.net/cat1/subcat1/

so, I'd have to completely rewrite the plugin (that actually reads id and alias values from url).

Instead, I was now searching for a method to obtain category_name as a global variable to use it in a unique header file to draw the appropriate image logo:
<div id="header" style="position: absolute; margin-top: 8px; margin-left: 11px; width: 749px; background: url('{PHP.sed_cat}') no-repeat center top;">

I wouldn't have this need if customheader/customfooter were a real chance, but actually we can only customize areas (e.g. header.list.tpl, header.page.tpl, NOT header.list.cat1.tpl and header.page.cat1.tpl).]]>
сб, 06 фев 2010 07:32:39 -0000
Trustmaster
if (empty($c)) {
  $where = empty($alias) ? 'page_id = '.(int)$id : "page_alias = '".sed_sql_prep($alias)."'";
  $cat_row = sed_sql_fetchassoc(sed_sql_query("SELECT page_cat FROM $db_pages WHERE $where"));
  $c = $cat_row['page_cat'];
}
After that you should either set a global variable or assign a tag containing that title:
$cat_title = $sed_cat[$c]['title'];
// OR
$t->assign('CAT_TITLE', $sed_cat[$c]['title']);
and then use either global {PHP.cat_title} (will work in any template and any block where $cat_title exists) or local {CAT_TITLE} (will work only in the template you assign it).]]>
сб, 06 фев 2010 00:47:49 -0000
donP I wanted to know if in global tags (the list of them doesn't really exist yet) there was one outputting me the category title, every moment, in every site part, calling it from header.tpl

I had this need cause I actually use a good plugin I made for myself taht really changes header images and text as I want, depending from list/page/forum category/section... That plugin, indeed, catches the category by reading the url (c=categorycode for lists, id=ID or al=alias for pages, s=section or m=topic in forums) and querying the database to reach the appropriate category and display different images and text according to that place in the website.
This is a problem (and not the only problem, as Trustmaster knows, cause I've to solve the page.php?a=add problem) if I want to use url_rewrite method, cause the plugin couldn't work anymore if in url we have alias.html instead of page.php?al=alias... :(]]>
пт, 05 фев 2010 19:19:23 -0000
tensh ]]> пт, 05 фев 2010 19:07:59 -0000 Trustmaster
$t->parse('MAIN');
$t->out('MAIN');
]]>
пт, 05 фев 2010 19:00:17 -0000
tensh пт, 05 фев 2010 18:03:15 -0000 Trustmaster $t->out() sends an already parsed block to output]]> пт, 05 фев 2010 17:54:08 -0000 tensh
what's the difference between $t->parse() and $t->out()? Are there other possibilities?]]>
пт, 05 фев 2010 17:42:00 -0000
Trustmaster пт, 05 фев 2010 16:34:31 -0000 pieter
Correct me if I'm wrong.]]>
пт, 05 фев 2010 15:10:46 -0000
donP 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?]]>
пт, 05 фев 2010 08:13:39 -0000
Trustmaster пн, 03 авг 2009 18:22:29 -0000 donP
Incredible and very usefull!!!]]>
пн, 03 авг 2009 17:48:54 -0000
Trustmaster пн, 03 авг 2009 17:42:16 -0000 musiconly I'm using {PHP.pag.page_ownerid}, and it's working, so I think that {PHP.pag.page_fulltitle} will also work :)]]> пн, 03 авг 2009 17:29:22 -0000 donP 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... :/]]>
пн, 03 авг 2009 17:23:47 -0000
Trustmaster
$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]]>
пн, 03 авг 2009 17:14:14 -0000
donP 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 ;)]]>
пн, 03 авг 2009 16:48:10 -0000
Trustmaster 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.]]>
пн, 03 авг 2009 16:40:23 -0000
donP 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!]]>
пн, 03 авг 2009 16:28:21 -0000
Trustmaster
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.]]>
пн, 03 авг 2009 14:38:21 -0000
musiconly пн, 03 авг 2009 05:28:42 -0000 Kilandor
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?]]>
пн, 03 авг 2009 02:50:53 -0000
donP 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=https://www.cotonti.com/\"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?]]>
вс, 02 авг 2009 19:57:02 -0000