ExpressionEngine 3.5.10.
I am outputting a specific list of categories (category_group="1"
) from a channel of training courses (channel="training"
). Followed by the list of courses assigned to that category. I have then used the Grid type field to store some details of when particular courses run, their price, etc. For example:
{exp:channel:categories category_group="1" style="linear" channel="training" show_empty="no"}
{exp:channel:entries category="{category_id}"}
<!-- Output name of course -->
{training_booking_options}
<!-- Output options for this course, e.g. price -->
<a href="{path='contact-us'}">contact us</a>
{/training_booking_options}
{/exp:channel:entries}
{/exp:channel:entries}
Wherever I use {path=""}
it is outputting the category URL path in the URL. For example: <a href="{path='contact-us'}">contact us</a>
gives URL's such as:
- http://dev.domain/contact-us/category/asia
- http://dev.domain/contact-us/category/health-and-safety
- http://dev.domain/contact-us/category/information-technology
I want the URL to be what I've put, i.e. http://dev.domain/contact-us regardless of the category it's within at the time the link is output.
Is this possible, or should I just abandon using path=
and hardcode it like <a href="/contact-us">contact us</a>
?
I don't want to use any of the "category name in URL" features for this particular section of the website. But there are other sections where I do want to use it. So I don't want a solution which disables it for the entire site!
{path=}
does anything useful anyway. All it seems to do is prepend the base URL....to a URL string which you still have to define anyway! Doesn't seem very useful as obviously you can output the base URL with PHP anyway.