1
votes

I have developed an ExpressionEngine website which has a news section. There is a news channel with categories, and the main news listing page is powered by a news/index template. The single entry (article) page is powered by a news/article template. You can see this section in action here: http://www.longbridgebirmingham.co.uk/news/. Everything's working great.

What I now need to do is list news in a very similar fashion within a subsection of the website (at segment 3 level). Here, to be exact: http://www.longbridgebirmingham.co.uk/life/community/news/. So far, I have created a new 'Community' category for the news channel and created a new community-news/index and community-news/article template which pulls in only Community news. I have used the 'Pages' facility to force this test page to use the community-news/index template: http://www.longbridgebirmingham.co.uk/life/community/news-new. Not sure if that's the right thing to do, but it seems to be working.

Now, I've been really struggling to find out a way to hook up the community-news/article template so that articles are presented at a segment 4 level: http://www.longbridgebirmingham.co.uk/life/community/news/article/url-title. Any help or advice would be really appreciated!

Thanks a lot in advance.

1
Is the URL Structure you way you've suggested important in some way? There might be an easier way of doing it if you are prepared to consider an alternative URL Structure - madebyhippo
Thanks. It's only important because I like content related to a subsection to be sit within the subsection's URL. More than happy to consider an alternative URL Structure though! - benspencer

1 Answers

2
votes

OK, so this is how I would recommend doing it.

you currently have your news template group which is fine.

Create categories for your news items, such as 'life' and 'community' and using the great Low Seg2Cat addon, you can then just use something like the following to filter based on the categories:

http://site.com/news/ http://site.com/news/category/ http://site.com/news/category2/sub-cat2a

This will allow you to use an unlimited number of categories and using Seg2Cat, you'll be able to filter based on the {segment_2_category_id} and/or {segment_3_category_id}.

Now, all you need to do is to append the article segment at the end if you want to show an actual article.

For example: site.com/news/category/article/url_title_of_entry/

EE, will automatically pull the article.html template from the template group.

Does this help?