Interesting problem..

7 posts by 2 authors in: Forums > CMS Builder
Last Post: August 11, 2009   (RSS)

Re: [northernpenguin] Interesting problem..

By Chris - August 10, 2009

Hi northernpenguin,

If your articles belonged to a single category each, then you'd simply need to append ?categories=<?php echo $record['category']?> to your list page link. The way I see things, there are three choices for how to deal with "back to list" links for articles with multiple categories:

1. One link per category which the article belongs to. (e.g. See more Environment articles. See more International articles.)

2. Simulate the browser's back button with JavaScript. While this design decision is quite popular, consider what would happen to a visitor who arrived at your article directly (via Google search results or a link from an email.)

3. Remember which category the visitor was browsing and create a link for just that category (e.g. using the query string). Consider again what link should appear for a visitor who arrived at your article directly -- should they see a link back to the same category that their search engine or friend just happened to use to arrive at the article originally?

I think the first solution is probably the best, if you don't mind multiple links on articles which belong to multiple categories.

Let us know which approach you'd like to take and we can show you how to accomplish it.
All the best,
Chris

Re: [chris] Interesting problem..

Chris: thanx for the prompt reply. I am using multiple categories (depends upon the article), so your single category option would probably not work.

Option 1 would list all the articles with that category, which is not really what my client wants.

Options 2 is not what I want either.

Option 3 is really the closest, except instead of using the category, is there a way of actually capturing the specific article chosen in case_study.php? That would get me back to the "parent" article, which is where my client wants to be.
--
northernpenguin
Northern Penguin Technologies

"Any sufficiently advanced technology
is indistinguishable from magic."
........Arthur C. Clarke

Re: [northernpenguin] Interesting problem..

By Chris - August 10, 2009

Hi northernpenguin,

I must be confused about what you want to accomplish. Can you explain to me exactly what you want your visitor to see after clicking "back to list page"?
All the best,
Chris

Re: [chris] Interesting problem..

Chris: ok, real example...

Let say I pick the category "International" from http://www.penguinhome.ca/ipac. There are two articles that meet that category. Lets say I choose the first one and press "more..." to see the detail page (http://penguinhome.ca/ipac/case_study_details.php?Dreaming-Big-Implementing-Not-So-Big-Development-Coordination-in-Jordan-s-Ministry-of-Labour-4).

When I select the "back to list page", I end up at http://www.penguinhome.ca/ipac/case_study.php which list all the articles in sort order.

My client would prefer to return to http://www.penguinhome.ca/ipac/case_study.php?categories=International.

I hope that explains it.

Hmmm, now that I think about it, this may actually be your option 3.... sorry, I've been up about 30 hrs and my eyes are getting fuzzy!
--
northernpenguin
Northern Penguin Technologies

"Any sufficiently advanced technology
is indistinguishable from magic."
........Arthur C. Clarke

Re: [northernpenguin] Interesting problem..

By Chris - August 11, 2009

Hi northernpenguin,

All three options I listed will get your visitor back to case_study.php?categories=International from a case_study_detail.php article.

Why not try out the first option to see if you like it, as it's the most straightforward.

In your case_study_detail.php file, replace this line:

<a href="<?php echo $ipac_articlesMetaData['_listPage']; ?>">&lt;&lt; Back to list page</a> -

with this:

<?php foreach (getListLabels('ipac_articles', 'categories', $ipac_articlesRecord['categories']) as $category): ?>
<a href="<?php echo $ipac_articlesMetaData['_listPage']; ?>?categories=<?php echo $category ?>">&lt;&lt; Back to list of <?php echo $category ?> case studies</a><br />
<?php endforeach; ?>


Let us know how it goes! :D
All the best,
Chris

Re: [chris] Interesting problem..

Thanx Chris.

That works great.
[:)]
--
northernpenguin
Northern Penguin Technologies

"Any sufficiently advanced technology
is indistinguishable from magic."
........Arthur C. Clarke