I was wondering how I could link back from a news item to the news list with all news listed up. Right now I have this in my code that link back to the newslist:
<a href='<umbraco:Item runat="server" field="parentID" xslt="umbraco.library:NiceUrl({0})" />' title="Tilbage til oversigten">« Tilbage til oversigten</a>
But as more news items are added to the list and more pages will come, I think it would be better to link back to the actually page the news item is under. If the news item is on page 2, it would be nice there was a link back to that page instead of the first page.
Is there a way I can do this, without using javascript:history.back(-1) or something like that, which not is appropriate when you came from the frontpage or perhaps from Google.
Several options.. check the url you're coming from on your news detail page or add a querystring parameter so you know what page you were coming from... Probably not the most elegant solutions, but will work.
Thanks for you reply. Can you perhaps give some more detailed information?
Some may come to the news item from the frontpage (3 latest news) and some may come from Google. So I think it only should be the newslist page it should be looking at. But I don't know how it will work when the user come directly from the frontpage. Perhaps there is a way you can check on which page the news item is placed? Then it will be easy the link to that page link to newslist page + ?page=1 , ?page=2 ... etc.
Link back to newslist page
I was wondering how I could link back from a news item to the news list with all news listed up.
Right now I have this in my code that link back to the newslist:
<a href='<umbraco:Item runat="server" field="parentID" xslt="umbraco.library:NiceUrl({0})" />' title="Tilbage til oversigten">« Tilbage til oversigten</a>
But as more news items are added to the list and more pages will come, I think it would be better to link back to the actually page the news item is under.
If the news item is on page 2, it would be nice there was a link back to that page instead of the first page.
Is there a way I can do this, without using javascript:history.back(-1) or something like that, which not is appropriate when you came from the frontpage or perhaps from Google.
You can see the newslist here: http://oldengaard.dk/da/nyheder.aspx
Bjarne
Several options.. check the url you're coming from on your news detail page or add a querystring parameter so you know what page you were coming from... Probably not the most elegant solutions, but will work.
Cheers,
/Dirk
Hi Dirk
Thanks for you reply.
Can you perhaps give some more detailed information?
Some may come to the news item from the frontpage (3 latest news) and some may come from Google. So I think it only should be the newslist page it should be looking at.
But I don't know how it will work when the user come directly from the frontpage.
Perhaps there is a way you can check on which page the news item is placed? Then it will be easy the link to that page link to newslist page + ?page=1 , ?page=2 ... etc.
Bjarne
is working on a reply...