Inserting bookmeta metadata into a topic

matt_k
Posts: 10
Joined: Mon Aug 17, 2020 7:16 pm

Inserting bookmeta metadata into a topic

Post by matt_k » Tue Sep 28, 2021 4:49 pm

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: 7620
Joined: Fri Jul 09, 2004 5:18 pm

Re: Inserting bookmeta metadata into a topic

Post by Radu » Wed Sep 29, 2021 7:17 am

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: 10
Joined: Mon Aug 17, 2020 7:16 pm

Re: Inserting bookmeta metadata into a topic

Post by matt_k » Wed Sep 29, 2021 2:06 pm

Hi Radu
Thanks for confirming. That works perfectly.
Matt

Post Reply