Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • MartinB 411 posts 512 karma points
    May 30, 2012 @ 22:49
    MartinB
    0

    Fixed: Runway Faq Module for Umbraco 4.7.1

    Hi peeps.

    I needed the Runway FAQ Module for a new client and discovered that this package only supports 4.0.x.

    Oh well, i installed it anyway and found that it worked in some parts. I updated the XSLT files to the new schema and changed the master template reference in the templates, and voilá.

    faqQuestions.xslt:

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE xsl:stylesheet [ <!ENTITY nbsp "&#x00A0;"> ]>
    <xsl:stylesheet
    version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:msxml="urn:schemas-microsoft-com:xslt"
    xmlns:umbraco.library="urn:umbraco.library"
    exclude-result-prefixes="msxml umbraco.library">

    <xsl:output method="xml" omit-xml-declaration="yes"/>

    <xsl:param name="currentPage"/>

    <xsl:variable name="animation" select="/macro/animation"/>
    <xsl:variable name="title" select="/macro/title"/>

    <xsl:template match="/">
    <xsl:if test="$title!=''">
    <h3><xsl:value-of select="$title"/></h3>
    <xsl:value-of select="umbraco.library:AddJquery()"/>
    </xsl:if>
    <xsl:if test="$animation=1">
    <script type="text/javascript">
    $(document).ready(function(){
    $(".faqQuestion div").hide();
    $(".faqQuestion").click(function () {
    $(this).find("div.answer").toggle("fast");
    });
    });
    </script>
    </xsl:if>
    <xsl:if test="count($currentPage/child::faqQuestion [@isDoc and string(umbracoNaviHide) != '1']) &gt; 0">
    <xsl:for-each select="$currentPage/child::faqQuestion [@isDoc and string(umbracoNaviHide) != '1']">
    <div class="faqQuestion">
    <p><xsl:value-of select="questionText" disable-output-escaping="yes"/></p>
    <div class="answer"><xsl:value-of select="bodyText" disable-output-escaping="yes"/></div>
    </div>
    </xsl:for-each>
    </xsl:if>
    </xsl:template>

    </xsl:stylesheet>

    faqCategory.xslt:

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE xsl:stylesheet [ <!ENTITY nbsp "&#x00A0;"> ]>
    <xsl:stylesheet
    version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:msxml="urn:schemas-microsoft-com:xslt"
    xmlns:umbraco.library="urn:umbraco.library"
    exclude-result-prefixes="msxml umbraco.library">

    <xsl:variable name="title" select="/macro/title"/>
    <xsl:output method="xml" omit-xml-declaration="yes"/>

    <xsl:param name="currentPage"/>

    <xsl:template match="/">

    <xsl:choose>
    <xsl:when test="count($currentPage/child::faqCategory)&lt;=0">
    <div id="NoComments">
    There are no comments yet... be the first to make one ...
    </div>
    </xsl:when>
    <xsl:otherwise>

    <xsl:if test="$title!=''">
    <h3><xsl:value-of select="$title"/></h3>
    </xsl:if>


    <xsl:for-each select="$currentPage/child::faqCategory [@isDoc and string(umbracoNaviHide) != '1']">
    <a href="{umbraco.library:NiceUrl(@id)}"><xsl:value-of select="@nodeName"/></a> (<xsl:value-of select="count(faqQuestion)"/>)<br/>
    <xsl:value-of select="bodyText" disable-output-escaping="yes"/>
    </xsl:for-each>


    </xsl:otherwise>
    </xsl:choose>


    </xsl:template>

    </xsl:stylesheet>

    Remember to change the template masterfile reference and your contentplaceholders to match your setup:

    <%@ Master Language="C#" MasterPageFile="~/masterpages/yourMaster.master" AutoEventWireup="true" %>
    <asp:content ContentPlaceHolderId="your_placeholder" runat="server">
Please Sign in or register to post replies

Write your reply to:

Draft