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.

display single article underneath a category

September 15, 2010 6:12am

Subscribe [1]
  • #1 / Sep 15, 2010 6:12am

    R Gruyters

    14 posts

    I’m trying to display a single article underneath a category. If I try to do this then I see all the articles which are mapped to the category.

    URI is as follow: portfolio/<category>/<article>

    for example: portfolio/websites/klant_website

    I have created a “template group” named “portfolio” which includes a single index template. (which can be viewed on http://drp.ly/1JwIfh)

    Is this possible with ExpressionEngine? Or do I need to create a separate template for single article view. (e.g. detail)

  • #2 / Sep 15, 2010 10:26am

    hd 

    156 posts

    You have the right idea. This is the gist of what we usually do. An entire site based on category structure, where the last uri segment can be a url_title of an article. This works really well for large sites, where a client may need to publish a piece of content to various sections of the site simultaneously. Most of the site would be handled by one template (and sub-templates embedded in it based on conditionals).

    I’ve written an add-on that handles all this automatically (category/entry finding based on URI, titles, breadcrumbs, navigation, nested entry lists, etc), but it still needs a bit of polish before it is release-worthy. In the meantime, there are other add-ons right now that make this task possible, like Low Seg2cat.

  • #3 / Sep 15, 2010 10:50am

    R Gruyters

    14 posts

    I can’t see why “Low Seg2Cat” is going to help me.

    The current problem I have is when the single article is viewed, portfolio/category/websites/klant_website, where “klant_website” is the article (url_title) it shows all the articles which are currently listed under the “website” category.

  • #4 / Sep 15, 2010 11:59am

    hd 

    156 posts

    Ah, I was mentioning that so that you could get the current category id from a URI segment (for listing multiple entries). If you just want to get a single entry from a specific URI segment, you can do something like:

    {exp:channel:entries dynamic="no" channel="your_channel" url_title="{segment_3}"}
        {title}
    {/exp:channel:entries}

    Or, even better you can use this plugin: http://devot-ee.com/add-ons/bjorn-last-segment/
    to dynamically use the last segment found.

    To clarify; I wasn’t talking about using the built-in /category/ trigger method, I thought you were trying to avoid using a trigger, which is why I suggested Low Seg2Cat, etc.

  • #5 / Sep 15, 2010 1:13pm

    anonymous188825

    1 posts

    thanks! It’s working!

  • #6 / Sep 15, 2010 1:15pm

    R Gruyters

    14 posts

    Working here as well.

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

ExpressionEngine News!

#eecms, #events, #releases