Page 2 of 2

Posted: Fri 14. Jan 2005, 11:21
by cacho
Paal wrote:
cacho wrote:Hi

When I place a {CONTENT} or {NAV_TABLE_COLUMN} in my layout its replaced for a lot of non compliant html code (with a lot of tables).

Where could I found a list of those replacement tags and how should I change the inside them ?


Thanks in advance

Javier
URL?
It's inside an intranet...I can't show it...

Nevertheless, I'll need a list of replacement tags by sure..

And the code I told you comes from {NAV_TABLE_COLUMN}. ie:

Code: Select all

<body >
<div id="container">
   <div id="header"></div>

   <div id="left"><table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr bgcolor="#4A5966">
<td><img src="img/leer.gif" width="1" height="1" alt="" /></td><td><img src="img/leer.gif" width="1" height="1" alt="" /></td><td colspan="2"><img src="img/leer.gif" width="1" height="1" alt="" /></td><td><img src="img/leer.gif" width="1" height="1" alt="" /></td>
</tr>
<tr bgcolor="#D9DEE3" style="cursor:pointer;cursor:hand;" onClick="location.href='index.php?id=1,0,0,1,0,0';return false;" onMouseOver="MM_swapImage('linkidBoxqOo','','img/article/nav_link_1.gif',1);this.bgColor='#D3ED7D';" onMouseOut="MM_swapImgRestore();this.bgColor='#D9DEE3';">
<td width="7"><img src="img/leer.gif" width="7" height="15" alt="" /></td>
<td valign="top"><img src="img/article/nav_link_0.gif" alt="" border="" name="linkidBoxqOo" id="linkidBoxqOo"></td>
<td valign="top" style="height:15px;"  width="100%" class="nav_table" colspan="2"><img src="img/leer.gif" width="1" height="2" alt="" /><br /><a href="index.php?id=1,0,0,1,0,0">Novedades</a><br /><img src="img/leer.gif" width="1" height="2" alt="" /></td>
<td width="7"><img src="img/leer.gif" width="10" height="15" alt="" /></td>
</tr>
<tr bgcolor="#4A5966">
<td><img src="img/leer.gif" width="1" height="1" alt="" /></td><td><img src="img/leer.gif" width="1" height="1" alt="" /></td><td colspan="2"><img src="img/leer.gif" width="1" height="1" alt="" /></td><td><img src="img/leer.gif" width="1" height="1" alt="" /></td>
</tr>
</table></div>
   <div id="main"><a name="jump1"></a><span class="articleHead">Test page</span><div class="articleSummary">amazing !</div><img src="img/leer.gif" width="1" height="8" alt=""></div>

   <div id="footer"></div>
</div></body>
</html>
i want to know the origin of menu column...

Thanks in advance

javier

Posted: Fri 14. Jan 2005, 11:46
by Paal
cacho wrote:
It's inside an intranet...I can't show it...

Nevertheless, I'll need a list of replacement tags by sure..

And the code I told you comes from {NAV_TABLE_COLUMN}. ie:

Code: Select all

<body >
<div id="container">
   <div id="header"></div>

   <div id="left"><table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr bgcolor="#4A5966">
