List with related articles

Get help with installation and running phpwcms here. Please do not post bug reports or feature requests here.
Post Reply
Igor
Posts: 97
Joined: Fri 30. Apr 2004, 16:30
Location: The Netherlands
Contact:

List with related articles

Post by Igor »

Hello,

I use the {RELATED}-tag to display related articles. I want each page title of a related article (link) to be displayed within a <td></td> block. So I configured the conf.template_default.inc.php-file as follows:

Code: Select all

// related articles based on keywords
$template_default["related"]["before"]		= "";
$template_default["related"]["after"]		= "";
$template_default["related"]["link_before"]		= "<td>";
$template_default["related"]["link_after"]		= "</td>";
$template_default["related"]["link_symbol"]		= "";
$template_default["related"]["link_target"]		= "";
$template_default["related"]["link_length"]		= 0; //if 0 no limit
$template_default["related"]["cut_title_add"]	= "…";
But on my site the </td> code is not inserted!

This is the HTML-code in my template:

Code: Select all

<table width="100" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td valign="top"><a href="/nieuws_zorg.phtml"><b>Nieuws zorg</b></a><br>
        <img src="/img/nav/subnavi_line_dot.gif" width="90" height="10">{RELATED:5:hypotheken}</td>
  </tr>
</table>
and this is the resulting HTML-code after the page has been made by phpwcms:

Code: Select all

<table width="100" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td valign="top"><a href="/nieuws_zorg.phtml"><b>Nieuws zorg</b></a><br>
        <img src="/img/nav/subnavi_line_dot.gif" width="90" height="10"><td><a href="25.17.0.0.1.0.phtml">Pensioensparen (IPS)</a><td><a href="3.4.0.0.1.0.phtml">Hypotheken</a></td>
  </tr>
</table>
After the </a> tags, the </td> tags should be inserted.

Who can help? I don't see it anymore. :?
Igor
Pappnase

Post by Pappnase »

hello

yes this could happen as far as i know there sometimes small bugs in the conf.template..... you need to setup the td in the template.
Igor
Posts: 97
Joined: Fri 30. Apr 2004, 16:30
Location: The Netherlands
Contact:

Post by Igor »

OK, could happen. But that's no solution, because the number of </td> tags depends on the number of related articles. I will look for another solution, without <td>

Thanks.
Igor
Pappnase

Post by Pappnase »

hello igor

why did you not edit the template this way!?

<table width="100" border="0" cellpadding="0" cellspacing="0">
<tr>
<td valign="top"><a href="/nieuws_zorg.phtml"><b>Nieuws zorg</b></a><br>
<img src="/img/nav/subnavi_line_dot.gif" width="90" height="10"><td>{RELATED:5:hypotheken}</TD></td>
</tr>
</table>
Igor
Posts: 97
Joined: Fri 30. Apr 2004, 16:30
Location: The Netherlands
Contact:

Post by Igor »

Hello Pappnase,

In this situation, the whole block with all the links is contained between the <td> tags. I want each link in a separate <td> block. So I can make a css-class for each link.

Thanks anyway.
Igor
shakkalakka
Posts: 21
Joined: Thu 16. Dec 2004, 22:52
Location: Winterthur, Switzerland
Contact:

Post by shakkalakka »

Hi Igor, I'm a bit late but i had the same problem. My solution is: open the front.func.inc.php file, go to about line 1662 and replace

Code: Select all

				//try to remove possible unwanted after - if not enclosed before.link.after
				if($keyword_links && !$template_default["link_before"] && $count < $count_results) {
					$keyword_links .= $template_default["link_after"];
				}
with

Code: Select all

				$keyword_links .= $template_default["link_after"];
				
				/*
				//try to remove possible unwanted after - if not enclosed before.link.after
				if($keyword_links && !$template_default["link_before"] && $count < $count_results) {
					$keyword_links .= $template_default["link_after"];
				}
				*/
In other words comment the 'if statements' that prevent the 'link_after' part from being displyed

Cheers!
Igor
Posts: 97
Joined: Fri 30. Apr 2004, 16:30
Location: The Netherlands
Contact:

Post by Igor »

Well thank you! This is great. :D Thought it was a bug.

I wanted to place each link in a seperate <td> block, so I could give each <td> block a css hover-effect. Here is a nice article about that: http://www.alistapart.com/articles/tableruler/.
Igor
Post Reply