each campaign in this folder have 3 fields (alias names: campaignHeader, campaignText, campaignImage)
on a normal page which is on the same level as "Kampagner", I use the ultimate picker to display all campaigns.The alias name is "campaignss" THe editor can then choose via checkboxes what campaigns should be shown on the page. Or this is the way I want it to function
can anyone help me out? I have tried a lot, and I can make the ID show, sometimes the content.. but I am getting blind on the code
<!-- now each current() of the loop is an id, and you can use the following to get the full current node --> <xsl:value-of select="umbraco.library:GetXmlNodeById(.)" />
</xsl:for-each>
It's stored as a comma separated list so you need to use split to get the individual ids. From there you can get the rest of the data for the node relating to that id. The code above is untested, but hopefully its a step in the right direction
Dan has shown you how to get the node associated with the id stored in the 'campaigns' property, now it's up to you to display the fields for each specific campaign as an exercise...
for anyone interested, I have finnished the code with the help from you guys.
What this code does is look at a page. If the page has any campaigns selected which are all created elsewhere in the treestructure, the campaigns are rendered. However if the current page is the home page, one kind of layout is used, if it on the other hand is a text page, another way of rendering the campaign is chosen.
using xslt to display campaigns
I have the following tree
each campaign in this folder have 3 fields (alias names: campaignHeader, campaignText, campaignImage)
on a normal page which is on the same level as "Kampagner", I use the ultimate picker to display all campaigns.The alias name is "campaignss" THe editor can then choose via checkboxes what campaigns should be shown on the page. Or this is the way I want it to function
can anyone help me out? I have tried a lot, and I can make the ID show, sometimes the content.. but I am getting blind on the code
I use something like
If you're using the ultimate pick in the alias of "campaigns", the way to get it out as a list of ids is as follows
It's stored as a comma separated list so you need to use split to get the individual ids. From there you can get the rest of the data for the node relating to that id. The code above is untested, but hopefully its a step in the right direction
Dan
yeah it works. I get all the fields, and I only get the ones I have chosen on a specific page, so that is perfect, however I want it like this
<xsl:for-each>
<h2>alias='campaignHeader'</h2>
<p>alias='campaignHeader'</p>
</xsl:for-each>
Jonasrt,
Dan has shown you how to get the node associated with the id stored in the 'campaigns' property, now it's up to you to display the fields for each specific campaign as an exercise...
Oh, what the heck, here it is...
Hope this helps.
Regards,
/Dirk
thank you
It's quite difficult this xPath. XSLT is to some degree easy. I was using . instead of $currentNode, but for some reason, this did not render anything
for anyone interested, I have finnished the code with the help from you guys.
What this code does is look at a page. If the page has any campaigns selected which are all created elsewhere in the treestructure, the campaigns are rendered. However if the current page is the home page, one kind of layout is used, if it on the other hand is a text page, another way of rendering the campaign is chosen.
is working on a reply...