0

I am using the code below to display a list of items all with the same category, which works. However the URL os not want I would like displayed. The URL shows as http://vintageceramics.co/store/products/category/ceramics/264

I would like to remove the /264

How would I do this? I have Low Seg2Cat installed, but I'm not sure how to use it in this case?

I would be most grateful if anyone can help.

{exp:channel:entries channel="promotional" status="open" category="{last_segment}" limit="4"}
<div class="item {if count == 1}active{/if}"> <!-- Start .item -->
{promo_product_image}
<img src="{image:url}" alt="{image:title}">
{/promo_product_image}
<div class="container">
<div class="carousel-caption">
<h1>{promo_main_title}</h1>
<p>{promo_product_description}</p>
{categories show_group="26|25|28"}
<a class="btn btn-outline-white" href="{path='store/products'}/{category_id}" role="button">View Details</a>
{/categories}
</div>
</div>
</div> <!-- End .item -->
{/exp:channel:entries}

2 Answers 2

1

I have now got this to work by using this code:

 {categories show_group="26|25|28"}
    <a class="btn btn-outline-white" href="{path='store/products'}/{category_id}" role="button">View Details</a>
    {/categories}

I removed the show_group="26|25|28", as this is not needed if the entry as a category selected and also removed the {category_id} in the URL.

The new code is:

 {categories}
    <a class="btn btn-outline-white" href="{path='store/products'}" role="button">View Details</a>
    {/categories}
0

Well, you need to check if 'ceramics' is actually that 264 category, if it is, then you can remove the number at the end and replace {last_segment} in your Entries tag and use seg2cat {last_segment_category_id} tag, something like this:

{exp:channel:entries channel="promotional" status="open" category="{last_segment_category_id}" limit="4"}
2
  • Hi Davor, Many thanks for your reply. The category group is 26 and is called 'ceramics', however the category added to the group is also called 'ceramics' and is 264! Does this explain what is happening? I updated the code but its still the same. The channel "promotional" has the ceramics group added to it under the Categories tab and the category 'ceramics' (246) is selected. Could the issue be the the category group / category? Many thanks for your help. Mar 9, 2014 at 21:17
  • Yeah, you have to have unique category url-title to use that addon.
    – Davor Peic
    Mar 12, 2014 at 10:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.