<td><img src="img/leer.gif" width="1" height="1" alt="" /></td><td><img src="img/leer.gif" width="1" height="1" alt="" /></td><td colspan="2"><img src="img/leer.gif" width="1" height="1" alt="" /></td><td><img src="img/leer.gif" width="1" height="1" alt="" /></td>
</tr>
<tr bgcolor="#D9DEE3" style="cursor:pointer;cursor:hand;" onClick="location.href='index.php?id=1,0,0,1,0,0';return false;" onMouseOver="MM_swapImage('linkidBoxqOo','','img/article/nav_link_1.gif',1);this.bgColor='#D3ED7D';" onMouseOut="MM_swapImgRestore();this.bgColor='#D9DEE3';">
<td width="7"><img src="img/leer.gif" width="7" height="15" alt="" /></td>
<td valign="top"><img src="img/article/nav_link_0.gif" alt="" border="" name="linkidBoxqOo" id="linkidBoxqOo"></td>
<td valign="top" style="height:15px;"  width="100%" class="nav_table" colspan="2"><img src="img/leer.gif" width="1" height="2" alt="" /><br /><a href="index.php?id=1,0,0,1,0,0">Novedades</a><br /><img src="img/leer.gif" width="1" height="2" alt="" /></td>
<td width="7"><img src="img/leer.gif" width="10" height="15" alt="" /></td>
</tr>
<tr bgcolor="#4A5966">
<td><img src="img/leer.gif" width="1" height="1" alt="" /></td><td><img src="img/leer.gif" width="1" height="1" alt="" /></td><td colspan="2"><img src="img/leer.gif" width="1" height="1" alt="" /></td><td><img src="img/leer.gif" width="1" height="1" alt="" /></td>
</tr>
</table></div>
   <div id="main"><a name="jump1"></a><span class="articleHead">Test page</span><div class="articleSummary">amazing !</div><img src="img/leer.gif" width="1" height="8" alt=""></div>

   <div id="footer"></div>
</div></body>
</html>
i want to know the origin of menu column...

Thanks in advance

javier
You must have a custom css file when you defined "header", "container", "left" and more div tag. Have you? And select this css file in template?

Alternate solution: select in template the frontend.css and use in "html head" area the custom css file, eg.:

Code: Select all

<link rel="stylesheet" type="text/css" href="phpwcms_template/inc_css/tableless.css">
and apply different div id, like frontend.css (not left id, #containerLeft, etc.) that in 2 css same id not owerwrite each other.

Like:
frontend.css
body {
}

tableless.css
body {
}

P.

Posted: Fri 14. Jan 2005, 12:51
by rk
Hello cacho,
i think you get already many tipps in this thread.

Another page i made is
http://www.idz-hannover.de

I use a "template base" from http://www.csszengarden.com/ and modify the css.

phpwcms configuration like this.

Pagelayout:
all fields empty, except pagetitle
and custom (from template main block)


Template:

Code: Select all

<div id="container">
<div id="intro">
<h1><span><a href="http://www.magicpages.de/index.php">Integriertes Diabetiker-Zentrum Hannover</a></span></h1>
<h2><span>{BREADCRUMB}</span></h2>
</div><!-- DEBUG: intro -->

<div id="supportingText">
<div id="teaser">
{CONTENT}
</div><!-- DEBUG: teaser -->

<div id="footerBlock">
<p><span class="NoPrint">[BACK]Zurück[/BACK]&nbsp;&bull;&nbsp;[INT ubersicht.phtml]&Uuml;bersicht[/INT]&nbsp;&bull;&nbsp;[INT impressum.phtml]Impressum[/INT]&nbsp;&bull;&nbsp;</span>Copyright&nbsp;&copy;&nbsp;{PHP:ext_php/year.php}&nbsp;[INT kontakt.phtml]IDZ-Hannover[/INT]&nbsp;&bull;&nbsp;Stand: {DATE_ARTICLE}<span class="NoPrint">[PRINT]<img src="picture/drucken.gif" alt="Seite drucken" title="Seite drucken" height="20" width="36" align="middle">[/PRINT]</span></p>
</div><!-- DEBUG: footerBlock -->
</div><!-- DEBUG: supportingText -->

<div id="leftBlock">
{NAV_LIST_ALL}
</div><!-- DEBUG: leftBlock -->

</div><!-- DEBUG: container -->

and i change many things in conf.template_default.inc.php, like

Code: Select all

// article default
$template_default["article"]["title_before"]	= "<h2>";
$template_default["article"]["title_after"]		= "</h2>";
$template_default["article"]["title_class"]		= "";

There is something to do that it works :-).

