I'm trying to sort the layout of my site now and one of the problems i have run into is my gallery page. It uses XSLT to draw the pages out in a table format. The problem with this however is when there is no images to call on the xslt crates a table but leaves it open, thus destroying the layout.
I am trying to implement the exists function to prevent this, however I get the error saying that umbraco doesnt understand the it. does anyone know why this happens?
Here is the snippet of code im using, just incase.
Thanks for the reply, unfortunately im upgrading the installation (onto a clean machine) so the liklihood of implementing this soon is low.
And thanks for the table advice, i just struggled to get the layout looking correct with divs so i cheated (at the time it was for my end of year project and was in a rush, will retry at a later date with divs)
As far as I can tell you are trying to list out nodes below the current page that have a ThumbImage saved.
In this case your table approach is actualy creating some problems that are difficult to handle in xslt, so you're better of without it in more than one regard.
Heres a code snippet that would list all nodes with ThumbImages present
[code]
[/code]
The normal rendering of images in most browsers would render these images in rows, of 8 since the width of the containing div is 8 times the width of the image + the margin. If it doesn't work out entirely experiment a bit with the width of the images and the margins. If you want a more advanced rendering of the images you could take a look at the HTML used in my own gallery (see http://photos.claudihauge.dk/gallerier/natur.aspx as an example), where I use a combination of a ul with floated li's containing divs with the thumbnail.
XSLT Exists function
Hi All,
I'm trying to sort the layout of my site now and one of the problems i have run into is my gallery page. It uses XSLT to draw the pages out in a table format. The problem with this however is when there is no images to call on the xslt crates a table but leaves it open, thus destroying the layout.
I am trying to implement the exists function to prevent this, however I get the error saying that umbraco doesnt understand the it. does anyone know why this happens?
Here is the snippet of code im using, just incase.
[code][/code]
Cheers,
Alec
Instead of:
[code]exists(./data [@alias='ThumbImage'])[/code]
Try something like:
[code]count(./data [@alias='ThumbImage']) > 0[/code]
Oh and BTW, avoid using tables unless you are displaying tabular data!
Thanks for the reply, unfortunately im upgrading the installation (onto a clean machine) so the liklihood of implementing this soon is low.
And thanks for the table advice, i just struggled to get the layout looking correct with divs so i cheated (at the time it was for my end of year project and was in a rush, will retry at a later date with divs)
Cheers
Alec
As far as I can tell you are trying to list out nodes below the current page that have a ThumbImage saved.
In this case your table approach is actualy creating some problems that are difficult to handle in xslt, so you're better of without it in more than one regard.
Heres a code snippet that would list all nodes with ThumbImages present
[code]
[/code]
The normal rendering of images in most browsers would render these images in rows, of 8 since the width of the containing div is 8 times the width of the image + the margin. If it doesn't work out entirely experiment a bit with the width of the images and the margins. If you want a more advanced rendering of the images you could take a look at the HTML used in my own gallery (see http://photos.claudihauge.dk/gallerier/natur.aspx as an example), where I use a combination of a ul with floated li's containing divs with the thumbnail.
Regards
Jesper Hauge
Thank you that would be the best soultion to my layout probelm as well as the use of XSLT!
I shall implement it when i redesign that area next.
Cheers,
Alec
is working on a reply...