Relevant infromation with links

6 posts by 3 authors in: Forums > CMS Builder
Last Post: September 22, 2008   (RSS)

Re: [sjenko] Relevant infromation with links

By Donna - September 18, 2008

Hi sjenko!

Thanks for your post. :)

It looks like your link is missing the actual filename that you're linking to, and it's instead just trying to link to a file called "4" (or whatever record number applies.)

So, you'll need to fill in the actual filename of the page you're linking to, for example:

<a href="viewer.php?<?php echo $record['num'] ?>"><?php echo $record['related_news'] ?></a>

If you're still having trouble, can you send me the link to the page that you're working with?
Donna

--
support@interactivetools.com

Re: [Donna] Relevant infromation with links

Hey Donna.

Thanks for the reply.

I have implemented what you suggested, which seems to work to a degree, apart from the related item is referencing the num value of the page its beingdisplayed on and not the value of itself.

Here is the code now:
<a href="../../../news/news_article.php/-<?php echo $record['num'] ?>/"><?php echo $record['related_news'] ?></a>

So the record 'number' is referencing the page it resides and not the item itself.

Thanks
Simon

Re: [sjenko] Relevant infromation with links

By Donna - September 19, 2008

Hi there,

The number needs to be part of the query string itself, rather than trying to be pulled in as a separate page. So, it would be more like this:

<a href="../../../news/news_article.php?<?php echo $record['num'] ?>"><?php echo $record['related_news'] ?></a>

The final output when it's viewed through a browser should be something like this (with the correct record number showing of course):

<a href="../../../news/news_article.php?4">Link Title</a>

Does that make sense?
Donna

--
support@interactivetools.com

Re: [Donna] Relevant infromation with links

Hi Donna

ok the link is working perfect, maybe I didnt explain properly previousley, sorry, This issue is the when I click the related news piece, the echo is seeing it from current item, so item 3 and its following this value through when linking to the related news so isnt displaying the correct related news piece once clicked. Its displating the value of the prvious item "3".

I need to extract the value from the related news so it can link to it, I am using a SQL query that looks like this:

SELECT CONCAT_WS(" ", related_title, summary_short), CONCAT_WS(" ", related_title, summary_short) FROM cms_news

Do i need the num of the related news piece

Re: [sjenko] Relevant infromation with links

By Dave - September 22, 2008

Using straight SQL is pretty advanced but yes, you need the record number in order to link to it. Perhaps like this:

SELECT num, CONCAT_WS(" ", related_title, summary_short) FROM cms_news
Dave Edis - Senior Developer
interactivetools.com