SubNavi

Post custom hacks and enhancements for phpwcms here only. Maybe some of these things will be included in official release later.
Post Reply
ssyfrig
Posts: 364
Joined: Tue 2. Mar 2004, 17:01
Location: Zürich / Switzerland
Contact:

SubNavi

Post 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. :D

Beste Grüsse
Sven
frold
Posts: 2151
Joined: Tue 25. Nov 2003, 22:42

Post by frold »

and for the english speakers - plz :D
http://www.studmed.dk Portal for doctors and medical students in Denmark
ssyfrig
Posts: 364
Joined: Tue 2. Mar 2004, 17:01
Location: Zürich / Switzerland
Contact:

Post by ssyfrig »

This simple code shows a sub navigation if sub categories exist.
brans

Post 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"]);
}
ragi
Posts: 44
Joined: Wed 22. Sep 2004, 09:31
Contact:

Post 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?
frold
Posts: 2151
Joined: Tue 25. Nov 2003, 22:42

Post 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.
http://www.studmed.dk Portal for doctors and medical students in Denmark
ragi
Posts: 44
Joined: Wed 22. Sep 2004, 09:31
Contact:

Post 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?
brans

Post 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.
Post Reply