I use a menu-hack for {NAV_LIST_ALL}.

My css is not very "clean" at the moment. I must work on it ;-).

Posted: Fri 14. Jan 2005, 18:03
by frold
cool

Posted: Fri 14. Jan 2005, 22:37
by cacho
Paal wrote:
cacho wrote:
It's inside an intranet...I can't show it...

Nevertheless, I'll need a list of replacement tags by sure..

And the code I told you comes from {NAV_TABLE_COLUMN}. ie:

Code: Select all

<body >
<div id="container">
   <div id="header"></div>

   <div id="left"><table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr bgcolor="#4A5966">
<td><img src="img/leer.gif" width="1" height="1" alt="" /></td><td><img src="img/leer.gif" width="1" height="1" alt="" /></td><td colspan="2"><img src="img/leer.gif" width="1" height="1" alt="" /></td><td><img src="img/leer.gif" width="1" height="1" alt="" /></td>
</tr>
<tr bgcolor="#D9DEE3" style="cursor:pointer;cursor:hand;" onClick="location.href='index.php?id=1,0,0,1,0,0';return false;" onMouseOver="MM_swapImage('linkidBoxqOo','','img/article/nav_link_1.gif',1);this.bgColor='#D3ED7D';" onMouseOut="MM_swapImgRestore();this.bgColor='#D9DEE3';">
<td width="7"><img src="img/leer.gif" width="7" height="15" alt="" /></td>
<td valign="top"><img src="img/article/nav_link_0.gif" alt="" border="" name="linkidBoxqOo" id="linkidBoxqOo"></td>
<td valign="top" style="height:15px;"  width="100%" class="nav_table" colspan="2"><img src="img/leer.gif" width="1" height="2" alt="" /><br /><a href="index.php?id=1,0,0,1,0,0">Novedades</a><br /><img src="img/leer.gif" width="1" height="2" alt="" /></td>
<td width="7"><img src="img/leer.gif" width="10" height="15" alt="" /></td>
</tr>
<tr bgcolor="#4A5966">
<td><img src="img/leer.gif" width="1" height="1" alt="" /></td><td><img src="img/leer.gif" width="1" height="1" alt="" /></td><td colspan="2"><img src="img/leer.gif" width="1" height="1" alt="" /></td><td><img src="img/leer.gif" width="1" height="1" alt="" /></td>
</tr>
</table></div>
   <div id="main"><a name="jump1"></a><span class="articleHead">Test page</span><div class="articleSummary">amazing !</div><img src="img/leer.gif" width="1" height="8" alt=""></div>

   <div id="footer"></div>
</div></body>
</html>
i want to know the origin of menu column...

Thanks in advance

javier
You must have a custom css file when you defined "header", "container", "left" and more div tag. Have you? And select this css file in template?

Alternate solution: select in template the frontend.css and use in "html head" area the custom css file, eg.:

Code: Select all

