InsertFragment to map/topicref

akheiljain
Posts: 21
Joined: Wed Nov 28, 2018 8:13 pm

InsertFragment to map/topicref

Post by akheiljain » Wed Mar 11, 2020 8:25 pm

I am trying to add a xml fragment to map/topicref when selected from Element selector. I have tried adding it to the Author Actions, but it doesn't get inserted. Any help is appreciated.
Activation XPath: oxy:allows-child-element("topicref")
Operation: ro.sync.ecss.extensions.commons.operations.InsertFragmentOperation
fragment: <topicmeta>My Topic Meta</topicMeta>

I think the "Insert Topic Reference Dialog" might be overwriting it, how can I insert my fragment?

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

Re: InsertFragment to map/topicref

Post by Radu » Thu Mar 12, 2020 10:05 am

Hi,

What do you mean by "Element selector"?
Could you tell us exactly how you are inserting the topicref? Do you insert it from the DITA Maps Manager view or from the main editing area? What specific action are you using?

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com

akheiljain
Posts: 21
Joined: Wed Nov 28, 2018 8:13 pm

Re: InsertFragment to map/topicref

Post by akheiljain » Tue Mar 17, 2020 7:59 pm

Hi Radu,
Selecting Windows | Show View | Elements opens a windows to select Elements to insert (this is what I had referred to as Element selector). I tried inserting topicref by double clicking it in that window. This adds <topicref></topicref> tags, and right clicking on the page icon that is inserted and selecting insert Topic Reference, opens a dialog Insert Topic Reference, which allows us to select a topic from Tridion Docs.

Thanks again for all your help.

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

Re: InsertFragment to map/topicref

Post by Radu » Wed Mar 18, 2020 12:06 pm

Hi,

And what is your final goal? Double click in the Elements view on the "topicref" element and have the same dialog appear as when you click the toolbar button?

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com

akheiljain
Posts: 21
Joined: Wed Nov 28, 2018 8:13 pm

Re: InsertFragment to map/topicref

Post by akheiljain » Thu Mar 19, 2020 12:48 am

Hi Radu,
I would like to insertFragment when inserting topicrefs, currently we only get <topicref></topicref> when we add the element using element selector, I would like it to add <topicref><topicmeta><hwHeading></hwHeading></topicmeta></topicref>, where hwHeading is a specialized tag.
The insert Fragment doesn't work, please see earlier messages in this thread.

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

Re: InsertFragment to map/topicref

Post by Radu » Thu Mar 19, 2020 10:04 am

Hi,

In the Oxygen Preferences->"Document Type Associations" page you can extend the "DITA Map" framework configuration. In the extension you can create a new Author action which inserts that fragment of XML content, then mount this Author action to the content completion window or in the Elements view. Here's an older post where I explained something similar:

post51575.html#p51575

But this will not influence the toolbar action for inserting a topicref.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com

Post Reply