I'm have a MODX site with 1,000's of pages. The main product pages are segmented by their respective categories/types. The same products are also listed via SymLink under the additional categories that they fall into i.e.: Restaurant, Hospital, Hotel, etc.
I have two problems that I am trying to solve;
1). if the page is a symlink I would like to add a canonical link to the header something like this:
[[*class_key:eq=`modSymlink`:then=`<link rel="canonical" href="[[+site_url]][[~[[*content]]]]" />`]]
But it is not working properly. Am I close?
2). The other issue is that the symlink pages do not properly create the breadcrumb path UNLESS all the symlink pages have been visited BEFORE the actual product pages.
So if the site cache gets cleared, and I were to visit the main product page:
URL:
http://www.mydomain.com/all-products/product-category/product-series/product-name.html
Breadcurmb shows as: `Home » All Products » Product Category » Product Series » Product Name`
Then I visit one of the symlink pages for that product:
URL:
http://www.mydomain.com/applications/architectural-lighting/accent-lighting/product-category/product-name.html
Breadcrumb shows as: `Home » All Products » Product Category » Product Series » Product Name` (
same as above)
HOWEVER, if the cache gets cleared and I visit the symlink page FIRST:
URL:
http://www.mydomain.com/applications/architectural-lighting/accent-lighting/product-category/product-name.html
Breadcrumb shows as expected: `Home » Applications » Architectural Lighting » Accent Lighting » Product Category » Product Name`
Then when I visit the actual product page, it will show as expected also:
URL:
http://www.mydomain.com/all-products/product-category/product-series/product-name.html
Breadcurmb shows as: `Home » All Products » Product Category » Product Series » Product Name`
It is not optimal to visit 1,000's of pages manually just to get the breadcrumbs to display properly. Any ideas would be appreciated.