Copied to clipboard

Flag this post as spam?

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


  • Mohammad Azeem 31 posts 74 karma points
    Jul 10, 2012 @ 16:05
    Mohammad Azeem
    0

    News List is not Correctly showing on Page

    Hi All!
    I created a XSLT for News, But list is not Showing Correctly nodes.. here i have four folder "shown in figure"



    My XSLT is following....

    <?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" xmlns:Exslt.ExsltCommon="urn:Exslt.ExsltCommon" xmlns:Exslt.ExsltDatesAndTimes="urn:Exslt.ExsltDatesAndTimes" xmlns:Exslt.ExsltMath="urn:Exslt.ExsltMath" xmlns:Exslt.ExsltRegularExpressions="urn:Exslt.ExsltRegularExpressions" xmlns:Exslt.ExsltStrings="urn:Exslt.ExsltStrings" xmlns:Exslt.ExsltSets="urn:Exslt.ExsltSets" xmlns:umbraco.contour="urn:umbraco.contour" xmlns:tagsLib="urn:tagsLib" xmlns:BlogLibrary="urn:BlogLibrary"
      exclude-result-prefixes="msxml umbraco.library Exslt.ExsltCommon Exslt.ExsltDatesAndTimes Exslt.ExsltMath Exslt.ExsltRegularExpressions Exslt.ExsltStrings Exslt.ExsltSets umbraco.contour tagsLib BlogLibrary ">

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

    <xsl:param name="currentPage"/>

    <xsl:template match="/">

    <!-- The fun starts here -->

    <div class="newsList">
    <xsl:for-each select="$currentPage/* [@isDoc and string(umbracoNaviHide) != '1']">
      <xsl:sort select="@updateDate" order="ascending" />
       <h3 class="headline"> <a href="{umbraco.library:NiceUrl(@id)}">
          <xsl:value-of select="@nodeName"/>
        </a>
      </h3>
      <small class="meta">Posted: <xsl:value-of select="umbraco.library:LongDate(@updateDate, true(), ' - ')"/></small><br/>
      <p class="introduction">
        <xsl:value-of select="umbraco.library:ReplaceLineBreaks(introduction)" disable-output-escaping="yes"/>
      </p>
     
    </xsl:for-each>
      </div>

    </xsl:template>

    </xsl:stylesheet>


  • Mohammad Azeem 31 posts 74 karma points
    Jul 10, 2012 @ 16:08
    Mohammad Azeem
    0

    Result Showing is ::

     

    Thanks in Advance... :)

  • Tom Fulton 2030 posts 4998 karma points c-trib
    Jul 11, 2012 @ 04:22
    Tom Fulton
    0

    Hi Azeem,

    If I understand correctly, your XSLT is listing pages from  the "Ali Sher..." node instead of the HospitalNews node?

    The reason is probably because your loop is starting at $currentPage, instead you'll want to use some XPath to find the HospitalNews node.  The best way might be to walk up to the root, then find the doctype with the alias that HospitalNews uses:

    <div class="newsList">
    <xsl:variable name="newsNode" select="$currentPage/ancestor::root/HospitalNews [@isDoc]" /> <!-- Start at currentPage, walk up to the root (Content), then find a child with the doctype alias of HospitalNews -->
    <xsl:for-each select="$currentPage/* [@isDoc and string(umbracoNaviHide) != '1']">
    .... 

    Of course, adjust HospitalNews in the newsNode variable to whatever the alias of the Document Type that the node named "HospitalNews" uses.

    Also, if you want some basic info on XPath axes, check out Chriztian's XPath Axes Visualizer

    Hope this helps,
    Tom 

  • Mohammad Azeem 31 posts 74 karma points
    Jul 11, 2012 @ 09:46
    Mohammad Azeem
    0

    Hi Tom!

    Thanks for your suggestions..

    . it not seems just like that i want but same as before

    I was created a template named "News" and assigned it to HospitalNews.. news are displaying at that template...but i want to display them in my homepage.. and if i change it into hompepage from Content Section.. then new node becomes in Menu.. and other master pages content disappers....

    I know that this is irrelevent to above but hope that you will give me suggestion

     

    Cheers!

    Azeem Ravi

     

  • Tom Fulton 2030 posts 4998 karma points c-trib
    Jul 11, 2012 @ 23:34
    Tom Fulton
    0

    Hi Azeem,

    Hmm, sounds like it might be an issue with how your templates are setup.  Are you saying that the News List doesn't appear on the homepage?  You probably need to add the macro to be displayed there on your template.  

    -Tom

Please Sign in or register to post replies

Write your reply to:

Draft