Copied to clipboard

Flag this post as spam?

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


  • niccolo rossi 33 posts 53 karma points
    Sep 05, 2011 @ 17:30
    niccolo rossi
    0

    browse content on the homepage

    Hi all, 

    i cant find the answer to my problem on the forum:( 

    i've a document type: News Article with a properties Visible in home page and a properties with a "release number". 

    in the home page of my site i need to find witch article have the visible flag and have the same release number of the actual home page release number.

    i've release a macro ready to display the content, like image, title and article's description but i really have no idea of how can i read the articles,  filter it and display in the macro.

    Can u please help me? 

    thank you

    nico


  • dillorscroft 198 posts 192 karma points
    Sep 05, 2011 @ 17:38
    dillorscroft
    0

    What have you got so far?  Are you looking to do this in XSLT, Razor or as a user control?

  • niccolo rossi 33 posts 53 karma points
    Sep 05, 2011 @ 17:44
    niccolo rossi
    0

    in XSLT :) 

  • dillorscroft 198 posts 192 karma points
    Sep 05, 2011 @ 17:59
    dillorscroft
    0

    What do you have so far?

  • niccolo rossi 33 posts 53 karma points
    Sep 05, 2011 @ 18:06
    niccolo rossi
    0

    i have just a xlst:

      <xsl:if test="/macro/Visibile = 1">    
      <table cellpadding="0" cellspacing="0" class="boxhp" >
         <tr >
           <td rowspan="4">
             <img src="/media/29-antinfiammatori.jpg"   class="boxhpimmagine" />
           </td>
            <td   width="10px"  rowspan="4">
              
           </td>
           <td class="boxhpcategoriasettore ArticoloCategoria">
               <xsl:value-of select="/macro/Categoria" /> 
               <xsl:value-of select="/macro/Settore" />
           </td>
         </tr>
         <tr>
           <td class="boxhptitolo">
             <xsl:value-of select="/macro/Titolo" />
           </td>
         </tr>
         <tr>
           <td class="boxhpdescrizione">
             <xsl:value-of select="/macro/Descrizione" />
           </td>
         </tr
      </table>

    but it work only if i pass something like the article trought the page with

     <umbraco:Macro Categoria="Categoria" Settore="Settore" Titolo="Titolo" Descrizione="Descrizione" Visibile="1" Colore="Verde" Alias="BoxHp" runat="server"></umbraco:Macro>

     

    it's just this because im new on umbraco :( 

    sorry 

     


  • niccolo rossi 33 posts 53 karma points
    Sep 06, 2011 @ 14:23
    niccolo rossi
    0

    please dont forget me:( 

    i've explain the problem in a understandable way? 

    my english is bad :(

    nico

     

  • dillorscroft 198 posts 192 karma points
    Sep 06, 2011 @ 16:38
    dillorscroft
    0

    This lists all News Article documents belwo the homepage;  (Not tested this code)

    There are a few assumptions;
    1. Document Type is called NewsArticle
    2. Property for visibility on the News Article is called visible and is a boolean.
    3. Property for Release Number on homepage and news article is called releaseNumber.

    Basically the for-each will output each news article below homepage where the visible property is 1 and and releaseNumber is the same as the current/homepage.

    I've not put in the code for the image as thats a seperate concern.  I dont know how you have referenced the image.  Is it in the media section or have you uploaded the image direct to the news article?
     

    <xsl:for-each select="$currentPage//NewsArticle [string(visible) = '1' and string(releaseNumber) =$currentPage/releaseNumber]">

    <table cellpadding="0" cellspacing="0" class="boxhp" >

         <tr >

           <td rowspan="4">

             

           </td>

            <td   width="10px"  rowspan="4">

              

           </td>

           <td class="boxhpcategoriasettore ArticoloCategoria">

               <xsl:value-of select="./Categoria" /> : 

               <xsl:value-of select="./Settore" />

           </td>

         </tr>

         <tr>

           <td class="boxhptitolo">

             <xsl:value-of select="./Titolo" />

           </td>

         </tr>

         <tr>

           <td class="boxhpdescrizione">

             <xsl:value-of select="./Descrizione" />

           </td>

         </tr> 

      </table

    </xsl:for-each>

  • niccolo rossi 33 posts 53 karma points
    Sep 08, 2011 @ 12:46
    niccolo rossi
    0

    Hi, 

    at first reallly thanks, now i've understand better all the thing! and now it work. 

    just the last thing: 

    this work if currentpage is of type "ARTICLE" , but when i'm on another page, like Homepage "$currentPage//NewsArticle" is = "". 

    i have to change the $currentpage in something like $sitedata? 

    thank you 

    nico

     

     

Please Sign in or register to post replies

Write your reply to:

Draft