ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

ExpressionEngine single entry at segment 4 level

September 20, 2013 5:31am

Subscribe [2]
  • #1 / Sep 20, 2013 5:31am

    Tassell Design

    1 posts

    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.

  • #2 / Sep 21, 2013 1:35pm

    Rob Allen

    3114 posts

    The trick is to specify the segment where the entry URL title is…

    So for http://www.longbridgebirmingham.co.uk/life/community/news/article/url-title the url_title is at segment 5 so you’d do:

    {exp:channel:entries channel="mychannel" url_title="{segment_5}" dynamic="no"}
  • #3 / Sep 21, 2013 2:23pm

    Boyink!

    5011 posts

    I’m not sure what you need the Pages module in there for?  You’re building a pretty straightforward blog/news type section and the Pages module is for “static” content/pages.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases