Copied to clipboard

Flag this post as spam?

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


  • Anil 2 posts 22 karma points
    Feb 20, 2014 @ 08:26
    Anil
    0

    Combined event and new section need help

     

    i have two section  news and event. Both have list of  events and news so i need a macro who combined both list and display on page sort by date.

    Here is my code

     <xsl:template match="/">

           <xsl:for-each select="$currentPage/ancestor-or-self::*/umbNewsArea/umbNewsArticle [@isDoc and string(umbracoNaviHide) != '1']">
         
                  
                 <xsl:if test="position() &lt;= $numberOfItems">
                  <li style="margin:0px; padding-right:10px;  display:list-item;"> 
                  <p style="line-hieght:2.5em;"> <small>
                    <xsl:value-of select="umbraco.library:FormatDateTime(newsdate, 'dd-MM-yyyy')"/>
                  </small>
                  </p>
     
                  <h4>
                  <a href="{umbraco.library:NiceUrl(@id)}">
                    <xsl:value-of select="newsHeading"/>
                  </a>
                  </h4>
                  </li> 
                   
            </xsl:if>
          </xsl:for-each>    
         
           
          
          <xsl:for-each select="$currentPage/ancestor-or-self::*/EventArea/umbEventsArticle [@isDoc and string(umbracoNaviHide) != '1']">
            <xsl:if test="position() &lt;= $numberOfItems">
              <li>
                  <p style="line-hieght:2.5em;"> <small>
                  <xsl:value-of select="date1"/>
                </small><br />
                          </p>
                <h4>
                  <a href="{umbraco.library:NiceUrl(@id)}">
                    <xsl:value-of select="articleHeading"/>
                  </a>
                </h4>
             

              
             </li>
            </xsl:if>
          </xsl:for-each>

  • Fuji Kusaka 2203 posts 4220 karma points
    Feb 20, 2014 @ 08:47
    Fuji Kusaka
    0

    Hi Anil,

    You will find a good otherview of how to combine both here
    http://pimpmyxslt.com/articles/match-templates-intro/

     

     

     

     

     

     

Please Sign in or register to post replies

Write your reply to:

Draft