Maven 1.x FAQ Plugin

Adding a "top" link after each answer

Details

  • Type: New Feature New Feature
  • Status: Closed Closed
  • Priority: Trivial Trivial
  • Resolution: Fixed
  • Affects Version/s: None
  • Fix Version/s: 1.5
  • Component/s: None
  • Labels:
    None
  • Number of attachments :
    1

Description

That would be great to have this feature, as it's found on lots of FAQs.

This just needs some trivial modifications of the faq.jsl file :

  • add an anchor after each question, like :

<x:forEach select="faq">
<li>
<j:set var="_id"><x:expr select="@id"/></j:set>
<j:set var="anchor"><doc:escapeNameToken value="${_id}"/>_question</j:set>
<j:set var="_id">#<doc:escapeNameToken value="${_id}"/></j:set>
<a name="$"/>
<a href="${_id}">
<x:copyOf select="question/node()"/>
</a>
</li>
</x:forEach>

  • add the "TOP" link after each answer (a div with a class) :

<jsl:template match="answer">
<dd>
<jsl:applyTemplates trim="true" />
<div class="topLink">
<j:set var="_id"><x:expr select="../@id"/></j:set>
<j:set var="link">#<doc:escapeNameToken value="${_id}"/>_question</j:set>
<a href="${link}">TOP</a>
</div>
</dd>
</jsl:template>

Activity

Hide
Lukas Theussl added a comment -

I thought linking to the top of the FAQ page would be more useful than only to the
question that has just been answered. I attach a patch for faq.jsl to achieve this.

Show
Lukas Theussl added a comment - I thought linking to the top of the FAQ page would be more useful than only to the question that has just been answered. I attach a patch for faq.jsl to achieve this.
Hide
Arnaud Heritier added a comment -

Patch applied. thanks

Show
Arnaud Heritier added a comment - Patch applied. thanks

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: