Hi,
Has anyone got any experience with creating custom SEO types?
I am writing a knowledgebase addon for our backend that allows our service staff to record common issues with our products.
I want to have the following URL structure:
/knowledgebase - this is the root knowledgebase page (could use a page for this)
/product name - uses the product SKU
/question - the issue
Put together it would look like this:
/knowledgebase/env1h-ss/my-fridge-is-not-turning-on
I have had partial solutions working, but nothing that won't require modification of core SEO code.
The first approach that I took was to create a custom SEO schema for products and questions that adds onto the base SEO schema created by the SEO addon. But the issue appears to be that there can only be one SEO type above the base item in the tree.
E.g.
'a' - is the SEO type used for a CS-CART page
'k' -is a custom type that I created for a knowledgebase product with a parent type of 'a'
'q' - is a custom type that I created for a knowledgebase question with a parent type of 'k'
The issue is if I go the the following URL:
/knowledgebase/env1h-ss/my-fridge-is-not-turning-on
It would look up the parent type for the question 'q' (which is k) and expect that all parents are of type 'k'... therefore to fails to match against the root knowledgebase page (type a) and the SEO lookup fails..
Without a core modification to the SEO code, to look up the parent type for each section of the hierarchy, this solution will not work.
The other solution I have tried is to use the custom type - 's' - that is defined by CS-CART and modify this schema to support a tree structure ('tree' => true) and use the dispatch column of the ?:seo_names table to render the appropriate templates. The other change made to the 's' schema is that the parent type is also 's'... That way custom types can be chained together.
But it requires me to modify the default CS-CART seo schema for 's' type to support the tree structure which might not work with future CS-CART upgrades...
I think the first approach makes sense to me, but I can't quite get it working...
Does anyone else have any experience with meeting the CS-CART requirements around this?
Thanks...
For this to work