Manipulating "Back to list page" Link

4 posts by 2 authors in: Forums > CMS Builder
Last Post: July 19, 2012   (RSS)

Re: [osga] Manipulating "Back to list page" Link

By Jason - July 18, 2012

Hi,

No problem. What I would suggest is manually outputting your own list page link.

For example, if your list page was called articleList.php and your category field was called category, your link would look like this:

EXAMPLE:
<a href="articleList.php?category=<?php echo $article['category'];?>">&lt;&lt; Back to list page</a>

In this example, $article is the variable you were using to output the contents of a single article record.

Hope this helps
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

Re: [Jason] Manipulating "Back to list page" Link

By osga - July 19, 2012

Hi Jason, thanks for the start... i changed the "articleList.php" to our template page but it still lists every category we have...and gives a url of:
online_gaming.php?category=Notice: Undefined variable: article in /var/www/html/osga.com/online_gaming_articles.php on line 231

Maybe i shoulda prefaced my question with "we are really bad with php..." lol! What are we missing here? the "$article" or the "['category']"

Re: [osga] Manipulating "Back to list page" Link

By Jason - July 19, 2012

Hi,

$article will need to be replaced with whatever variable you're using on the page to output your content. A good way to figure this out is to see how your article title is being output in the code.

For example, if your variable was $articlesRecord, you would see:
<?php echo $articlesRecord['title'];?>

Whatever variable this is, is what you need to use in the example code. Also going through your site, it looks like you use the field categoryNum instead of category.

Give that a try.
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/