Expand my Community achievements bar.

Native PDF Publishing: How to get the variable value of a custom metadata added in Native Publishing PDF templates .plt files?

Avatar

Level 2

As explained here https://experienceleague.adobe.com/docs/experience-manager-guides-learn/tutorials/configuring/config... it is mentioned we can also add metadata information as variables or fields in your page layout. This metadata is stored in your source DITA map content, and it can be easily inserted in your page layout.

 

Please provide a code syntax on how to get the values of these custom metadata variables in the templates .plt files?

4 Replies

Avatar

Level 6

To add metadata information as variables or fields in your page layout: you can use the metadata elements that are added inside the bookmeta of your DITA map content.

 

Example: If I want to insert the metadata product name from the below DITA map.

AswiniLakshminarayanan_5-1663960872183.png

 

I would create a custom metadata field for product name using xpath expression.

Xpath expression for fetching product name is //prodinfo[1]/prodname

 

AswiniLakshminarayanan_0-1664173162471.png

 

 

And insert the custom metadata field in the page layout like below

 

AswiniLakshminarayanan_1-1664173218400.png

 

 

Output:

AswiniLakshminarayanan_2-1664173449195.png

 

 

Avatar

Level 2

@AswiniLakshminarayanan 

Thank you for the explanation. A few questions around this

 

1. We are not using bookmap where we can define bookmeta tags.  Can we using keydef tags keyword and map attribute 'product' value as well in the plain map (not bookmap)? If yes what is the expression to access them?

 

<map product="Sample Product">

<keydef  keys="Product_Name">
<topicmeta >
  <keywords>

    <keyword>Product Keyword 1234</keyword>
  </keywords>
</topicmeta>
</keydef>

</map>

 

2. Is it possible to inject jcr:content or /jcr:content/metadata node properties of the ditamap asset into native PDF publishing?

 

 

Avatar

Level 6

1. Yes, metadata rendering works on the elements inside topicmeta for plainmaps. 
//keywords[1]/keyword

2. Possibility of injecting JCR Assets metadata is something we are working on, and will be available by year end. 

Avatar

Level 2

@AswiniLakshminarayanan 

topicmeta metadata works when topicmeta tags are directly child nodes put under map. Something like this.

 

<map product="Sample Product">


<topicmeta >
  <keywords>

    <keyword>Product Keyword 1234</keyword>
  </keywords>
</topicmeta>

</map>

 

It is not working if it is under a keydef node. So is it possible to get the value out of this topicmeta OR we have to change the placement of the topicmeta?

 

<map product="Sample Product">

<keydef  keys="Product_Name">
<topicmeta >
  <keywords>

    <keyword>Product Keyword 1234</keyword>
  </keywords>
</topicmeta>
</keydef>

</map>