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.
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]">
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
What have you got so far? Are you looking to do this in XSLT, Razor or as a user control?
in XSLT :)
What do you have so far?
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
please dont forget me:(
i've explain the problem in a understandable way?
my english is bad :(
nico
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>
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
is working on a reply...