Page 1 of 1
Link page 'x' <> news category 'x'
Posted: Wed Dec 24, 2014 11:56 pm
by sivanov
Hello, here is my problem: I want to open the list of news from category 'x' when I click on a certain page from the website (with alias = 'x'). In other words, the content of the page (with alias 'x') must be the list of summary news from category 'x'. Could you help me?
Re: Link page 'x' <> news category 'x'
Posted: Thu Dec 25, 2014 9:24 pm
by velden
Assuming page alias == category:
(optional) category="category" - Used in the summary view to display only items for the specified categories. Use * after the name to show children. Multiple categories can be used if separated with a comma. Leaving empty, will show all categories.
Assuming page alias != category:
Add content block to the page template:
Code: Select all
{content block="newscat" oneline=1 label="News category" assign="newscat"}
Code: Select all
{if !empty($newscat)}
{news category=$newscat}
{else}
{news}
{/if}
Re: Link page 'x' <> news category 'x'
Posted: Sat Dec 27, 2014 10:10 pm
by sivanov
Thanks a lot for your response! I still need some help.
In this website careersphysics.info there are 3 content pages - About, Consult and Work. Accordingly there are 3 news categories named alike. So there is 1 to 1 correspondence page <-> category.
My question was: Is it possible when I click on one of the pages (in the left sidebar), for example "About", to open the list of all news summaries from the respective category "About" as page content (in the middle bar)?
As if I have the news category browser in the left sidebar formatted as pages.
Re: Link page 'x' <> news category 'x'
Posted: Sun Dec 28, 2014 10:44 am
by velden
Yes, that's exactly what was written above, but note that the page ALIAS should be same as news CATEGORY.
Just paste
{news category=$page_alias}
in the content of the respective pages.
Note that the news module also has a category action. So you don't need to make it this way. You can create a category template in the News module and use that to create your 'menu'. IF your menu only consists of News categories. If you want other pages to show up too, it might be easier to stick to your plan.
Re: Link page 'x' <> news category 'x'
Posted: Sun Dec 28, 2014 8:20 pm
by sivanov
Yes, now it works. Thank you and happy Holidays!
Re: Link page 'x' <> news category 'x'
Posted: Mon Dec 29, 2014 11:18 am
by staartmees
please put [solved] before the title.