Copied to clipboard

Flag this post as spam?

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


  • Bjarne Fyrstenborg 1280 posts 3990 karma points MVP 7x c-trib
    Jun 16, 2011 @ 14:11
    Bjarne Fyrstenborg
    0

    Featured article in newsList

    I'm using the newsList.xslt for my news section. It has the posibility to select a featured article which always is displayed at top.

    But when I haven't selected a top article, it still add the featured_news class to the first list item. This cause when I'm using paging that the latest article is shown at the top on both page 1 and 2.
    You can take a look at this page: http://oldengaard.dk/da/nyheder.aspx

    How could it only use the featured article if I have picked a news item?

    Bjarne

  • dandrayne 1138 posts 2262 karma points
    Jul 05, 2011 @ 23:25
    dandrayne
    0

    Hi Bjarne

    Sorry for the awfully late reply!

    This is intentional, although perhaps now that you mention it is a little unintuitive (and unwanted).   If this still affects you (or anyone else who might stumble onto this) you can change newslist.xslt with the following

    Change (starting line 23)

    <xsl:variable name="featuredArticle">
            <xsl:choose>
                <xsl:when test="string($currentPage/newsFeaturedArticle) != ''">
                    <xsl:value-of select="$currentPage/newsFeaturedArticle" />
                </xsl:when>
                <xsl:otherwise>
                    <!-- should support autofolders if we use // -->
                    <xsl:for-each select="$currentPage//* [@isDoc and string(./umbracoNaviHide) != '1' and name()='NewsItem']">
                        <xsl:sort select="current()/newsDate"  order="descending" />
                        <xsl:if test="position() = 1">
                            <xsl:value-of select="current()/@id" />
                        </xsl:if>
                    </xsl:for-each>
                </xsl:otherwise>
            </xsl:choose>
        </xsl:variable>

    To

    <xsl:variable name="featuredArticle">
            <xsl:choose>
                <xsl:when test="string($currentPage/newsFeaturedArticle) != ''">
                    <xsl:value-of select="$currentPage/newsFeaturedArticle" />
                </xsl:when>
                <xsl:otherwise>
                    <xsl:value-of select="''"/>
                </xsl:otherwise>
            </xsl:choose>
        </xsl:variable>

    and change (line 62)

    <xsl:call-template name="featuredNewsItem">
        <xsl:with-param name="selectedItem" select="$featuredArticle" />
    </xsl:call-template>

    to

     

    <xsl:if test="$featuredNewsItem != ''">
    <xsl:call-template name="featuredNewsItem"> <xsl:with-param name="selectedItem" select="$featuredArticle" /> </xsl:call-template>
    </xsl:if> 

     

  • Bjarne Fyrstenborg 1280 posts 3990 karma points MVP 7x c-trib
    Jul 06, 2011 @ 01:30
    Bjarne Fyrstenborg
    0

    Thanks for your reply ...

    I have tried to change the XSLT above, but I recieve a XSLT error.
    At the moment I have out commented the featured article:

    <!--<xsl:call-templatename="featuredNewsItem">
           
    <xsl:with-paramname="selectedItem"select="$featuredArticle"/>
    </xsl:call-template>-->

    Before I did that it has the featured article on top of all pages in the news list.. and when no newsitem was selected as featured, it still has added the featured class to the top newsitem, which caused that it was on all pages too in the top.

    It isn't necessary in my case to have this feature, but I might need it someday.

  • hetaurhet 245 posts 267 karma points
    Jul 18, 2011 @ 15:48
    hetaurhet
    0

    Hi Bjarne

    did you find any solution .. I am looking for the same....

  • Bjarne Fyrstenborg 1280 posts 3990 karma points MVP 7x c-trib
    Jul 18, 2011 @ 16:08
    Bjarne Fyrstenborg
    0

    Hi..

    No I didn't find the solution I was looking for... but it wasn't a must for me having the featured article in the news list.. so I decided to out comment that part:

    <!--<xsl:call-templatename="featuredNewsItem">
           
    <xsl:with-paramname="selectedItem"select="$featuredArticle"/>
    </xsl:call-template>-->

    Otherwise I had the featured article on all pages in top of page. And when no featured article was selected it still added a class for the top article and considered the top article on each page as a featured article.

    I also changed a bit in the paging, so instead of ?page=0 , ?page=1 etc. ....... I have ?page=1 , ?page=2 etc... 

    Bjarne 

  • Bjarne Fyrstenborg 1280 posts 3990 karma points MVP 7x c-trib
    Jul 18, 2011 @ 16:13
    Bjarne Fyrstenborg
    0

    I have posted the full XSLT for my news list here:

     

    <?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:template match="/">

     <xsl:variable name="datenow" select="umbraco.library:CurrentDate()" /> <xsl:variable name="featuredArticle"> <xsl:choose> <xsl:when test="string($currentPage/newsFeaturedArticle) != ''"> <xsl:value-of select="$currentPage/newsFeaturedArticle" /> </xsl:when> <xsl:otherwise> <!-- should support autofolders if we use // --> <xsl:for-each select="$currentPage//* [@isDoc and string(./umbracoNaviHide) != '1' and name()='Nyhed']"> <xsl:sort select="current()/newsDate" order="descending" /> <xsl:if test="position() = 1"> <xsl:value-of select="current()/@id" /> </xsl:if> </xsl:for-each> </xsl:otherwise> </xsl:choose> </xsl:variable>

     <xsl:variable name="recordsPerPage"> <xsl:choose> <xsl:when test="string($currentPage/newsPerPage) != ''"> <xsl:value-of select="$currentPage/newsPerPage" /> </xsl:when> <xsl:otherwise>10</xsl:otherwise> </xsl:choose> </xsl:variable> <xsl:variable name="pageNumber" > <xsl:choose> <xsl:when test="umbraco.library:RequestQueryString('page') &lt;= 1 or string(umbraco.library:RequestQueryString('page')) = '' or string(umbraco.library:RequestQueryString('page')) = 'NaN'">1</xsl:when> <xsl:otherwise> <xsl:value-of select="umbraco.library:RequestQueryString('page')"/> </xsl:otherwise> </xsl:choose> </xsl:variable>

     <xsl:variable name="numberOfRecords" select="count($currentPage//* [@isDoc and string(./umbracoNaviHide) != '1' and name()='Nyhed'])"/> <ul class="news_list"> <!--<xsl:call-template name="featuredNewsItem"> <xsl:with-param name="selectedItem" select="$featuredArticle" /> </xsl:call-template>--> <xsl:for-each select="$currentPage//* [@isDoc and string(./umbracoNaviHide) != '1' and name()='Nyhed']"> <xsl:sort select="current()/newsDate" order="descending" /> <xsl:if test="position() &gt; $recordsPerPage * number($pageNumber - 1) and position() &lt;= number($recordsPerPage * number($pageNumber - 1) + $recordsPerPage )"> <li> <div class="news_content"> <h3> <a class="font_green" title="{current()/@nodeName}" href="{umbraco.library:NiceUrl(current()/@id)}"> <xsl:value-of select="current()/pageHeading"/> </a> </h3> <p class="news_date"><xsl:value-of select="umbraco.library:FormatDateTime(./newsDate, 'd. MMMM yyyy')"/></p> <p><xsl:value-of select="umbraco.library:ReplaceLineBreaks(./newsSummary)" disable-output-escaping="yes" />&#8230;</p> <p><a title="{current()/@nodeName}" href="{umbraco.library:NiceUrl(current()/@id)}">Læs mere »</a></p> </div> </li> </xsl:if> </xsl:for-each> </ul> <p class="paging"> <!--<xsl:if test="$pageNumber &gt; 1"> <a class="previous" href="?page={$pageNumber -1}">forrige</a> </xsl:if>--> <xsl:call-template name="for.loop"> <xsl:with-param name="i">1</xsl:with-param> <xsl:with-param name="page" select="$pageNumber"></xsl:with-param> <xsl:with-param name="count" select="ceiling($numberOfRecords div $recordsPerPage)"></xsl:with-param> </xsl:call-template> <!--<xsl:if test="(($pageNumber) * $recordsPerPage) &lt; ($numberOfRecords)"> <a class="next" href="?page={$pageNumber + 1}">næste</a> </xsl:if>--> </p> </xsl:template> <xsl:template name="for.loop"> <xsl:param name="i"/> <xsl:param name="count"/> <xsl:param name="page"/> <xsl:if test="$i &lt;= $count"> <xsl:if test="$page != $i"> <a class="pageitem" href="{umbraco.library:NiceUrl($currentPage/@id)}?page={$i}" > <xsl:value-of select="$i" /> </a> </xsl:if> <xsl:if test="$page = $i"> <span class="currentpageitem"> <xsl:value-of select="$i" /> </span> </xsl:if> </xsl:if> <xsl:if test="$i &lt;= $count"> <xsl:call-template name="for.loop"> <xsl:with-param name="i"> <xsl:value-of select="$i + 1"/> </xsl:with-param> <xsl:with-param name="count"> <xsl:value-of select="$count"/> </xsl:with-param> <xsl:with-param name="page"> <xsl:value-of select="$page"/> </xsl:with-param> </xsl:call-template> </xsl:if> </xsl:template> <xsl:template name="featuredNewsItem"> <xsl:param name="selectedItem" /> <xsl:variable name="featuredItem" select="umbraco.library:GetXmlNodeById($selectedItem)" /> <li class="featured_news"> <div class="main_news_item"> <h3> <a class="font_green" title="{$featuredItem/@nodeName}" href="{umbraco.library:NiceUrl($featuredItem/@id)}"> <xsl:value-of select="$featuredItem/pageHeading"/> </a> </h3> <p class="news_date"><xsl:value-of select="umbraco.library:FormatDateTime($featuredItem/newsDate, 'd. MMMM yyyy')"/></p> <p><xsl:value-of select="umbraco.library:ReplaceLineBreaks($featuredItem/newsSummary)" disable-output-escaping="yes" />...</p> <p><a title="{$featuredItem/@nodeName}" href="{umbraco.library:NiceUrl($featuredItem/@id)}">Læs mere »</a></p> </div> </li> </xsl:template> </xsl:stylesheet>

     

  • hetaurhet 245 posts 267 karma points
    Jul 19, 2011 @ 07:22
    hetaurhet
    0

    thank you .. i am using ur xslt... but one more problem ... i am not able to display image of news item...

  • Bjarne Fyrstenborg 1280 posts 3990 karma points MVP 7x c-trib
    Jul 19, 2011 @ 14:37
    Bjarne Fyrstenborg
    0

    I haven't used images in my news list, but you can easily add a property to your news item doc type, where you e.g. use the media picker as datatype.

    Then you can add the image in the newslist xslt:

    <xsl:variable name="mediaId" select="number($currentPage/newsImage)" />
    <xsl:if test="$mediaId &gt; 0">
    <xsl:variable name="mediaNode" select="umbraco.library:GetMedia($mediaId, 0)" />
    <xsl:if test="$currentPage/newsImage != ''">
      <img src="{$mediaNode/umbracoFile}" alt="{$currentPage/@nodeName}" />
    </xsl:if>
    </xsl:if>

    Bjarne

  • hetaurhet 245 posts 267 karma points
    Jul 21, 2011 @ 12:23
    hetaurhet
    0

    it is showing media image node id and not image.....

  • Bjarne Fyrstenborg 1280 posts 3990 karma points MVP 7x c-trib
    Jul 21, 2011 @ 12:32
    Bjarne Fyrstenborg
    0

    The code above I use to show an image selected with a Media Picker.

    The output should only be the img part.. the rest is variables to get the media id and check if an image is selected.

  • hetaurhet 245 posts 267 karma points
    Jul 21, 2011 @ 14:09
    hetaurhet
    0

    yes.... but I got it... but instead of image it is showing id only... why it is not showing image?

  • Bjarne Fyrstenborg 1280 posts 3990 karma points MVP 7x c-trib
    Jul 21, 2011 @ 14:29
    Bjarne Fyrstenborg
    0

    How does your code look?

    and what does you get as output?

  • hetaurhet 245 posts 267 karma points
    Jul 21, 2011 @ 15:36
    hetaurhet
    0

    in my xslt, I have following inside <li></li>

    <xsl:if test="string(current()/newsImage) != ''">
                <div class="news_image">
                 <a title="{current()/@nodeName}" href="{umbraco.library:NiceUrl(current()/@id)}">  
                 
                   <img>
                     
                      <xsl:attribute name="src">
                        <xsl:value-of select="umbraco.library:GetMedia(current()/newsImage, false() )/Image/umbracoFile" />
                      </xsl:attribute>
                    
                      <xsl:attribute name="alt">
                         <xsl:value-of select="current()/@nodeName"/>
                      </xsl:attribute>
                     
                    </img>
                  </a>
                
                  </div>
                </xsl:if>

    and the output is like as follows ....see red box ...I am using umbraco 4.7


  • dandrayne 1138 posts 2262 karma points
    Jul 21, 2011 @ 15:42
    dandrayne
    0

    Hi Hetaurhet

    Are you using 4.7?  If so, your code should be

    <xsl:attribute name="src">
                        <xsl:value-of select="umbraco.library:GetMedia(current()/newsImage, false() )/umbracoFile" />
      </xsl:attribute>
                     

    The /Image/ part was a workaround for a particular version of Umbraco (4.5.0, IIRC)

    Cheers, 

    Dan

     

  • Bjarne Fyrstenborg 1280 posts 3990 karma points MVP 7x c-trib
    Jul 21, 2011 @ 16:19
    Bjarne Fyrstenborg
    0

    Yea, I don't think you should have the /Image/ part ...

    It's rarely I use the Image part after umbracoFile.. I think it can be used for check if a folder contains different file types it should only get images..

    and I think the current() part only can be used inside a loop.
    The code a wrote earlier was just a simple way to display an image somewhere in the template.

    I think you can use this code as well:

    <img src="{umbraco.library:GetMedia(./newsImage, false())/umbracoFile}" />

    Sometime it's easier to split the values into variables..

    Bjarne

  • hetaurhet 245 posts 267 karma points
    Jul 22, 2011 @ 06:21
    hetaurhet
    0

    here is my full xslt for showing news ..... newsImage is media picker type... I have image type files uploaded in media ... but still not showing image

     

    <?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:template match="/">

     <xsl:variable name="datenow" select="umbraco.library:CurrentDate()" />
      <xsl:variable name="featuredArticle">
        <xsl:choose>
          <xsl:when test="string($currentPage/newsFeaturedArticle) != ''">
            <xsl:value-of select="$currentPage/newsFeaturedArticle" />
          </xsl:when>
          <xsl:otherwise>
            <!-- should support autofolders if we use // -->
            <xsl:for-each select="$currentPage//* [@isDoc and string(./umbracoNaviHide) != '1' and name()='DbfNewsItem']">
              <xsl:sort select="current()/newsDate" order="descending" />
              <xsl:if test="position() = 1">
                <xsl:value-of select="current()/@id" />
              </xsl:if>
            </xsl:for-each>
          </xsl:otherwise>
        </xsl:choose>
      </xsl:variable>

     <xsl:variable name="recordsPerPage">
        <xsl:choose>
          <xsl:when test="string($currentPage/newsPerPage) != ''">
            <xsl:value-of select="$currentPage/newsPerPage" />
          </xsl:when>
          <xsl:otherwise>10</xsl:otherwise>
        </xsl:choose>
      </xsl:variable>
      <xsl:variable name="pageNumber" >
        <xsl:choose>
          <xsl:when test="umbraco.library:RequestQueryString('page') &lt;= 1 or string(umbraco.library:RequestQueryString('page')) = '' or string(umbraco.library:RequestQueryString('page')) = 'NaN'">1</xsl:when>
          <xsl:otherwise>
            <xsl:value-of select="umbraco.library:RequestQueryString('page')"/>
          </xsl:otherwise>
        </xsl:choose>
      </xsl:variable>

     <xsl:variable name="numberOfRecords" select="count($currentPage//* [@isDoc and string(./umbracoNaviHide) != '1' and name()='DbfNewsItem'])"/>
      <ul class="news_list">

        <!--<xsl:call-template name="featuredNewsItem">
          <xsl:with-param name="selectedItem" select="$featuredArticle" />
        </xsl:call-template>-->
        
        <xsl:for-each select="$currentPage//* [@isDoc and string(./umbracoNaviHide) != '1' and name()='DbfNewsItem']">
          <xsl:sort select="current()/newsDate"  order="descending" />
          <xsl:if test="position() &gt; $recordsPerPage * number($pageNumber - 1) and position() &lt;= number($recordsPerPage * number($pageNumber - 1) + $recordsPerPage )">
            <li>
              
              <xsl:if test="string(current()/newsImage) != ''">
                <div class="news_image">
                 <a title="{current()/@nodeName}" href="{umbraco.library:NiceUrl(current()/@id)}">  
                  
                   <img>
                     
                      <xsl:attribute name="src">
                        <xsl:value-of select="umbraco.library:GetMedia(current()/newsImage, false() )/umbracoFile" />
                      </xsl:attribute>
                     
                      <xsl:attribute name="alt">
                         <xsl:value-of select="current()/@nodeName"/>
                      </xsl:attribute>
                      
                    </img>
                  </a>
                 
                  </div>
                </xsl:if>
             
              
              
              
              <div class="news_content">
                <h3>
                  <a class="font_green" title="{current()/@nodeName}" href="{umbraco.library:NiceUrl(current()/@id)}">
                    <xsl:value-of select="current()/pageHeading"/>
                  </a>
                </h3>
                <p class="news_date"><xsl:value-of select="umbraco.library:FormatDateTime(./newsDate, 'd. MMMM yyyy')"/></p>
                <p><xsl:value-of select="umbraco.library:ReplaceLineBreaks(./newsSummary)" disable-output-escaping="yes" />&#8230;</p>
                <p><a title="{current()/@nodeName}" href="{umbraco.library:NiceUrl(current()/@id)}">Read More »</a></p>
              </div>
            </li>
          </xsl:if>
        </xsl:for-each>
        
      </ul>
      <p class="paging">
        <xsl:if test="$pageNumber &gt; 1">
          
          <a class="page" href="?page={$pageNumber -1}">Previous</a>  
          
        </xsl:if>

        <xsl:call-template name="for.loop">
          <xsl:with-param name="i">1</xsl:with-param>
          <xsl:with-param name="page" select="$pageNumber"></xsl:with-param>
          <xsl:with-param name="count" select="ceiling($numberOfRecords div $recordsPerPage)"></xsl:with-param>
        </xsl:call-template>
        
        <xsl:if test="(($pageNumber) * $recordsPerPage) &lt; ($numberOfRecords)">
          
          <a class="page" href="?page={$pageNumber + 1}">Next</a>
           
        </xsl:if>
        
      </p>
    </xsl:template>

    <xsl:template name="for.loop">
      <xsl:param name="i"/>
      <xsl:param name="count"/>
      <xsl:param name="page"/>
      
      <xsl:if test="$i &lt;= $count">
        <xsl:if test="$page != $i">
          <a class="page" href="{umbraco.library:NiceUrl($currentPage/@id)}?page={$i}" >
            <xsl:value-of select="$i" />
          </a>
          
        </xsl:if>
        <xsl:if test="$page = $i">
          <span class="currentpageitem">
            <xsl:value-of select="$i" />
          </span>
        </xsl:if>
      </xsl:if>

      <xsl:if test="$i &lt;= $count">
        <xsl:call-template name="for.loop">
          <xsl:with-param name="i">
            <xsl:value-of select="$i + 1"/>
          </xsl:with-param>
          <xsl:with-param name="count">
            <xsl:value-of select="$count"/>
          </xsl:with-param>
          <xsl:with-param name="page">
            <xsl:value-of select="$page"/>
          </xsl:with-param>
        </xsl:call-template>
      </xsl:if>

    </xsl:template>

    <xsl:template name="featuredNewsItem">
      
      <xsl:param name="selectedItem" />
      <xsl:variable name="featuredItem" select="umbraco.library:GetXmlNodeById($selectedItem)" />

      <li class="featured_news">
        <div class="main_news_item">
          <h3>
            <a class="font_green" title="{$featuredItem/@nodeName}" href="{umbraco.library:NiceUrl($featuredItem/@id)}">
              <xsl:value-of select="$featuredItem/pageHeading"/>
            </a>
          </h3>
          <p class="news_date"><xsl:value-of select="umbraco.library:FormatDateTime($featuredItem/newsDate, 'd. MMMM yyyy')"/></p>
          <p><xsl:value-of select="umbraco.library:ReplaceLineBreaks($featuredItem/newsSummary)" disable-output-escaping="yes" />...</p>
          <p><a class="font_green" title="{$featuredItem/@nodeName}" href="{umbraco.library:NiceUrl($featuredItem/@id)}">Read More »</a></p>
        </div>
      </li>

    </xsl:template>

    </xsl:stylesheet>


  • Bjarne Fyrstenborg 1280 posts 3990 karma points MVP 7x c-trib
    Jul 22, 2011 @ 13:26
    Bjarne Fyrstenborg
    0

    What do you got as output? Do you got the img tag in output..  or is it just the img src that is wrong?

    Does it make a difference to replace current()newsImage with ./newsImage ?

  • hetaurhet 245 posts 267 karma points
    Jul 22, 2011 @ 14:51
    hetaurhet
    0

    i am getting following output...

    and current()newsImage with ./newsImageis not making any difference ... but yes ... my xslt is not showing image... there is some problem... so is itr because of that it is not showing rss feed also?

  • Bjarne Fyrstenborg 1280 posts 3990 karma points MVP 7x c-trib
    Jul 22, 2011 @ 15:10
    Bjarne Fyrstenborg
    0

    Okay, what about the normal html code... do you got a XSLT error in frontend or? If you use Firefox and have Firebug installed you can see what you have in the code.. Safari and Chrome have a similar tool.

    If you want to set up a rss feed for the newlist I think you should create a xslt file for the rss, where it has the values from the news items... and a xslt file for the normal newslist.

    Is the newslist working on one of the pages? Then you always can create the rss feed afterwards.

  • hetaurhet 245 posts 267 karma points
    Jul 23, 2011 @ 06:22
    hetaurhet
    0

    newslist is working fine ... but only instead image it shows image id (using media ) ..... so is that a problem?

  • Bjarne Fyrstenborg 1280 posts 3990 karma points MVP 7x c-trib
    Jul 23, 2011 @ 15:48
    Bjarne Fyrstenborg
    0

    From the screenshot you got the id.. but what do you get in the code as output? Doesn't write the img tag .. <img src="..." alt="" />

    Is something written inside the src attribute?

  • hetaurhet 245 posts 267 karma points
    Jul 24, 2011 @ 14:08
    hetaurhet
    0

    i have in my xslt as follows ....

    <img>
                     
                      <xsl:attribute name="src">
                        <xsl:value-of select="umbraco.library:GetMedia(current()/newsImage, false() )/Image/umbracoFile" />
                      </xsl:attribute>
                     
                      <xsl:attribute name="alt">
                         <xsl:value-of select="current()/@nodeName"/>
                      </xsl:attribute>
                      
                    </img>

  • Bjarne Fyrstenborg 1280 posts 3990 karma points MVP 7x c-trib
    Jul 24, 2011 @ 14:20
    Bjarne Fyrstenborg
    0

    Okay, but that is in your xslt.. what do you have in your html code as output?

    You get the media id, but what else? Isn't the img tag written? If the image was inserted correctly you should get something like in the image below:

    Don't you get anything inside the src attribute?

    And I think you should remove the /Image part before umbracoFile..

  • hetaurhet 245 posts 267 karma points
    Jul 24, 2011 @ 15:52
    hetaurhet
    0

    yes I have tried removing /Image part before umbracoFile.. still it is not working ...

    and what I get is ... just a number ... 1507 not even img tag

     

     

  • Bjarne Fyrstenborg 1280 posts 3990 karma points MVP 7x c-trib
    Jul 24, 2011 @ 16:16
    Bjarne Fyrstenborg
    0

    Weird that you don't get the img tag..

    What if you remove the test? or instead of <xsl:if test="string(current()/newsImage) != ''"> use: <xsl:if test="string(./newsImage) != "">

    Or you could take a look at the newslist from Business Website Starter Pack: http://our.umbraco.org/projects/starter-kits/business-website-starter-pack

    It's that newslist I have worked out from and there was an image intergrated if one was picked. You could compare with it and see if something is missing?

  • hetaurhet 245 posts 267 karma points
    Jul 25, 2011 @ 14:36
    hetaurhet
    0

    hey thanks  .... <xsl:if test="string(./newsImage) != "">  .. this worked out....

  • Bjarne Fyrstenborg 1280 posts 3990 karma points MVP 7x c-trib
    Jul 25, 2011 @ 14:41
    Bjarne Fyrstenborg
    0

    Great.. I'm glad you got it working... :)

Please Sign in or register to post replies

Write your reply to:

Draft