Page 1 of 1
SubNavi
Posted: Mon 24. Jan 2005, 21:07
by ssyfrig
Hi zusammen
Ich mir nicht ganz sicher ob das das richtige Forum zum posten ist, aber ich denke hier ist es gut aufgehoben. Denke es ist nur microHack
Ich wollte eine Subnavigation welche nur erscheint, wenn auch Unterkategorien vorhanden sind. Wenn möglich wollte ich dies nicht über den switch($check_id) wie im nav.php lösen.
Nun habe ich die Lösung für mich gefunden.
Code: Select all
{NAV_TABLE_COLUMN:[PHP]$check_id = $GLOBALS['content']['cat_id'];echo
$check_id;[/PHP]}
Im frontend wird nun der RT richtig abgefüllt.
Beste Grüsse
Sven
Posted: Mon 24. Jan 2005, 21:08
by frold
and for the english speakers - plz
Posted: Mon 24. Jan 2005, 21:11
by ssyfrig
This simple code shows a sub navigation if sub categories exist.
Posted: Wed 26. Jan 2005, 16:43
by brans
Place the following code into any file in your frontend_render folder and use {SUB_TABLE_COLUMN} which will create a sub_menu if available.
Code: Select all
if( ! ( strpos($content["all"],'{SUB_TABLE_COLUMN')===false ) ) {
$replace = 'nav_table_struct($content["struct"],intval($content["cat_id"]),$content["cat_id"],$template_default["nav_table_struct"]);';
$content["all"] = preg_replace('{SUB_TABLE_COLUMN}', $replace, $content["all"]);
}
Posted: Wed 26. Jan 2005, 22:08
by ragi
brans wrote:Place the following code into any file in your frontend_render folder and use {SUB_TABLE_COLUMN} which will create a sub_menu if available.
Code: Select all
if( ! ( strpos($content["all"],'{SUB_TABLE_COLUMN')===false ) ) {
$replace = 'nav_table_struct($content["struct"],intval($content["cat_id"]),$content["cat_id"],$template_default["nav_table_struct"]);';
$content["all"] = preg_replace('{SUB_TABLE_COLUMN}', $replace, $content["all"]);
}
It returns alway this string:
nav_table_struct($content["struct"],intval($content["cat_id"]),$content["cat_id"],$template_default["nav_table_struct"]);
What I´m doing wrong there?
Posted: Wed 26. Jan 2005, 22:20
by frold
ragi wrote:brans wrote:Place the following code into any file in your frontend_render folder and use {SUB_TABLE_COLUMN} which will create a sub_menu if available.
Code: Select all
if( ! ( strpos($content["all"],'{SUB_TABLE_COLUMN')===false ) ) {
$replace = 'nav_table_struct($content["struct"],intval($content["cat_id"]),$content["cat_id"],$template_default["nav_table_struct"]);';
$content["all"] = preg_replace('{SUB_TABLE_COLUMN}', $replace, $content["all"]);
}
It returns alway this string:
nav_table_struct($content["struct"],intval($content["cat_id"]),$content["cat_id"],$template_default["nav_table_struct"]);
What I´m doing wrong there?
did you enable frontend_render?
$phpwcms["allow_ext_render"] = 0
If you use existing functions from the INIT folder for rendering the page.
These files can be rendered from the directory
/phpwcms_template/inc_script/frontend_render
Default = 0 Forbidden / 1 = Allowed.
Posted: Thu 27. Jan 2005, 09:52
by ragi
Yes I have enabled frontend_render.
Other stuff are well. It is only this one script. It returns always the string from the variable $replace and I don´t know why.
have anybody an idea what I´m doing wrong?
Posted: Thu 27. Jan 2005, 10:14
by brans
I didn't test this replacement tag!
hmm I will have to do so.. I will post here if I get any result.