[oXygen-user] get an ID on a page?

Oxygen XML Editor Support (Sorin Ristache)
Fri Nov 14 04:36:59 CST 2014


Hi Tom,

We plan to add some DITA-OT extension points for the WebHelp plugin in a 
future version of Oxygen. That will allow the customization of the DITA 
WebHelp transformation with custom code added in these points. One of 
these points will allow adding a custom JQuery script.

I think this is all you need for adding your custom code to a WebHelp 
transformation because all your customizations described on the pages

http://idratherbewriting.com/wpdita/toc_publishing/jquery_side_panel/

http://idratherbewriting.com/ditaqrg/#add_mini_toc.html

were added in the WebHelp plugin files. You had one modification in a 
file from the org.dita.xhtml plugin for adding the id attribute but for 
calling the Table of Contents jQuery plugin the id attribute can be 
replaced with a class attribute on the same element. That obviates the 
modification in the org.dita.xhtml plugin.


Best regards,
Sorin

<oXygen/> XML Editor

http://www.oxygenxml.com


Tom Johnson wrote:
> Thanks Sorin. I ended up using a different plugin anyway. It would be 
> great if a future version of the OxygenXML webhelp output incorporated 
> this mini-TOC feature by default. 
> 
> Here are details on how I integrated the plugin: 
> http://idratherbewriting.com/2014/11/13/add-a-mini-toc-to-your-oxygenxml-webhelp-topics/
> 
> By the way, when will I be able to associate specific jQuery scripts 
> with specific transforms? Right now it's inefficient to hack the Oxygen 
> source code's JS file to add the scripts I want. They end up getting 
> applied to every OxygenXML transform. The setup should parallel how 
> you've done it with custom styles, right?
> 
> Tom
> 
> ---------------------
> 801-822-2241
> blog: idratherbewriting.com <http://idratherbewriting.com>
> twitter: tomjohnson
> 
> On Tue, Nov 11, 2014 at 2:34 AM, Oxygen XML Editor Support (Sorin 
> Ristache) < <mailto:>> wrote:
> 
>     Hello,
> 
>     You can use the class attribute when you call the plugin:
> 
>     <script type="text/javascript" charset="utf-8">
>         $(document).ready(function(){
>     $(".toc_plugin").__tableOfContents(); })
>     </script>
> 
>     Did you call the plugin on an empty container element? For example:
> 
>     <div class="toc_plugin"></div>
> 
>     or:
> 
>     <ul class="toc_plugin"></ul>
> 
> 
>     Best regards,
>     Sorin
> 
>     <oXygen/> XML Editor
> 
>     http://www.oxygenxml.com
> 
> 
>     Tom Johnson wrote:
> 
>         Is there any way to get an ID on a page using DITA and
>         transforming with the DITA OT? For example, I want to add
>         something like this:
> 
>         <p id="toc"/>
> 
>         Even if I hack the Oxygen source to allow IDs to pass through,
>         as I described here
>         (http://idratherbewriting.com/__wpdita/toc_publishing/jquery___side_panel/
>         <http://idratherbewriting.com/wpdita/toc_publishing/jquery_side_panel/>),
>         the ID gets prepended with the topic ID. This makes it difficult
>         to trigger the jQuery script, which has a trigger of #toc. Each
>         page's p id will change based on the page's topic ID.
>         I tried using a class with the jquery plugin instead, but it
>         doesn't seem to work. This is the TOC plugin:
>         http://fuelyourcoding.com/__scripts/toc/index.html
>         <http://fuelyourcoding.com/scripts/toc/index.html>.
> 
>         Thanks,
> 
>         Tom


More information about the oXygen-user mailing list