Page 1 of 1
[Solved] Make entire news-block link?
Posted: Tue Jan 06, 2009 8:26 am
by Oskar Rough
Hey all,
I'm showing a short list of the most recent news-entries in my sidebar. I'd like to make sure, that when each entry is clicked, the user is taken to a "news-page" and shown the entry in detail, that was clicked.
I'm missing some tag to link to the entry and a way of targeting my news-page?
I'm using CMSMS 1.5.1. Thank you
Edit: Scroll down for solution with jQuery.
Re: News: link to entry?
Posted: Tue Jan 06, 2009 8:47 am
by RonnyK
When you call the {news}, with the additional parameter detailpage= then you will be pushed to the page holding that alias, when selecting the MORE-link of a news-entry.
Ronny
Re: News: link to entry?
Posted: Tue Jan 06, 2009 10:55 am
by Oskar Rough
RonnyK wrote:
When you call the {news}, with the additional parameter detailpage= then you will be pushed to the page holding that alias, when selecting the MORE-link of a news-entry.
Ah, perfect. Thank you.
The page in question, let's call it articles, will by default list every article. When you from another page click the read more and get directed to this articles page you'll see the article you wanted PLUS the default content.
How could I avoid having "Articles" and "Articles-single" pages? It's rather clumsy =)
Re: News: link to entry?
Posted: Tue Jan 06, 2009 2:59 pm
by Oskar Rough
and I still lack a way of linking to the full article other than using the more-tag. Say I need to make the picture link as well. How would I accomplish this?
Thanks in advance

ß
Re: News: link to entry?
Posted: Wed Jan 07, 2009 3:38 am
by Dr.CSS
Hmm seems like the best/only way to get News detail article into the top of Articles page is to have to content blocks in the template and in the main/{content}/Content block have then in second block under it have your {news} tag call so when you click on summary some where else and it goes to the detail page it will fill the main Content block...
As for the more text being an image you may have to play with the template or use the morelink= parameter with img call in it...
Re: News: link to entry?
Posted: Wed Jan 07, 2009 9:53 am
by Oskar Rough
Hey Mark, thanks a lot for the advice.
Smart workaround with the idea.
The problem with the more-tag is, that I can supply one piece of information, like a text-string or a tag. Say I want both the title of the article, the image and a "Read more" link?
I can't get the detail article to show though. It moves to the detailpage just fine but otherwise comes out blank. If you look here:
http://byg28.byggeplads.com and click the "Read more" in the rightside column you'll see what I mean.
How do I specify how the detailed article is shown this way? Is it the default detail template or? Since I'm not using any (news) tag directly.
Re: News: link to entry?
Posted: Wed Jan 07, 2009 10:45 am
by robinmarek
Hi Oskar - are you trying to do this:
www.starboardmediauk.co.uk/cmsms
The news articles are listed on the left, and when you click the link, the article is displayed on the right? (ignore the crap styling I'm still playing with it)
Re: News: link to entry?
Posted: Wed Jan 07, 2009 11:59 am
by Oskar Rough
robinmarek wrote:
Hi Oskar - are you trying to do this:
www.starboardmediauk.co.uk/cmsms
The news articles are listed on the left, and when you click the link, the article is displayed on the right? (ignore the crap styling I'm still playing with it)
Thanks Robin, but I actually managed to get it working.
I used
detailpage="mypage" but the essential part was removing the
{foreach from=$items item=entry} loop from the template (which I hadn't done).
The only thing lacking is a way to get the detail-link making it possible to make everything in the news a link to the full view.
Re: News: link to entry?
Posted: Wed Jan 07, 2009 7:23 pm
by Dr.CSS
If you look thru the default news summary template you will see things with link in them, and yes at this time no way to wrap it all into a link, title, summary and more link...
Re: News: link to entry?
Posted: Thu Jan 08, 2009 12:51 pm
by Oskar Rough
Found linktitle at least, cheers.
However, I ended up solving it using jQuery making the entire thing a link =)
Re: News: link to entry?
Posted: Thu Jan 08, 2009 5:07 pm
by Dr.CSS
Well it would be nice if you were to write how you solved it with jQuery, and put [solved] in the subject line of first post...
Re: News: link to entry?
Posted: Fri Jan 09, 2009 12:49 pm
by Oskar Rough
Of course, sorry about that.
Say you've wrapped your news in an unordered list (well, doesn't actually matter). This piece of jQuery finds a link (in my case the "read more" link) and makes the entire
ul react to that very link.
Code: Select all
$(document).ready(function(){
$("ul.news").click(function(){
window.location=$(this).find("a").attr("href"); return false;
});
});
There's this plugin named BigTarget that does the same (better even, I suppose). But I just did it this quick way. If you have more links you'll just specify which one you want via the jQuery dom.
Re: [Solved] Make entire news-block link?
Posted: Fri Jan 09, 2009 12:56 pm
by aroundthefur
entry->link - just the detail-link
entry->title - just the plain headline
link}" title="{$entry->title}">
YOUR IMAGES AND SOME OTHER STUFF HERE
maybe is that what u need? o.O
Re: [Solved] Make entire news-block link?
Posted: Fri Jan 09, 2009 5:58 pm
by Dr.CSS
Actually aroundthefur those already make a link so you would end up with a link inside a link, so no go on that one...