Inserting bookmeta metadata into a topic

Post here questions and problems related to editing and publishing DITA content.
matt_k
Posts: 47
Joined: Mon Aug 17, 2020 7:16 pm

Inserting bookmeta metadata into a topic

Post by matt_k »

Hi

I would like to use some bookmeta metadata into a topic within the same map, specifically the "copyrlast" value. I would like the copyright year to display dynamically in a topic holding copyright information.

Here is the metadata:

Code: Select all

		<bookrights class="- topic/data bookmap/bookrights ">
			<copyrlast class="- topic/data bookmap/copyrlast ">
				<year class="- topic/ph bookmap/year ">2021</year>
			</copyrlast>
		</bookrights>
I would like the year to appear in this line:

Code: Select all

<p class="- topic/p ">© Company Name [Insert copyrlast here]</p>
Is there way that I can do this, or should I simply add a keydef to my map with the copyright year, which can be keyref'd into the copyright statement.

Thanks

Matt
Radu
Posts: 9481
Joined: Fri Jul 09, 2004 5:18 pm

Re: Inserting bookmeta metadata into a topic

Post by Radu »

Hi Matt,

Maybe indeed you can define a key for the copyright year:

Code: Select all

<keydef keys="copyrightYear">
            <topicmeta>
                <keywords>
                    <keyword>2021</keyword>
                </keywords>
            </topicmeta>
        </keydef>
then refer to that key both in the bookmap:

Code: Select all

<bookrights>
....
            <copyrlast>
                <year><keyword keyref="copyrightYear"/></year>
            </copyrlast>
    ...
        </bookrights>
and as a keyword or ph with keyref in the topic. I did not test the published output but this might work.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
matt_k
Posts: 47
Joined: Mon Aug 17, 2020 7:16 pm

Re: Inserting bookmeta metadata into a topic

Post by matt_k »

Hi Radu
Thanks for confirming. That works perfectly.
Matt
Post Reply