[Solved] cgblog return link

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
Elise
Forum Members
Forum Members
Posts: 24
Joined: Sun Jan 03, 2010 10:13 pm

[Solved] cgblog return link

Post by Elise »

Hi all,

On my CGBlog detail page I'm trying to get a link back to my summary page.
When the link is clicked I would very much like the user to get back to the list of summaries, but not showing the top of the page, but showing the topic he/she was reading.
Return to newsindex is not an option because I also have previous/next buttons on my detail page, so the user could come straight from an other detail page.
I tried Return to newsindex, but this doesn't work, maybe because of pretty urls?

I use cmsms 1.6.6, CGBlog 1.3.1, CGExtensions 1.17.6 and CGSimpleSmarty 1.4.3.

Thanks in advance for anyone willing to help.
Last edited by Elise on Sun Jan 10, 2010 7:40 pm, edited 1 time in total.
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am
Location: Arizona

Re: cgblog return link

Post by Dr.CSS »

CGBlog was build from news and the return link seems to have been taken out of it, but even the News return link only took you back to where you came from not to a specific/different page, if you always want them to return to a set page just put a link to it in the detail template...
Elise
Forum Members
Forum Members
Posts: 24
Joined: Sun Jan 03, 2010 10:13 pm

Re: cgblog return link

Post by Elise »

I found an acceptable solution in this Javascript:

Code: Select all

<__script__ language="JavaScript" type="text/javascript">
if   (document.referrer == "news.html")
{ 
document.write('<a href="javascript:history.go(-1)">Return to newsindex</a>');
}
else
{
var str = "Return to newsindex";
document.write(str.link("news.html"));
}
</__script>  

Last edited by Elise on Sun Jan 10, 2010 7:37 pm, edited 1 time in total.
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am
Location: Arizona

Re: [Solved] cgblog return link

Post by Dr.CSS »

Wouldn't that be the same as Return to newsindex ?...
Elise
Forum Members
Forum Members
Posts: 24
Joined: Sun Jan 03, 2010 10:13 pm

Re: [Solved] cgblog return link

Post by Elise »

Dr.CSS wrote: Wouldn't that be the same as Return to newsindex ?...
No, I don't think anyone understands me  ;D

With just linking to news.html you will get to the top of the page.
If the user was at the bottom of the list I would like to have the user return to the bottom, if he was at the top I would like him to return to the top.
Post Reply

Return to “Modules/Add-Ons”