How to target the 'read more' function (news module) in new window

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Locked
knert

How to target the 'read more' function (news module) in new window

Post by knert »

hi,

How can I target the 'read more' function into a new window. So NOT in the same window, but a complete new window. I searched the whole forum but no answer.

I have the news module in an iframe and i want the read more function opens up in a brandnew window.

Please any help would be appreciated. ThnQ
:-[
Knert
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm

Re: How to target the 'read more' function (news module) in new window

Post by calguy1000 »

This needs javascript in the link that's created, you may need custom development for this.  I don't think that there's anything built-in.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
knert

Re: How to target the 'read more' function (news module) in new window

Post by knert »

Hm I think you're right, since on this entire forum there is no answer.

Theoratically it would be easy...in the news template there would be some kind of adjustment to open the read more funtion in a new window. But because it is impossible to target in which is the readmore function is placed, the only solution would be indeed some javascripting.

Anyone who has already managed this?  ???
User avatar
robsta
Forum Members
Forum Members
Posts: 131
Joined: Thu Oct 20, 2005 11:39 pm

Re: How to target the 'read more' function (news module) in new window

Post by robsta »

I'd just dupe the template and remove the

{$entry->morelink}


and replace it with

link}" target="_blank">[ More... ]

Works for me
knert

Re: How to target the 'read more' function (news module) in new window

Post by knert »

You made the theory practical!  ;D

it works !

thnx a lot!! :D :D
User avatar
robsta
Forum Members
Forum Members
Posts: 131
Joined: Thu Oct 20, 2005 11:39 pm

Re: How to target the 'read more' function (news module) in new window

Post by robsta »

Any time that's the power of smarty ; )
knert

Re: How to target the 'read more' function (news module) in new window

Post by knert »

Well...it's me again....

Still got problems. Not with the new window thing, but with the template stuff.

When a customer clicks on the 'read more' function he will be directed to a new window. So far so good.
But this new window has got the same template as the main window where the headline news is.

I tried everything to switch the template too.

Reason: The website I'm making has a small iframe on the frontpage. Here i place the headlines of the news. When a visitor clicks on the 'readmore' button he has to go to a new window and reads the entire news bulletin on a new template.

This I cannot figure out  >:( :-\ :'(
alby

Re: How to target the 'read more' function (news module) in new window

Post by alby »

knert wrote: When a customer clicks on the 'read more' function he will be directed to a new window. So far so good.
But this new window has got the same template as the main window where the headline news is.

I tried everything to switch the template too.
Add a new template specific for window.
Add a new page with this template.
Add a news tag the parameter: detailpage=alias (alias of new page)

Alby
knert

Re: How to target the 'read more' function (news module) in new window

Post by knert »

Hi,

thnx for responding  :D

The first two steps I already did. But the last step:

Add a news tag the parameter: detailpage=alias (alias of new page)

How and where do I have to do that exactly? :-\
RonnyK
Support Guru
Support Guru
Posts: 4962
Joined: Wed Oct 25, 2006 8:29 pm

Re: How to target the 'read more' function (news module) in new window

Post by RonnyK »

In the calling of {news}, you can give a parameter "detailpage=" to have the content when clicked on to be opened in the page given in the parameter instead of the current page. If you create such a page, make sure that on the options-tab, "show in menu" is unchecked, as you don't want it to be visible in the menu, it must be active, as you want to call it.

Code: Select all

          {news number='3' detailpage='news'}
opens in a page called "news".

Ronny
knert

Re: How to target the 'read more' function (news module) in new window

Post by knert »

Thank you! it fully works! ;D

So now I have the newspage within an iframe one page A.
When clicked on the read more button it will go to a brandnew window with a different template.

This is exactly what i wanted with your help. Thank you very much.  :D
Locked

Return to “CMSMS Core”