Hello all,
I'm using {news summarytemplate="Home" number="1" detailpage="top_story"} to use a different page for the details. I'd also like to have a direct link to it in my menu that shows the whole details instead of the summary first.
Anyone know how this can be done?
Thanks!
Philip
[solved] Link directly to News Detail
[solved] Link directly to News Detail
Last edited by BigFishPhilip on Fri Nov 30, 2007 3:39 am, edited 1 time in total.
-
- Support Guru
- Posts: 8169
- Joined: Tue Oct 19, 2004 6:44 pm
Re: Link directly to News Detail
why not create a summary template, that 'looks like a menu' and you coud use it as your secondary menu (on certain pages even)..... when you click on a link it goes to the appropriate detail item.
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.
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.
Re: Link directly to News Detail
Thanks Calguy, your replies to many posts have been helpful as I'm learning CMSMS.
For this, I'm trying to have a link in my real menu called Top Story, which has the details of the latest news item. On the homepage, I want to have just a summary. If I understand your suggestion right, it won't work for this.
Any other ideas?
Thanks so much!
For this, I'm trying to have a link in my real menu called Top Story, which has the details of the latest news item. On the homepage, I want to have just a summary. If I understand your suggestion right, it won't work for this.
Any other ideas?
Thanks so much!
-
- Support Guru
- Posts: 8169
- Joined: Tue Oct 19, 2004 6:44 pm
Re: Link directly to News Detail
so you want to have a 'link' in your menu that displays the one latest news article and displays it in detail mode.
Well.. because all of the details (as far as I can remember) are available in summary mode just as they are in detail mode, it's posslbe.
1. Create a new page. call it 'Top Story'. in the content for that page put {news number='1' summarytemplate='blahblah'}
2. The tricky part.
all of the stuff from the default news detail template has to be pasted inside of the {foreach} of the news summary template.
because of the number='1' parameter there'll only be one article shown, the latest.
Let me know how this goes....
Well.. because all of the details (as far as I can remember) are available in summary mode just as they are in detail mode, it's posslbe.
1. Create a new page. call it 'Top Story'. in the content for that page put {news number='1' summarytemplate='blahblah'}
2. The tricky part.
all of the stuff from the default news detail template has to be pasted inside of the {foreach} of the news summary template.
because of the number='1' parameter there'll only be one article shown, the latest.
Let me know how this goes....
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.
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.
Re: Link directly to News Detail
Marvelous! I had tried this earlier, but had gotten rid of the whole {foreach} loop, which didn't work. Putting that back in worked like a charm.
Thanks ever so much!
For future generations, this required 5 elements all together...
1. On the home page, call...
2. A Summary Template called "home". In mine, I just wanted the title and the summary. My template looks like...
3. A Detail Template called "top_story", again I trimmed out some of the output for personal preference...
4. The Detailpage="top_story_page" will overwrite the contents of top_story_page when someone comes from the homepage. If they go directly to the page however, we have to output just the details. This is the tricky part Calguy was referring to. On the page, put...
5. Now create the other Summary Template, which actually outputs the details. To build this, I took my detail template and wrapped it in the {foreach} loop from the sample Summary Template. Mine looks like...
Maybe a good feature to add to the module would be another parameter to call a Detail Template and show a news item at detail level? This works for now though.
Thanks again Calguy,
Philip
Thanks ever so much!
For future generations, this required 5 elements all together...
1. On the home page, call...
Code: Select all
{news summarytemplate="home" number="1" detailtemplate="top_story" detailpage="top_story_page"}
Code: Select all
{foreach from=$items item=entry}
<h3>Top Story: {$entry->titlelink}</h3>
<hr />
{if $entry->summary}
{eval var=$entry->summary} {$entry->morelink}
{/if}
{/foreach}
Code: Select all
<h3>{$entry->title}</h3>
<hr />
{eval var=$entry->content}
<br />
<br />
{$entry->printlink}<br />
{$return_url}
Code: Select all
{news summarytemplate="top_story_details" number="1"}
Code: Select all
{foreach from=$items item=entry}
<h3>{$entry->title}</h3>
<hr />
{eval var=$entry->content}
<br />
<br />
{$entry->printlink}<br />
{$return_url}
{/foreach}
Thanks again Calguy,
Philip
Re: [solved] Link directly to News Detail
Thanks BigFishPhilip & calguy1000
I have done the 5 steps above but if I use the links appears the same page (like always) but change the url.
One question, when we created the detailpage, what template it (the new detailpage) need to use? Can we create a new one? In this case, it's a sixth step?
Thanks for all your help
I have done the 5 steps above but if I use the links appears the same page (like always) but change the url.
One question, when we created the detailpage, what template it (the new detailpage) need to use? Can we create a new one? In this case, it's a sixth step?
Thanks for all your help