[Solved] Make entire news-block link?

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
User avatar
Oskar Rough
Forum Members
Forum Members
Posts: 40
Joined: Tue Aug 26, 2008 9:45 pm
Location: Denmark

[Solved] Make entire news-block link?

Post 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.
Last edited by Oskar Rough on Fri Jan 09, 2009 12:50 pm, edited 1 time in total.
RonnyK
Support Guru
Support Guru
Posts: 4962
Joined: Wed Oct 25, 2006 8:29 pm
Location: Raalte, the Netherlands

Re: News: link to entry?

Post 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
User avatar
Oskar Rough
Forum Members
Forum Members
Posts: 40
Joined: Tue Aug 26, 2008 9:45 pm
Location: Denmark

Re: News: link to entry?

Post 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 =)
User avatar
Oskar Rough
Forum Members
Forum Members
Posts: 40
Joined: Tue Aug 26, 2008 9:45 pm
Location: Denmark

Re: News: link to entry?

Post 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 :-)ß
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am
Location: Arizona

Re: News: link to entry?

Post 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...
User avatar
Oskar Rough
Forum Members
Forum Members
Posts: 40
Joined: Tue Aug 26, 2008 9:45 pm
Location: Denmark

Re: News: link to entry?

Post 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.
robinmarek
Forum Members
Forum Members
Posts: 208
Joined: Thu Nov 13, 2008 4:02 pm

Re: News: link to entry?

Post 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)
User avatar
Oskar Rough
Forum Members
Forum Members
Posts: 40
Joined: Tue Aug 26, 2008 9:45 pm
Location: Denmark

Re: News: link to entry?

Post 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.
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am
Location: Arizona

Re: News: link to entry?

Post 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...
User avatar
Oskar Rough
Forum Members
Forum Members
Posts: 40
Joined: Tue Aug 26, 2008 9:45 pm
Location: Denmark

Re: News: link to entry?

Post by Oskar Rough »

Found linktitle at least, cheers.

However, I ended up solving it using jQuery making the entire thing a link =)
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am
Location: Arizona

Re: News: link to entry?

Post 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...
User avatar
Oskar Rough
Forum Members
Forum Members
Posts: 40
Joined: Tue Aug 26, 2008 9:45 pm
Location: Denmark

Re: News: link to entry?

Post 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.
aroundthefur
Forum Members
Forum Members
Posts: 20
Joined: Mon Nov 19, 2007 4:02 pm

Re: [Solved] Make entire news-block link?

Post 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
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am
Location: Arizona

Re: [Solved] Make entire news-block link?

Post 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...
Post Reply

Return to “Modules/Add-Ons”