Forum
Category URL conundrum
I notice the default blog category links are returned as .../blog/archive.php?cat=mycategory
(no surrounding /
's or directory/
in the string.
Whereas general category links returned as ../category.php?cat=collections/mycategory/
(surrounding /
's + directory/
Why is that, and how to I change the category link to just ../category.php?cat=mycategory
?
Blog has a default category set (
blog
) so that assumed and the slug is used instead of the path.If you want to do the same elsewhere, use
catSlug
instead ofcatPath
and then put it back together in your page.Ok thanks got that.
When using
catSlug
I get the link I want but the exiting data is lost on the new URL../category.php?cat=mycategory
and I can't spot why simply changing the string why that should be?Can you clarify "exiting data is lost" ?
When I change
catPath
tocatSlug
the page../category.php?cat=mycategory
returns myperch:noresults
on the templatecategory_single.html
It's OK using
catPath
...why would that template fail and show no results? It's OK using
catPath
Something is different when changing
catPath
tocatSlug
If you're just using
catSlug
then you're missing valuable information. You need to turn it back into a path.So I should use?...
Is that not working?
Yes that works thanks. It's all becoming clear. Also using same to get category content elsewhere on the site.