but I think the count need to be inside the for-each, otherwise it always return col1 ...
it's okay with the surrounding div and set a class for first and lastitem.. but I need to separate the elements and content from the two types of boxes.
and then add <xsl:param name="numberOfColumns" /> and <xsl:param name="colcount" /> inside each template? So I want to access the numberOfColumns and colcount values, where the class is added inside the templates.
So the same xslt file is used and on frontpage the administrator can pick some box types with uComponents multinode tree-picker and the same with the sidebar boxes..
Now it makes sence to me :) So in BoxFrontpage you set the numberOfColumns parameter to 3.. and in Box where it isn't set, it will fallback to 1 which is set inside column-calc template?
It's awesome using templates instead of creating two xslt-files for this.. :)
Perhaps you have an answer on this question related to the boxes: A have created a parent node for Sidebar boxes and a parent node for Frontpage boxes.. and then the boxes as children of these nodes. On fronpage and the other page nodes I then pick the box nodes with multi node tree-picker
I was thinking the easiest way may be to create a children of e.g. "Daglig inspiration" for each variants of the box.. so it's possible to pick to children instead.. then children can use same doctype and therefore have the same properties to use..
Different box templates
Hi..
I'm trying to set up a way to pick boxes with uComponents multinode-picker, but where the boxes should be different on frontpage than other pages.
I have this in my xslt, which works fine with the multinode-picker:
Now I want to add classes for the columns, but Box template should have 1 column and BoxFrontpage 3 columns..
How can I include something like this in the for-each, a specify the numbers on column in each template:
/Bjarne
Hi Bjarne,
Where do you need to set the additional col1/col3 class? Is it on the same <div> you're also setting $classname (firstitem/lastitem) ?
/Chriztian
Hi Chriztian
I want to set the additional class like this:
but I think the count need to be inside the for-each, otherwise it always return col1 ...
it's okay with the surrounding div and set a class for first and lastitem.. but I need to separate the elements and content from the two types of boxes.
/Bjarne
Hi Bjarne,
Alright - you're right about position() being 1 everytime inside the templates (the way they're used here).
You can just send position() in as a parameter - like this:
And then add a <xsl:param name="pos" /> inside each of the templates.
BTW: There's a last() function too - so you're className variable can be created a litttle simpler using that:
/Chriztian
Okay, but it's okay that the classes firstitem and lastitem is set on the div container inside the for-each..
More important is that the variables numberOfColumns and colcount is set inside the for-each.. and then the class is set in the templates..
Should it be something like this:
and then add <xsl:param name="numberOfColumns" /> and <xsl:param name="colcount" /> inside each template?
So I want to access the numberOfColumns and colcount values, where the class is added inside the templates.
/Bjarne
You can see the frontpage boxes here: http://gittehoumand.dk.nt2.unoeuro-server.com/da/forside.aspx (Stress, Life ... ) and different sidebar box here: http://gittehoumand.dk.nt2.unoeuro-server.com/da/ydelser.aspx (Dagens ord, Ethvert godt samarbejde, Dagens inspiration)..
So the same xslt file is used and on frontpage the administrator can pick some box types with uComponents multinode tree-picker and the same with the sidebar boxes..
/Bjarne
Hi Bjarne,
I threw this together to show how you send the position() value along to the templates and then further into a separate calculations template:
/Chriztian
Hi Chriztian
Now it makes sence to me :)
So in BoxFrontpage you set the numberOfColumns parameter to 3.. and in Box where it isn't set, it will fallback to 1 which is set inside column-calc template?
It now works as intended..
Thanks for your help :)
/Bjarne
Hi Bjarne,
Yes, that's exactly how it works :-)
/Chriztian
Hi Chriztian
It's awesome using templates instead of creating two xslt-files for this.. :)
Perhaps you have an answer on this question related to the boxes:
A have created a parent node for Sidebar boxes and a parent node for Frontpage boxes.. and then the boxes as children of these nodes. On fronpage and the other page nodes I then pick the box nodes with multi node tree-picker
If I have a box "Daglig Inspiration" on this page: http://gittehoumand.dk.nt2.unoeuro-server.com/da/ydelser.aspx and want the content in this box to be different on another page, how could this be done?
Of course I can just created on new box node similar to the other "Daglig Inspiration" node and add different content.
Or do you have a suggestion on this?
/Bjarne
Hi Bjarne,
I'm not sure I fully understand the question, but here's how I'd handle it:
1. I'd create a Multi-Node Tree Picker property called dagligInspiration on all the Document Types that should be allowed to pick content for it.
2. In the XSLT I'd use my MultiPicker Helper to render the content.
(There is no step three :-)
/Chriztian
Hi Chriztian
I have this content structure.
I was thinking the easiest way may be to create a children of e.g. "Daglig inspiration" for each variants of the box.. so it's possible to pick to children instead..
then children can use same doctype and therefore have the same properties to use..
/Bjarne
is working on a reply...