WebHelp Responsive: Related Links as one category

B-E-N
Posts: 122
Joined: Thu Mar 24, 2016 5:54 pm

WebHelp Responsive: Related Links as one category

Post by B-E-N » Mon Aug 29, 2016 1:01 pm

Hi,

is there a way to avoid having the related links separated by topic type (concept, task, reference)?

I'd rather have one "Related links" section with all related links in it instead of "Related reference", "Related task", "Related concept".

Thank you,

Benjamin

radu_pisoi
Posts: 348
Joined: Thu Aug 21, 2003 11:36 am
Location: Craiova
Contact:

Re: WebHelp Responsive: Related Links as one category

Post by radu_pisoi » Mon Aug 29, 2016 3:04 pm

Hi,

The below response assumes that you are using the reltable element within a DITA map to declare all relationships among topics. In this case, you can control the generated labels by specify your custom labels in the reltable header:

Code: Select all

<reltable>
<relheader>
<relcolspec>
<title>Related links</title>
</relcolspec>
<relcolspec>
<title>Related links</title>
</relcolspec>
</relheader>

<relrow>
<relcell>
<topicref href="topic1.dita"/>
</relcell>
<relcell>
<topicref href="topic2.dita"/>
<topicref href="topic3.dita"/>
</relcell>
</relrow>
</reltable>
Radu Pisoi
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com

B-E-N
Posts: 122
Joined: Thu Mar 24, 2016 5:54 pm

Re: WebHelp Responsive: Related Links as one category

Post by B-E-N » Mon Aug 29, 2016 3:09 pm

Sorry, I should have given more information.

We are using the <related-links> element.

Code: Select all

    <related-links>
<linkpool>
<link href="bla1_c.xml#bla1_c"/>
<link href="bla2_t.xml#bla2_t"/>
<link href="bla3_t.xml#bla3_t"/>
</linkpool>
</related-links>

radu_pisoi
Posts: 348
Joined: Thu Aug 21, 2003 11:36 am
Location: Craiova
Contact:

Re: WebHelp Responsive: Related Links as one category

Post by radu_pisoi » Tue Aug 30, 2016 12:33 pm

You can use the linklist element instead of linkpool because it allows you to set a title/label.

Code: Select all

<related-links>
<linklist>
<title>Related links</title>
<link href="bla1_c.xml#bla1_c"/>
<link href="bla2_t.xml#bla2_t"/>
<link href="bla3_t.xml#bla3_t"/>
</linklist>
</related-links>
Radu Pisoi
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com

B-E-N
Posts: 122
Joined: Thu Mar 24, 2016 5:54 pm

Re: WebHelp Responsive: Related Links as one category

Post by B-E-N » Wed Aug 31, 2016 12:46 pm

Thank your for the suggestion. I tried that solution and it works. However, all our documentation content uses the <linkpool> element, the authors are used to it.

Is there a way to change the output in another way without having to switch from linkpool to linklist? If not, I need to evaluate the effort to change our related links.

radu_pisoi
Posts: 348
Joined: Thu Aug 21, 2003 11:36 am
Location: Craiova
Contact:

Re: WebHelp Responsive: Related Links as one category

Post by radu_pisoi » Wed Aug 31, 2016 4:01 pm

B-E-N wrote:Is there a way to change the output in another way without having to switch from linkpool to linklist? If not, I need to evaluate the effort to change our related links.
I'm afraid that there is no simple solution to change output as you like. Maybe you can try with a custom JavaScript.

But I think you can easily change your topics by using the XML Refactoring tool. You can see a video presentation for this tool: https://www.oxygenxml.com/demo/XML_Refactoring.html

For your use case, I think you should execute two XML Refactoring operations: one to rename all 'linkpool' elements to 'linklist' and another to insert the title element as first child of the 'linklist' element.

To rename the 'linkpool' element to 'linklist':
1. Use the 'Refactoring -> XML Refactoring' action from the contextual menu of the DITA map;
2. Choose the 'Rename element' operation;
3. Complete the labels for Target Elements and New local name;
4. Leave the 'Current DITA map hierarchy' scope selected;
5. Preview and accept the changes.

For the second operation, to insert the title element, you can use the 'Insert XML fragment' operation. Complete the fragment you want to insert: <title>Related links</title> and for XPath you could use: linklist[not(title)] (linklist without title). Select the 'First child' position.
Radu Pisoi
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com

B-E-N
Posts: 122
Joined: Thu Mar 24, 2016 5:54 pm

Re: WebHelp Responsive: Related Links as one category

Post by B-E-N » Thu Dec 15, 2016 6:35 pm

Thanks for posting the procedure. I just got around to try this out, but ended up getting an error. An error I get often when I try to use the XML Refactoring. I used to think that I am not using the tool correctly, but maybe it's something else.

Here is what I did (after the first part of your explanation worked very well):
1. <title>Related links</title>
2. XPath: linklist[not(title)]
3. 'First child' position

This procedure gives me the following errors:

Code: Select all

Description
XQST0059: ro.sync.net.protocol.http.HttpExceptionWithDetails: 404 Not Found for: http://www.oxygenxml.com/ns/xmlRefactoring/resources/commons.xq

Code: Select all

XQST0059: One or more static errors were reported during query analysis
It's not the first time I get an error like this. Until now, only some XML Refactoring methods have worked for me.

alin
Site Admin
Posts: 140
Joined: Thu Dec 24, 2009 11:21 am

Re: WebHelp Responsive: Related Links as one category

Post by alin » Thu Dec 15, 2016 6:49 pm

Hello,

It seems that you have disabled the "XML Refactoring" Document Type. Go to Options -> Preferences / Document Type Association and see if the "XML Refactoring" DT is checked.

Regards,
Alin
Alin Balasa
Software Developer
<oXygen/> XML Editor
http://www.oxygenxml.com

B-E-N
Posts: 122
Joined: Thu Mar 24, 2016 5:54 pm

Re: WebHelp Responsive: Related Links as one category

Post by B-E-N » Thu Dec 15, 2016 6:55 pm

You are right, it wasn't checked. Thanks! It works now. Makes the Refactoring tool much more useful.

(if there wouldn't be this issue: post40814.html#p40814)

Post Reply