[SOLVED] How can I use different styles for different news?
-
- Forum Members
- Posts: 20
- Joined: Tue Nov 11, 2008 11:25 pm
[SOLVED] How can I use different styles for different news?
Hello,
I'm having bit of a conundrum with news. I'd want to have two kinds of news with different styles and lay-outs. How this can be accomplished? I have already made new field definitions. I tought that the different kind of news could be done with those, but I don't know how to customize them...
Thank you
I'm having bit of a conundrum with news. I'd want to have two kinds of news with different styles and lay-outs. How this can be accomplished? I have already made new field definitions. I tought that the different kind of news could be done with those, but I don't know how to customize them...
Thank you
Last edited by Apprentice on Thu May 07, 2009 11:04 am, edited 1 time in total.
Re: How can I use different styles for different news?
two news-templates....
Ronny
Ronny
-
- Forum Members
- Posts: 20
- Joined: Tue Nov 11, 2008 11:25 pm
Re: How can I use different styles for different news?
Ok. Is it summary template, detail template, form template or browse category template that I should create? Or all of them?
Re: How can I use different styles for different news?
Depends on what you want.... Normally the default showing is the summary-template, when clicked on the 'More'-link, you go to the detail-template. So you could make another summary-template and call that template using
{news summarytemplate="your-new-template"}
Ronny
{news summarytemplate="your-new-template"}
Ronny
-
- Forum Members
- Posts: 20
- Joined: Tue Nov 11, 2008 11:25 pm
Re: How can I use different styles for different news?
So,
this is the code that I have now on the page:
{news category="akatemia" summarytemplate="akatemiasummary2"}
I have two news categories General and akatemia. I made also akatemiasummary2 in Summary Templates. The problem is that the lay-out remains the same, although I have changed it in akatemiasummary2.
Makes me wonder.
Effects take place only if I switch akatemiasummary2 as default template in Summary Templates, but that is not what I want to do because it also effects news in General category.
this is the code that I have now on the page:
{news category="akatemia" summarytemplate="akatemiasummary2"}
I have two news categories General and akatemia. I made also akatemiasummary2 in Summary Templates. The problem is that the lay-out remains the same, although I have changed it in akatemiasummary2.
Makes me wonder.
Effects take place only if I switch akatemiasummary2 as default template in Summary Templates, but that is not what I want to do because it also effects news in General category.
-
- Forum Members
- Posts: 20
- Joined: Tue Nov 11, 2008 11:25 pm
Re: How can I use different styles for different news?
My current CMSMS version is 1.5.1
I would apprecieate some further advice very much.
Thank you
- A
I would apprecieate some further advice very much.
Thank you
- A
Re: How can I use different styles for different news?
Create a new detail template (name it "sample-new" for example), and change all html elements and ids in it. After that, add to {news}
It must look like this:
in the page where the news (based on the new template) should appear.detailtemplate="sample-new"
It must look like this:
Read carefully in your admin-area (extensions --> modules --> news) all about the news module.{news detailtemplate="sample-new"}
Last edited by neophron on Fri Feb 13, 2009 9:02 pm, edited 1 time in total.
-
- Forum Members
- Posts: 20
- Joined: Tue Nov 11, 2008 11:25 pm
Re: How can I use different styles for different news?
Yeah,
thank you. This is how it would normally work, but when you should have two news styles simultaneously, it doesn't unfortunately. New templates just won't take effect if they aren't set as default in news templates section (in this case detail templates section) and only one can be set as default.
As far as I understand there is conflict between news module help and reality (next text concerns useage of detail templates):
"This template must exist and be visible in the form templates tab of the News admin, though it does not need to be the default. If this parameter is not specified, then the current template marked as default will be used."
So its a problem that I can't solve still...
- A
thank you. This is how it would normally work, but when you should have two news styles simultaneously, it doesn't unfortunately. New templates just won't take effect if they aren't set as default in news templates section (in this case detail templates section) and only one can be set as default.
As far as I understand there is conflict between news module help and reality (next text concerns useage of detail templates):
"This template must exist and be visible in the form templates tab of the News admin, though it does not need to be the default. If this parameter is not specified, then the current template marked as default will be used."
So its a problem that I can't solve still...

- A
Re: How can I use different styles for different news?
Ahh ok, I didn't realize that you want to display on the same page two different styled news. I can't see an option where to choose in the news a template (if there is more than one).
I'm not a php freek, may be someone could write a user defined tag?
I'm not a php freek, may be someone could write a user defined tag?
Re: How can I use different styles for different news?
I also have the same problem. Is there no way to do this?
Re: How can I use different styles for different news?
I'm not sure I understand exactly what you're trying to accomplish. If it's having two differently styled news feeds on the page then it's fairly straight-forward. To use Apprentice’s example above I would:
This would result in two news feeds on the page (say the Home page, for example), that use different templates (for instance, I edit the summary template for a Blog to include the time posted, but use only the date posted for News). Since they are in different , you can style them however you like.
As for the Detail page, you can add in a specific encompassing to the individual detailtemplates, and style them accordingly. Just make sure to write your css very specifically - for example:
With some tweaking this should do the trick. As for the actual News page itself (let's say you navigate to it directly, not through a Home Page link), just use the same structure - two separate divs, with unique names, and unique css. It will show listing for the two types of news, and receive a referring link (from Home, say).
Code: Select all
<div id="news_general">{news number="2" category="General" summarytemplate="general_summary" detailtemplate="general_detail" detailpage="news"}</div>
<div id="news_akatemia">{news number="2" category="akatemia" summarytemplate="akatemia_summary" detailtemplate="akatemia_detail" detailpage="news"}</div>
As for the Detail page, you can add in a specific encompassing to the individual detailtemplates, and style them accordingly. Just make sure to write your css very specifically - for example:
Code: Select all
#news_akatemia #NewsPostDetailTitle
Re: How can I use different styles for different news?
Thanks, this worked.
-
- Forum Members
- Posts: 20
- Joined: Tue Nov 11, 2008 11:25 pm
Re: How can I use different styles for different news?
Hey,
this really works. I had already lost hope...
Thank you very much!
-A
this really works. I had already lost hope...
Thank you very much!
-A