Copied to clipboard

Flag this post as spam?

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


  • Bas Schouten 135 posts 233 karma points
    Aug 05, 2010 @ 11:17
    Bas Schouten
    0

    List items

    Hy,

    First of all, i like this package very much. In my website i want to display the events in al list only. Does someone has the xslt file whitout the table layout? For me its hard to edit.

    Bas

  • Peter Dijksterhuis 1442 posts 1722 karma points
    Aug 05, 2010 @ 11:42
    Peter Dijksterhuis
    0

    Bas,

    with the package, 3 xslt-files (and macros) get installed.

    1 of them is for simply listing the events in a list.

    The other 2 create a monthly styled calendar (either using a table or a ul-list)

    Does this help?

    Peter

  • Bas Schouten 135 posts 233 karma points
    Aug 05, 2010 @ 11:48
    Bas Schouten
    0

    Hi Peter,

    I have 3 xslt's.
    - PDCalendar.xslt
    - PDCTableCalendar.xslt
    - PDCUlliCalendar.xslt

    Is the PDCalendar.xslt a simple list? Then I need to comine the file's. I want the monthly navigation in a simple list. I Think the current xlst had hardcoded dates.

    Bas

  • Peter Dijksterhuis 1442 posts 1722 karma points
    Aug 05, 2010 @ 12:14
    Peter Dijksterhuis
    0

    Ah, that's true.

    Perhaphs it's easier to adjust the ullicalendar xslt then.

    Peter

  • Bas Schouten 135 posts 233 karma points
    Aug 05, 2010 @ 12:22
    Bas Schouten
    0

    I think it is. For my its very hard to remove the cells and rows. In this topic i was wondering if someone could help me :-)

  • Peter Dijksterhuis 1442 posts 1722 karma points
    Aug 05, 2010 @ 12:40
    Peter Dijksterhuis
    0

    If you take the ulli xslt, that's outputted as ul-li, no table or cells.

    All the markup is done in the stylesheet, which makes the list appear as table. If you remove the stylesheet, it should be displayed as simple ul-li 

    Does this help?

    If not, then I should alter the simplest xslt so it gets a bit more sophsticated ;-)

  • Bas Schouten 135 posts 233 karma points
    Aug 05, 2010 @ 14:18
    Bas Schouten
    0

    Thanks Peter, i managed to make it work.

    My xslt is:

    <?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:exslt="urn:Exslt.ExsltCommon"
     xmlns:date="urn:Exslt.ExsltDatesAndTimes"
     xmlns:umbraco.library="urn:umbraco.library"
     xmlns:pdcalendar ="urn:pdcalendar"
     exclude-result-prefixes="exslt date umbraco.library pdcalendar">
     <xsl:output method="xml" omit-xml-declaration="yes"/>
     <xsl:param name="currentPage"/>
     <xsl:variable name="startdate">
      <xsl:choose>
       <xsl:when test="umbraco.library:RequestQueryString('m') != '' and umbraco.library:RequestQueryString('y') != ''">
        <xsl:value-of select="pdcalendar:GetFirstDOM(umbraco.library:RequestQueryString('y'),umbraco.library:RequestQueryString('m'))" />
       </xsl:when>
       <xsl:otherwise>
        <xsl:value-of select="pdcalendar:GetFirstDOM(date:year(date:date()),date:monthinyear(date:date()))" />
       </xsl:otherwise>
      </xsl:choose>
     </xsl:variable>
     <xsl:variable name="enddate">
      <xsl:choose>
       <xsl:when test="umbraco.library:RequestQueryString('m') != '' and umbraco.library:RequestQueryString('y') != ''">
        <xsl:value-of select="pdcalendar:GetLastDOM(umbraco.library:RequestQueryString('y'),umbraco.library:RequestQueryString('m'))" />
       </xsl:when>
       <xsl:otherwise>
        <xsl:value-of select="pdcalendar:GetLastDOM(date:year(date:date()),date:monthinyear(date:date()))" />
       </xsl:otherwise>
      </xsl:choose>
     </xsl:variable>
     <xsl:variable name="fdw" select="pdcalendar:DayOfWeekName($startdate)" />
     <xsl:variable name="events" select="pdcalendar:GenerateDates($startdate,$enddate,'event')" />
     <!--
     In the registered version, you can use a startnode:
     <xsl:variable name="events" select="pdcalendar:GenerateDates($startdate,$enddate,'event',1050)" />
     -->
     <xsl:variable name="days" select="pdcalendar:Days()//day" />
     <xsl:template match="/">
      <table border="0">
       <tr>
        <td align="left">
         <a>
          <xsl:attribute name="href">
           <xsl:text disable-output-escaping="yes">?m=</xsl:text>
           <xsl:value-of select="date:monthinyear(date:add($startdate,'-P1D'))"/>
           <xsl:text disable-output-escaping="yes">&#38;y=</xsl:text>
           <xsl:value-of select="date:year(date:add($startdate,'-P1D'))"/>
          </xsl:attribute>
          Previous</a>
        </td>
        <td colspan="5" align="center">
         <xsl:value-of select="pdcalendar:MonthName($startdate)"/>&#160;<xsl:value-of select="date:year($startdate)"/>
        </td>
        <td align="right">
         <a>
          <xsl:attribute name="href">
           <xsl:text disable-output-escaping="yes">?m=</xsl:text>
           <xsl:value-of select="date:monthinyear(date:add($enddate,'P1D'))"/>
           <xsl:text disable-output-escaping="yes">&#38;y=</xsl:text>
           <xsl:value-of select="date:year(date:add($enddate,'P1D'))"/>
          </xsl:attribute>
          Next</a>
        </td>
       </tr>
      </table>
      <ul class="pdcalendar">
       <xsl:call-template name="createRow">
        <xsl:with-param name="tailSet">0</xsl:with-param>
        <xsl:with-param name="offSet" select="$days[@weekday = $fdw]/@position"/>
        <xsl:with-param name="firstDayinRow" select="$events/node[1]"/>
       </xsl:call-template>
      </ul>
     </xsl:template>
     <xsl:template name="createRow">
      <xsl:param name="firstDayinRow"/>
      <xsl:param name="offSet"/>
      <xsl:param name="tailSet"/>
      <xsl:param name="DaysToGo" select="count($firstDayinRow/following-sibling::node)"/>
      <xsl:call-template name="createCells">
       <xsl:with-param name="firstCell" select="$firstDayinRow"/>
       <xsl:with-param name="nrLeft" select="7 - $offSet - $tailSet "/>
      </xsl:call-template>
      <xsl:choose>
       <xsl:when test="$DaysToGo &gt;= 14 - $offSet">
        <xsl:call-template name="createRow">
         <xsl:with-param name="tailSet">0</xsl:with-param>
         <xsl:with-param name="offSet">0</xsl:with-param>
         <xsl:with-param name="firstDayinRow" select="$firstDayinRow/following-sibling::node[7 - $offSet]"/>
        </xsl:call-template>
       </xsl:when>
       <xsl:when test="$DaysToGo &gt;= 7">
        <xsl:call-template name="createRow">
         <xsl:with-param name="tailSet" select="14 - $DaysToGo -1"/>
         <xsl:with-param name="offSet">0</xsl:with-param>
         <xsl:with-param name="firstDayinRow" select="$firstDayinRow/following-sibling::node[7]"/>
        </xsl:call-template>
       </xsl:when>
      </xsl:choose>
     </xsl:template>
     <xsl:template name="createCells">
      <xsl:param name="nrLeft"/>
      <xsl:param name="firstCell"/>
      <xsl:choose>
       <xsl:when test="$nrLeft &gt; 0">
        <xsl:call-template name="createOneCell">
         <xsl:with-param name="cell" select="$firstCell"/>
        </xsl:call-template>
        <xsl:call-template name="createCells">
         <xsl:with-param name="firstCell" select="$firstCell/following-sibling::node[1]"/>
         <xsl:with-param name="nrLeft" select="$nrLeft - 1"/>
        </xsl:call-template>
       </xsl:when>
      </xsl:choose>
     </xsl:template>
     <xsl:template name="createOneCell">
      <xsl:param name="cell"/>
      <xsl:for-each select="$cell/event">
       <xsl:if test="umbraco.library:GetXmlNodeById(@id)/@nodeName !='' ">
        <li>
         
         <a href="{umbraco.library:NiceUrl(@id)}">
          <xsl:value-of select="umbraco.library:GetXmlNodeById(@id)/@nodeName"/>
         </a>&nbsp;
         <xsl:variable name="startdatum" select="umbraco.library:GetXmlNodeById(@id)/data[@alias = 'event' ]/pdcalendarevent/pdcstart"/>
         <xsl:value-of select="umbraco.library:FormatDateTime($startdatum, 'dd/MM/yyyy')"/>
         <xsl:variable name="einddatum" select="umbraco.library:GetXmlNodeById(@id)/data[@alias = 'event' ]/pdcalendarevent/pdcend"/>
         <xsl:if test="$einddatum !=''">t/m
          <xsl:value-of select="umbraco.library:FormatDateTime($einddatum, 'dd/MM/yyyy')"/>
         </xsl:if>
        </li>
       </xsl:if>
      </xsl:for-each>
     </xsl:template>
    </xsl:stylesheet>
Please Sign in or register to post replies

Write your reply to:

Draft