We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 31354
    • 24 Posts
    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.
      • 31354
      • 24 Posts
      So after a bit more testing I found one issue relating to item #1 above:

      Quote from: VDISP at Apr 09, 2015, 05:46 AM
      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.

      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?

      Even though a page Resource Type is set to Symlink (modSymLink), it still shows up as `modDocument`.
      Does this sound right?

      If this is true, does anyone have any idea of how to decern if a page is a symlinked page and add in a cononical reference to the symlinked page without having to back through 1,000's of entries and adding a TV?