XF 2.2 How to alter variable to insert dashes - in spaces when generating category URL

RobinHood

Well-known member
I'm trying to remove the number from category links

/community/#some.category.4

I've managed to alter the anchor link anchors in getCategoryAnchor() in src -> XF -> Entity - Category.php

I'm now trying to edit the href attribute {{ link('categories', $node) }} in the template node_list_category

I tried href="#{{ $node.title|to_lower }}" which works great for single word categories:

href="#category"

but falls over on words with spaces as the space is still returned.

href="#some category"

Is there another filter or another way of doing this that will return dashes where the spaces are?

Or a way to return the link with the link builder without the node number on the end?

Thanks
 
Back
Top Bottom