Page 1 of 1

Relationship Table Headers

Posted: Wed Nov 18, 2015 5:43 pm
by dgallo
When using a relationship table to create links, by default links are organized by topic type and contain heading such as Related tasks, Related references, Related Concepts. I do not want to show the headers and I want all the topics to be grouped together.

Example of Default Behavior:

Related Tasks
How to Create a Topic
How to Edit a Topic

Related Concepts
DITA Topics

Related References
Task Topic Elements
Concept Topic Elements

Example of What I Want to Produce:

How to Create a Topic
How to Edit a Topic
DITA Topics
Task Topic Elements
Concept Topic Elements

Re: Relationship Table Headers

Posted: Thu Nov 19, 2015 1:36 pm
by radu_pisoi
Hi,

One way to change the default grouping mechanism when produce the related links is to specify a title in the header of the relationship table.
This title will be used when grouping the related topics.
A sample relationship table:

Code: Select all


<reltable>
<relheader>
<relcolspec linking="sourceonly">
<title>Related information</title>
</relcolspec>
<relcolspec>
<title>Related information</title>
</relcolspec>
</relheader>

<relrow>
<relcell>
<topicref href="topic.dita"/>
</relcell>
<relcell>
<topicref href="relactedConcept.dita"/>
<topicref href="relatedTopic.dita"/>
<topicref href="relatedTask.dita"/>
</relcell>
</relrow>
</reltable>
However, this configuration will produce the list with related topics organized in one category. Something like this:
Related information
Related concept
Related topic
Related task


To remove the 'Related information' label from the output, you can specify a custom CSS. For DITA 1.8, this is the CSS rule that hides it:

Code: Select all


div[class~="related-links"]>div[class~="linklist"]>strong {
display:none;
}
About how to set a custom CSS, you can fallow the instructions from the next topic:
http://oxygenxml.com/doc/versions/17.1/ ... n-css.html

Re: Relationship Table Headers

Posted: Thu Feb 25, 2016 4:38 pm
by dgallo
To remove the related link label (ie, Related Information) that is automatically generated in the webhelp output, I did what you said and applied the CSS as follows:

div[class ~= "related-links"] > div[class ~= "linklist"] > strong {
display: none;
}


I have two scenarios where I want the related link label to appear as "Related Information", and then I have another scenario where I do not want to display the related link label at all (anchor links).

My reason for this is I currently have a parent topic with chunk=to content, which is putting all of the children topics in the parent topic. I am using the anchor links to drop-down to the chunked children topics.

I would like to create an outputclass for the css I have defined above, so that I can specify when to generate a label for related links and when to not generate a label for related links.

Re: Relationship Table Headers

Posted: Fri Feb 26, 2016 1:36 pm
by bogdan_cercelaru
Hello,

To hide the related links (including links) of a topic, child of a parent topic with chunk="to content" you should use the following CSS rule:

Code: Select all

.topic .related-links {
display: none;
}
Regards,
Bogdan

Re: Relationship Table Headers

Posted: Fri Feb 26, 2016 2:20 pm
by dgallo
No I want to have the related links display, but in one scenario I want to hide the related link label "Related Information" and in the other scenario I want to show the label "Related Information".

Example 1: Related links generated from Relationship Table with "Related Information" label.

Related Information
Topic 1 Link
Topic 2 Link
Topic 3 Link


Example 2: Related links generated from Relationship Table without "Related Information" label.

Topic 1 Link
Topic 2 Link
Topic 3 Link


I need to create two outputclasses for the two different scenarios.

Re: Relationship Table Headers

Posted: Fri Feb 26, 2016 3:37 pm
by bogdan_cercelaru
If you want to control this at topic level, you can specify the outputclass attribute on the topic element and change the CSS rule accordingly. So, if you set the 'outputclass="hideRelLinks"' on the topic element, the CSS rule should be:

Code: Select all


.hideRelLinks div[class ~= "related-links"] > div[class ~= "linklist"] > strong {
display: none;
}
If you want to control this at topic level, you can specify the outputclass attribute on the topic element and then use the following CSS rule:

Code: Select all


.hideRelLinks div[class ~= "related-links"] > div[class ~= "linklist"] > strong {
display: none;
}