Page 1 of 1

InsertFragment to map/topicref

Posted: Wed Mar 11, 2020 8:25 pm
by akheiljain
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?

Re: InsertFragment to map/topicref

Posted: Thu Mar 12, 2020 10:05 am
by Radu
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

Re: InsertFragment to map/topicref

Posted: Tue Mar 17, 2020 7:59 pm
by akheiljain
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.

Re: InsertFragment to map/topicref

Posted: Wed Mar 18, 2020 12:06 pm
by Radu
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

Re: InsertFragment to map/topicref

Posted: Thu Mar 19, 2020 12:48 am
by akheiljain
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.

Re: InsertFragment to map/topicref

Posted: Thu Mar 19, 2020 10:04 am
by Radu
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