Technical support This forum is closed.
Version 1.x > Technical support > multiple news pages View modes: 
User avatar
Member
Member
forrester - 1/30/2006 11:40:15 PM
   
multiple news pages
I am working on a site that has 10 departments. Each department will have three separate news sections on their page. Right now, am I looking at 3 separate news templates for each section (equaling 30 templates) or is there an easier way of displaying the news sections? Maybe I am looking at this in the wrong way.

Thank you for your time,
forrester

User avatar
Guest
admin - 1/31/2006 8:17:27 AM
   
Re: multiple news pages
Hello,

could you please write me what is the difference between all those 30 templates?

Thank you.

Best Regards,

User avatar
Member
Member
forrester - 1/31/2006 3:48:50 PM
   
Re: multiple news pages
Thank you for your response. Here is a basic site map:

default page
|
|
Department page
|
|
SubDept 1
|
SubDept 2
|
SubDept 3



I am going to have the top 10 news articles from the Dept. pages show up on the default page using the QueryRepeater. From this point, I am not sure the best way to do it. I want the top 3 articles from each SubDept to show up on its Dept. page separately. The SubDept pages will have the same layout but the 'news' on those pages will go to different places.

Even though the SubDept pages have the same layout the QueryRepeater Property will be different, I was wondering if I need to create separate templates...because according to the tutorial, I will have to define custom queries, which means a new QueryRepeater for each page (which is going to be about 30 pages)...or is there a way to make one template and change out the properties of the QueryRepeater in the cmsdesk when the template is used.

I am very appreciative of your help.

forrester

User avatar
Guest
admin - 2/1/2006 9:17:17 AM
   
Re: multiple news pages
Hello,

Thank you for the details. Well, I think the most flexible way for you would be creating a user control (ascx) that will display top 3 news of the specified SubDept.

Kentico CMS allows you to define user controls and insert them into the text of your page. The user control is then dynamically loaded and displayed at run-time.

The user control can have one parameter - this can be the name of the SubDept from which it should display the latest news.

The user control will contain the QueryRepeater control that will use cms.news.selectlatest query and you will set the QueryRepeater.WhereCondition property value like this:

QueryRepeaterNews.WhereCondition = " NamePath LIKE N'" + Functions.GetAliasPath() + "/" + this.Parameter + "/%'";

You can find more details on creating in-line user controls in Kentico CMS Developer's Guide (1.8) -> Step 14 - Creating Controls for Insertion into the Text (page 57).

Please let me know if you need any help with that.

Best Regards,

User avatar
Member
Member
forrester - 2/1/2006 3:18:48 PM
   
Re: multiple news pages
Petr,

Thanks for the suggestion. I will give it a try.

Regards,
forrester