News module -> {$entry->morelink} naar main content

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Locked
Edwin_IandD
Forum Members
Forum Members
Posts: 80
Joined: Thu Aug 12, 2010 2:27 pm

News module -> {$entry->morelink} naar main content

Post by Edwin_IandD »

Hello,

I have a problem with the News module. When you click on the {$entry->morelink} link on the summary page you are linked to the top of the page. Is it possible to link directly to the {content} with an anchor in the URL.

It should be possible, but I can't find where to change this in the code..

The main problem is that I am working on a website with a large image in the heading with a top menu above it and after clicking the 'more' link you end up looking at the menu and the header image. This will confuse visitors to the site immensely and they probably start clicking on the link in the menu again which brings them back to the summary...

Thanks,
Ed
User avatar
DIGI3
Dev Team Member
Dev Team Member
Posts: 1629
Joined: Wed Feb 25, 2009 4:25 am
Location: Victoria, BC

Re: News module -> {$entry->morelink} naar main content

Post by DIGI3 »

You could build your own link with {$entry->moreurl}#anchor, and add the anchor ID to your detail template. I usually like to add some javascript to this to smooth scroll to the anchor.
Not getting the answer you need? CMSMS support options
Edwin_IandD
Forum Members
Forum Members
Posts: 80
Joined: Thu Aug 12, 2010 2:27 pm

Re: News module -> {$entry->morelink} naar main content

Post by Edwin_IandD »

Thank you DIGI3, that works a treat! ;D

Took me a second to realise that I needed to change the {$entry->morelink} to {$entry->moreurl} and build the actual link around it, but that was down to my own laziness in reading your reply properly.. ::)

I always use CSS for my smooth scroll, never actually tried javascript (why complicate matters..). Does it actually work better or nicer with javascript? I should try some time!

Thanks again,
Edwin
User avatar
DIGI3
Dev Team Member
Dev Team Member
Posts: 1629
Joined: Wed Feb 25, 2009 4:25 am
Location: Victoria, BC

Re: News module -> {$entry->morelink} naar main content

Post by DIGI3 »

I'm sure it's fine with a css animation too, I've just had it in my js bag of tricks from before the css method worked in all browsers.
Not getting the answer you need? CMSMS support options
Locked

Return to “Modules/Add-Ons”