<link rel="stylesheet" type="text/css" href="phpwcms_template/inc_css/tableless.css">
and apply different div id, like frontend.css (not left id, #containerLeft, etc.) that in 2 css same id not owerwrite each other.

Like:
frontend.css
body {
}

tableless.css
body {
}

P.
I appreciate your good intention but I don't know if I did not explained correctly my problem or nobody understand me..but it's frustrant.

Yes, I've defined a custom css and it works great and the css layout works great. My question regards about the code that appers when {NAV_TABLE_COLUMN} is replaced with data inside phpwcms. I think this have nothing related with my css. This is a code that I never touched and the tables that appears there are table I never configured and I ignore their origin.

Then I want to know where is the code that replace {NAV_TABLE_COLUMN}, WHY this code have html embed with tables, etc...

Also, I WILL NEED to know the list of replacement tags that surely I WILL use in my application and I couldn't find any doc or answer about it.

Pphpwcms appers to be a powerfull aplication but it's so frustrant the feeling that I need to advance slowly, step by step asking everything in the forum because important docs are dispersed all around the net...

I hope somebody could understand the point...

Thanks in advance

Javier

Posted: Sat 15. Jan 2005, 00:47
by spirelli
cacho wrote:Then I want to know where is the code that replace {NAV_TABLE_COLUMN}, WHY this code have html embed with tables, etc...
That's hard coded somewhere in phpwcms. Unfortunaltely I am not able to tell you where. Maybe someone else knows. And it's got tables because I guess that's what the programmer decided to do, Sorry, I haven't got a better explanation.

cacho wrote: Also, I WILL NEED to know the list of replacement tags that surely I WILL use in my application and I couldn't find any doc or answer about it.
List of Replacement tags is here: http://www.phpwcms-docu.de/replacement_tags_en.phtml

Posted: Sat 15. Jan 2005, 02:28
by Karla
cacho wrote:WHY this code have html embed with tables, etc...
Perhaps the Bold red word will clarify why???
{NAV_TABLE_COLUMN}
cacho wrote:Then I want to know where is the code that replace {NAV_TABLE_COLUMN}
"include/inc_front/content.func.inc.php" shows the replacement tag call to function that constructs the "table-based" menu:

Code: Select all

// Left table based rollover navigation
if( ! ( strpos($content["all"],'{NAV_TABLE_COLUMN')===false ) ) {
	$content["all"] = str_replace('{NAV_TABLE_COLUMN}', '{NAV_TABLE_COLUMN:0}', $content["all"]);
	$replace = 'nav_table_struct($content["struct"],intval($content["cat_id"]),"$1",$template_default["nav_table_struct"]);';
	$content["all"] = preg_replace('/\{NAV_TABLE_COLUMN:(\d+)\}/e', $replace, $content["all"]);
}
"include/inc_front/front.func.inc.php" shows actual build routine for the "table-based" menu:

Code: Select all

// -------------------------------------------------------------


function nav_table_struct ($struct, $act_cat_id, $level, $nav_table_struct, $link_to="index.php") {
	// start with home directory for the listing = top nav structure
	// 1. Build the recursive tree for given actual article category ID
	
	// return the tree starting with given start_id (like breadcrumb)
	// if the $start_id = 0 then this stops because 0 = top level
	
	$level = intval($level);
	$start_id = $act_cat_id;
	
	while ($start_id) {
		$data[$start_id] = 1;
		$start_id		 = $struct[$start_id]["acat_struct"];
	}
	$temp_tree = (sizeof($data)) ? array_reverse($data, 1) : false;
	
	foreach($struct as $key => $value) {
		if($struct[$key]["acat_struct"] == $act_cat_id && $key && !$struct[$key]["acat_hidden"]) $c++;
	}
	$c = (!$c) ? 1 : 0;
	
	//build image src path and real image tag
	//$nav_table_struct["linkimage_norm_js"]   = get_real_imgsrc($nav_table_struct["linkimage_norm"]);
	$nav_table_struct["linkimage_over_js"]   = get_real_imgsrc($nav_table_struct["linkimage_over"]);
	//$nav_table_struct["linkimage_active_js"] = get_real_imgsrc($nav_table_struct["linkimage_active"]);
	
	$nav_table_struct["linkimage_norm"]		= add_linkid($nav_table_struct["linkimage_norm"],   '#');
	$nav_table_struct["linkimage_over"]		= add_linkid($nav_table_struct["linkimage_over"],   '#');
	$nav_table_struct["linkimage_active"]	= add_linkid($nav_table_struct["linkimage_active"], '#');
	
	//get depth of level
	$level_depth = 0; $start_level = $level;
	while ($start_level) {
		$start_level = $struct[$start_level]["acat_struct"];
		$level_depth++;
	}
	$temp_menu = build_levels ($struct, $level, $temp_tree, $act_cat_id, $nav_table_struct, $level_depth, $c, $link_to); //starts at root level
	return ($temp_menu) ? ("<table".table_attributes($nav_table_struct, "table", 0).">\n".$temp_menu."</table>") : "";
}

function get_real_imgsrc($img='') {
	// strips real src attribute from image tag
	if($img) {	
		$img = preg_replace('/.*src=["|\'](.*?)["|\'].*/i', "$1", $img);
	}
	return $img;
}

function add_linkid($img='', $linkid='') {
	//used to add the link ID for js over functions
	$img = preg_replace('/( \/>|>)$/', $linkid."$1", $img);
	return $img;
}

// -------------------------------------------------------------

function build_levels ($struct, $level, $temp_tree, $act_cat_id, $nav_table_struct, $count, $div, $link_to) {
	// this returns the level structure based on given arrays
	// it is special for browsing from root levels
	$depth = sizeof($temp_tree)-$div; $count++; $depth2 = $depth-$count+2;
	
	$right_cell = ""; $left_cell = ""; $cell_top = ""; $cell_bottom = ""; $space_right = ""; $space_cell = ""; $space_row = "";
	$cell_height = ($nav_table_struct["cell_height"]) ? $nav_table_struct["cell_height"] : 1;
	if($nav_table_struct["space_right"]) {
		$right_cell  = "<td width="".$nav_table_struct["space_left"]."">";
		$right_cell .= spacer($nav_table_struct["space_right"], $cell_height)."</td>\n";
		$space_right = "<td>".spacer(1, 1)."</td>";
	}
	if($nav_table_struct["space_left"]) {
		$colspan	= ($count > 1) ? " colspan="".$count.""" : "";
		$left_cell	= "<td width="".$nav_table_struct["space_left"].""".$colspan.">";
		$left_cell .= spacer($nav_table_struct["space_left"], $cell_height)."</td>\n";
		$space_cell = "<td".$colspan.">".spacer(1, 1)."</td><td>".spacer(1, 1)."</td>";
	} else {
		if($count > 1) {
			$colspan	= ($count > 2) ? " colspan="".($count-1).""" : "";
			$left_cell	= "<td ".$colspan.">".spacer(1, 1)."</td>\n";
			$space_cell = "<td".$colspan.">".spacer(1, 1)."</td><td>".spacer(1, 1)."</td>";
		}
	}
	if($nav_table_struct["space_celltop"]) $cell_top = spacer(1, $nav_table_struct["space_celltop"])."<br />";
	if($nav_table_struct["space_cellbottom"]) $cell_bottom = "<br />".spacer(1, $nav_table_struct["space_cellbottom"]);
	
	$temp_menu	= ""; $js = "";
	$colspan	= ($depth2 > 1) ? " colspan="".$depth2.""" : "";
	
	foreach($struct as $key => $value) {
		if($_SESSION["frontend_user_in"] && $struct[$key]["acat_regonly"]) $struct[$key]["acat_regonly"] = 0;
		if($struct[$key]["acat_struct"] == $level && $key && !$struct[$key]["acat_hidden"] && !$struct[$key]["acat_regonly"]) {
			
			$link_image_id	= "linkid".randpassword(6);
			$link_name_id 	= ' name="'.$link_image_id.'" id="'.$link_image_id.'"';
						
			if(!$struct[$key]["acat_redirect"]) {
				$link = 'index.php?';
				if($struct[$key]["acat_alias"]) {
					$link .= html_specialchars($struct[$key]["acat_alias"]);
				} else {
					$link .= 'id='.$key.',0,0,1,0,0';
				}
				$redirect['target'] = '';
			} else {
				$redirect = get_redirect_link($struct[$key]["acat_redirect"], ' ', '');
				$link = $redirect['link'];
			}
			
			$js		= ' style="cursor:pointer;cursor:hand;"'; //display:block;
			$js_act = $js;
			if($nav_table_struct["js_over_effects"]) {
			
				if($redirect['target'] != ' target="_blank"') {
					$js .= " onClick="location.href='".js_singlequote($link)."';return false;"";
				} else {
					$js .= " onClick="window.open('".js_singlequote($link)."', 'phpwcmnewwin');return false;"";
				}
				
				$js_act = $js;
				$js .= ' onMouseOver="';
				if($nav_table_struct["linkimage_over_js"]) {
					$js .= "MM_swapImage('".$link_image_id."','','".$nav_table_struct["linkimage_over_js"]."',1);";
				}
				if($nav_table_struct["row_over_bgcolor"]) $js .= "this.bgColor='".$nav_table_struct["row_over_bgcolor"]."';";
				$js .= '" onMouseOut="';
				if($nav_table_struct["linkimage_over_js"]) $js .= "MM_swapImgRestore();";
				if($nav_table_struct["row_norm_bgcolor"]) $js .= "this.bgColor='".$nav_table_struct["row_norm_bgcolor"]."';";
				$js .= '"';
			} else {
				$js = '';
			}
			
			//spacer row
			if($nav_table_struct["row_space"]) {
				$space_row  = "<tr".table_attributes($nav_table_struct, "row_space", 0).">\n".$space_cell;
				$space_row .= "<td".$colspan.">".spacer(1, $nav_table_struct["row_space"])."</td>";
				$space_row .= $space_right."\n</tr>\n";
				$temp_menu .= $space_row;
			}
			
			if($temp_tree[$key]) {
				if($act_cat_id == $key) {
					$temp_menu .= "<tr".table_attributes($nav_table_struct, "row_active", 0).$js_act.">\n".$left_cell;
					$temp_menu .= "<td valign="top">".str_replace('#', $link_name_id, $nav_table_struct["linkimage_active"])."</td>\n";
					$temp_menu .= "<td".table_attributes($nav_table_struct, "cell_active", 1).$colspan.">".$cell_top;				
					$temp_menu .= '<a href="'.$link.'"'.$redirect['target'].'>'.html_specialchars($struct[$key]["acat_name"]).'</a>';
				} else {
					$temp_menu .= "<tr".table_attributes($nav_table_struct, "row_norm", 0).$js.">\n".$left_cell;
					$temp_menu .= "<td valign="top">".str_replace('#', $link_name_id, $nav_table_struct["linkimage_norm"])."</td>\n";
					$temp_menu .= "<td".table_attributes($nav_table_struct, "cell", 1).$colspan.">".$cell_top;				
					$temp_menu .= '<a href="'.$link.'"'.$redirect['target'].'>'.html_specialchars($struct[$key]["acat_name"])."</a>";
				}
				
				$temp_menu .= $cell_bottom."</td>\n".$right_cell."</tr>\n";
				$temp_menu .= build_levels ($struct, $key, $temp_tree, $act_cat_id, $nav_table_struct, $count, $div, $link_to);
			} else {
				$temp_menu .= "<tr".table_attributes($nav_table_struct, "row_norm", 0).$js.">\n".$left_cell;
				$temp_menu .= "<td valign="top">".str_replace('#', $link_name_id, $nav_table_struct["linkimage_norm"])."</td>\n";
				$temp_menu .= "<td".table_attributes($nav_table_struct, "cell", 1).$colspan.">".$cell_top;
				$temp_menu .= '<a href="'.$link.'"'.$redirect['target'].'>'.html_specialchars($struct[$key]["acat_name"])."</a>";
				$temp_menu .= $cell_bottom."</td>\n".$right_cell."</tr>\n";
			}
		}
	}
	
	if($nav_table_struct["row_space"] && $count == 1) $temp_menu .= $space_row;
	
	return $temp_menu;
}

Posted: Sat 15. Jan 2005, 09:49
by cacho
Thanks a lot for both explanations..this is the info needed...

Javier