Developer forum

Forum » Templates » Open first news

Open first news


Reply

Hi,

 

I have a lot of clients that want the first news to be opened as soon as we get into the news page, and have the list also displayed.

 

I can get the list + opened news, but only after cliking on a news. I need it to be automatic, opening the most recent news.

 

Any ideas?

 

Nuno


Replies

 
Reply

If this is News V2, have you tried using the same mark up in the list template as in the detail template?

 
Reply

Hi Lars,

 

Yes, from now on it is news_v2. I have not tried it yet. I was under the influence that we had the same limitations as the v1 module.

 

I'll run some tests. Thanks

 

Nuno

 
Reply

Hi Lars,

 

It's perfect. Thanks a lot.

 

Best Regards,

Nuno

 
Reply

You're welcome. The beauty of the new module is that it uses the same objects when rendering a news in the list and detail view, so you always have the same tags available. Like a product in ecom.

 
Reply

Hi

 

That we are getting the same properties on the objects in both the list as in the item is a great thing. I have been missing that for years :)

 

But I still have a little problem. If Im having some specialized templates for showing a news items, this will not be showed when i copy the markup to the list-template, as the list do not have any knowledge of how to show the item. The layout of a newitem is selected on the news, and i can have different templates for my news items. 

 

So what i was thinking is that it would be nice to have the posibility to set on the paragraph, that the paragraph should show the first item in the list, if one is selected.

 

if(showFirst && NoneSelected){

renderFirstInList();

}

else{

renderList();

}

 

Nice easy and very simple :)

 

 

/Kenneth

 
Reply
Hi there, 
Old post but active for me now. I have the same problem: using specified mark-up in news detail. How will i get this markup visible when using list to show first item?
GR Niek
 
Reply
Yes, would be nice with a tag like <!--@News:ShowNewsDetail--> to output the complete news story in detail, with the template attached in the news module.

Since you can apply different templates to different news, it's not always a great solution, just to copy markup to your list template.

 

You must be logged in to post in the forum