I'm building a website for my local school and I've setup two doctypes, one called MyClassArea and the other called ClassDetailsArea.
The idea being that each teacher will create a ClassDetailsArea doc which contains their name, photo and the year of the class that they run.
The school have two classes per year so I want to create an XSLT script that will display a box for each year going down the page with the two photos of the teachers on the left and right of the box and their names underneith that can then be linked to the class details page.
I'm pretty sure I can figure out most of this, but I'm kinda stuck working out how to display the two pictures and names from the two nodes next two each other in each year group.
If anyone's got any ideas they would be gratly appreciated.
To be honest I've not looked at Razor yet as I'm only just starting out so I've been scripting with XSLT everywhere.
Not sure if it makes any differance at all, but I'm using version 4.7.
I'll start reading up on Razor, but for the time being I'm not too fussed what the actualy HTML looks like as long as it works ;)
Also, I'm using the 'Umbraco User's Guide' by Nik Wahlberg & Paul Sterling as my bible at the moment, but it only mentions Razor very briefly. If you could suggest a good source of reading material for Razor, I'll give it a look.
I've not used XSLT before, but I've been working with it for a couple of months now and am 'starting' to get the hang of it.
I'll start reading up on Razor (thank you for the links) and will look to move everything over if all looks good.
In the mean time, I'm unfortunately on a bit of a deadline to get the school site ready for next term so I need to get something working as quickly as possible either in XSLT or Razor (if I understand it in time).
Displaying two nodes per line
Hi all,
This is my first time posting so be gentle ;)
I'm building a website for my local school and I've setup two doctypes, one called MyClassArea and the other called ClassDetailsArea.
The idea being that each teacher will create a ClassDetailsArea doc which contains their name, photo and the year of the class that they run.
The school have two classes per year so I want to create an XSLT script that will display a box for each year going down the page with the two photos of the teachers on the left and right of the box and their names underneith that can then be linked to the class details page.
I'm pretty sure I can figure out most of this, but I'm kinda stuck working out how to display the two pictures and names from the two nodes next two each other in each year group.
If anyone's got any ideas they would be gratly appreciated.
Many Thanks
Here's my XML for the class doctypes :-
MyClassArea id="1092" parentID="1089" level="2" writerID="1" creatorID="1" nodeType="1055" template="1077" sortOrder="2" createDate="2011-09-12T13:58:20" updateDate="2011-09-12T13:58:23" nodeName="My Class" urlName="my-class" writerName="kpage" creatorName="kpage" path="-1,1089,1092" isDoc=""
>
<
>
<
>
<
>
<
>
</
>
<
>
</
>
<
>
<
>
<
>
<
>
</
>
<
>
</
>
<
>
<
>
<
>
<
>
</
>
<
>
</
>
<
>
<
>
<
>
<
>
</
>
<
>
</
>
<
>
<
>
<
>
<
>
</
>
<
>
</
>
</
>
How would you like the generated html to look? Would Razor be an option for you? I think is easier to use if you never have look at XSLT before.
To be honest I've not looked at Razor yet as I'm only just starting out so I've been scripting with XSLT everywhere.
Not sure if it makes any differance at all, but I'm using version 4.7.
I'll start reading up on Razor, but for the time being I'm not too fussed what the actualy HTML looks like as long as it works ;)
Also, I'm using the 'Umbraco User's Guide' by Nik Wahlberg & Paul Sterling as my bible at the moment, but it only mentions Razor very briefly. If you could suggest a good source of reading material for Razor, I'll give it a look.
Thanks
Have you worked with XSLT before? If not i would strongly recommend you to look closer at Razor. This looks like a good blogpost:
http://cultiv.nl/blog/2011/2/16/how-to-use-razor-in-umbraco/
The official Umbraco blog at umbraco.com has a great 10 parts serie on the new Razor feture:
http://umbraco.com/follow-us/blog-archive/2011/2/23/umbraco-47-razor-feature-walkthrough-%E2%80%93-part-1.aspx
I've not used XSLT before, but I've been working with it for a couple of months now and am 'starting' to get the hang of it.
I'll start reading up on Razor (thank you for the links) and will look to move everything over if all looks good.
In the mean time, I'm unfortunately on a bit of a deadline to get the school site ready for next term so I need to get something working as quickly as possible either in XSLT or Razor (if I understand it in time).
Thanks again forthe advice
So you want the "ClassDetailsArea" for which the ClassYear = 'Yead 1'?
This is the XSLT to use:
/MyClassArea/ClassDetailsArea [classYear = 'Year 1']
is working on a reply...