Any documentation for using xrefs in variables?

I attended a networking event some time ago, in which one of the speakers mentioned using variables as a workaround for cross-publication linking. Including an xref in a variable and then using the variable in the topic. I tested it out, and it sort of works. The output runs without error, the link looks hot, but it resolves as a 404.

So, I must be missing something in either the output definition or in the way the xref is specified.

Has anyone implemented this? Any tips?

Thanks much!

Barbara

Parents Reply Children
  • This produced the same result. I think what I am missing is something in our output generation to support this type of link. Thanks so much for your help. We are looking at key maps, but I think we need the latest Tridion Docs to support it.

  • I assume your publication is at a different URL than the one you're linking from.  Can you get to the link if you enter it in your browser? 

    You might try inserting the link as a web link in your variable definition file, then setting the varid on the XREF that gets inserted.  In XMetaL, what comes in for an XREF is different depending on if you select a web link a cross reference.  In XMetaL, we do links from the menu:  Insert link->select web link. You can have a variable as the whole XREF, but you can't have it as an attribute (such as the URL).

    Other things to check for are: forbidden characters in the URL attribute (some characters (like #, &, %) must be replaced with their equivalent character entity).  Also, the variable can be the whole XREF, but you can't have it as an attribute (such as the URL).  Also we use format=http.  You could try that instead of format=html.

    Here's an example:

    <xref href="http://www.hpe.com" format="http" scope="external" varid="company.website.home">Hewlett Packard Enterprise</xref> 

    Hopefully one of these things will help.  Slight smile