How to Access Publication Meta Data in Reach using XSL

Hi,

I'm wondering how can i access the metadata of a publication in Reach using XSL (e.g. when working with html_custom).

 

Thanks,

Nikku

Parents
  • Hi Nikku,

    All of the publication/language level metadata fields in Reach are passed as parameters to html.xsl. The name of the parameter is pub.lang.<name of field as seen in Manage Pubs>. So if you have a field named my.meta at the publication language level, you first define the parameter name at the top of html_custom.xsl using <xsl:param name="pub.lang.my.meta"/> and you can then output it in one of the XSL templates using <xsl:value-of select="$pub.lang.my.meta"/>

    Regards,
    Steve

    Steve Layland | Senior Consultant | SDL

  • Hi Steve,

    Thank you for your help.
    I tried to do it but the value of the metadata fields are empty.

    I can see at the head of the generated html that there are meta elements with name starting with "pub.langversion.<meta.field>". I've tried to use "pub.langversion.<meta.field>" and just the metadata field name but I still don't get the value.

    What might be the problem?

    Thanks,
    Nikku
  • Hi Nikku,

    What version of the product are you using?

    Regards,
    Steve

    Steve Layland | Senior Consultant | SDL

  • Hi Steve,

    Here is the version that we are using: SDL Knowledge Center - Content Manager - Build 12.0.2417.0


    Thanks,
    Nikku
  • Hi Nikku,

    It appears that you may have encountered an issue in the version of Reach (Content Delivery) that you are using. Can you please open a support ticket and include the details and the version of Content Delivery that you see in Reach->Manage Application->System Status.

    The good news is that there is a relatively simple alternative solution.

    The publication/language property data is stored in the underlying Content Delivery database in the path /db/LiveContent/publications/languages/<publication id>/<language code>.xml. Within this file, the fields are stored as <configitem name="<field name>" value="<field value>"/>

    You can read this file into your XSL and then extract values from it. For example:

    <xsl:param name="pub.meta.path" select="concat('/db/LiveContent/publications/languages/', $pub.id, '/', $pub.lang, '.xml')"/>

    Then for each value that you need:

    <xsl:param name="my.meta" select="doc($pub.meta.path)//configitem[@name='my.meta']/@value"/>

    Here I'm extracting the value for the field "my.meta".

    Hope this helps,

    Regards,
    Steve

    Steve Layland | Senior Consultant | SDL

Reply
  • Hi Nikku,

    It appears that you may have encountered an issue in the version of Reach (Content Delivery) that you are using. Can you please open a support ticket and include the details and the version of Content Delivery that you see in Reach->Manage Application->System Status.

    The good news is that there is a relatively simple alternative solution.

    The publication/language property data is stored in the underlying Content Delivery database in the path /db/LiveContent/publications/languages/<publication id>/<language code>.xml. Within this file, the fields are stored as <configitem name="<field name>" value="<field value>"/>

    You can read this file into your XSL and then extract values from it. For example:

    <xsl:param name="pub.meta.path" select="concat('/db/LiveContent/publications/languages/', $pub.id, '/', $pub.lang, '.xml')"/>

    Then for each value that you need:

    <xsl:param name="my.meta" select="doc($pub.meta.path)//configitem[@name='my.meta']/@value"/>

    Here I'm extracting the value for the field "my.meta".

    Hope this helps,

    Regards,
    Steve

    Steve Layland | Senior Consultant | SDL

Children