0

I have this tag:

{exp:channel:categories show="2" style="linear" channel="foto" show_empty="no"}
     <a href="{path='fotografie/studio'}">{category_name}</a>
{/exp:channel:categories}

This results in the url: domain.com/fotografie/studio/C2 I don't want C2 to show up in the url how do I prevent this?

1 Answer 1

1

This has to do with "Global Channel Preferences" (admin > channel admin > global preferences) having "Use Category URL Titles In Links?" set to no. When you set it to yes, the default behaviour will be to insert your category url indicator (which you control in the same spot), followed by the category url title (as in /category/category_url_title).

At least, that would be the typical default behaviour of the channel categories tag pair. You can certain override that a number of ways, both within the channel categories loop and the channel entries loop.

10
  • I have "Use Category URL Titles In Links?" disabled. But the category_segment still shows up.
    – KSPR
    May 22, 2013 at 11:36
  • It's because you are using the path variable - the default behaviour when used inside the channel categories loop is to add C#. If you were to instead use simply /fotographie/studio then nothing would automatically be added to the URL. You'd just have to craft the linking behaviour to suit your needs. May 22, 2013 at 11:40
  • Is "studio" a dynamic segment, a template, or a category? May 22, 2013 at 11:41
  • studio is a template
    – KSPR
    May 22, 2013 at 11:42
  • So if you're planning to then using categories to filter within that template, you'd need to either set use "Use Category URL Titles In Links?" to yes and continue using the path variable (which would result in your url structure being fotographie/studio/category/whatever_your_category_url_title_is) OR you could eliminate the path variable and instead build it as path='fotographie/studio/{category_url_title}' but you'd wind up needing a bit of dynamic stuff happening in your entries loop to have it filter properly. May 22, 2013 at 11:48

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.