How to create a link without PGID

How to create a link without PGID at ISML level?

The following code is great for excluding the session identifier in the URL, but it adds the PGID at the end of the URL.

#sessionlessurl(Action(TargetPipeline))#
+4
source share
2 answers

I believe that you cannot do this with help sessionlessurl, and I also think that there is no ISML function that can do this. But there is a special tag that is used to generate canonical links, and you can also use it. The tag is called issetcanonicallink. Here is a sample code:

<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 SetCanonicalLinkTagis in the cartridge core, and the parameters are documented accordingly.

+3
source

url sid pgid:

<%
    String targetPipeline = getPipelineDictionary().get("targetPipeline");
    URLPipelineAction action = new URLPipelineAction(targetPipeline);
    action.setAppendPGID(false);



    // Default Link
    String myDefaultLink = TemplateURLComposition.getTemplateExecutionConfig().getURLComposer().createURL(false, null, null, null, action, null);
    getPipelineDictionary().put("myDefaultLink", myDefaultLink);

%>

<isprint value="#myDefaultLink#">

, JSP:) URLParameters , JSP.

0

Source: https://habr.com/ru/post/1657733/


All Articles