0

My Url: http://somelink.com/package/view/a-hald-day-trip-to-the-zoo

//my code below... from url above i want to use entry title category id as my category id below, the url above and my code below have below to separate channels but they share categories groups//

    {exp:channel:entries 
        channel="departures" 
        category="{last_segment_category_id}" 
        limit="10" 
        dynamic="no"
    }
       <p>{title}</p> 
   {/exp:channel:entries}

//But this code above Does not work!, i tried using cat2seg but i think this works with category url and not url title//

1 Answer 1

1

{last_segment_category_id} is not a variable provided directly by ExpressionEngine. So to get this value you need to install an add-on - it is not clear from your question what add-ons you are using (or what version of EE...).

To get a value from the variable {last_segment_category_id} you will need to have installed either URL Helper addon (from here) or Low Seg2Cat (from here), both of which define this variable.

It is probably worth checking which of these you are using (or install one). I am not sure what happens to the variable if you install both add-ons...

You also could achieve something like this result using cat2 (here) but with different tag syntax.

HTH.

1
  • 1
    Ok, sice both Seg2cat and URL Helper are used to find category id from url category segments, they didn't work for getting Entry Url tille segment, so i found a solution using Title Cat Add-on although its for EE2 i had to twix to work on EE5
    – Paultz
    Feb 25, 2020 at 20:24

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.