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.

Show related entries on detail page

August 19, 2014 8:15am

Subscribe [1]
  • #1 / Aug 19, 2014 8:15am

    deswork

    122 posts

    Hi,

    I have a detail page that has a url format like

    <a href="http://www.domain.com/products/detail/cereal-malt-large-mc">http://www.domain.com/products/detail/cereal-malt-large-mc</a>

    Detail page structure is as follows:

    Product detail

    {exp:channel:entries channel="products" disable="member_data|pagination" limit="1"}
       product details here
    {/exp:channel:entries}

    Testimonials
    Some general testimonials

    Related products

    {exp:channel:entries channel="products" category="11" dynamic="no" limit="12"}
        scroller with products from the same category as the current page
    {/exp:channel:entries}

    I’m having trouble with setting the category in the related products channel.

    Is there a way I can get the category for the product so that I can use it in a channel entries

    {exp:channel:entries channel="products" category="{cat_id_of_current_entry}" dynamic="no"}

    I hope this makes sense.

    Thanks

    Wayne.

  • #2 / Aug 19, 2014 10:58am

    deswork

    122 posts

    I’ve figured it out using related_categories_mode and category_group on the related products channel

    {exp:channel:entries channel="products" category_group="3" limit="12" related_categories_mode="yes" custom_fields="yes" member_data="no"}
.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases