Search code examples
intershop

How to create link without PGID


How to create a link without a PGID at ISML level?

The following code is great for avoiding the session id in an url but still adds the PGID at the end of the url.

#sessionlessurl(Action(TargetPipeline))#

Solution

  • I believe that you cannot do that with sessionlessurl and I also think that there is no ISML function that can do it. But there is a custom tag that is used for the generation of canonical links and you may also make use of it. The tag is called issetcanonicallink. Here is code example:

    <issetcanonicallink 
        scope="request"
        name="CanonicalLink"
        action="ViewStandardCatalog-Browse" 
        parameters="#ParameterList(Parameter('CatalogID', CategoryBO:CatalogBO:Name), Parameter('CategoryName', CategoryBO:Name))#">
    
    <link rel="canonical" href="<isprint encoding="off" value="#CanonicalLink#">" />
    

    The implementation SetCanonicalLinkTag is located in the core cartridge and the parameters are documented accordingly.