xsl-value content showing for 1 child of currentpage when clicking on all other children
Hi There
Need a little help, I have xslt to display all children of the currentpage as an image and page title which displays fine. For each child i have a paragraph of text that i'm displaying in a lightbox when each child is clicken on. However, when i click on any child the lightbox appears with the paragraph of content and child name for the first child of the currentpage no matter what child i click on its the same. Here is my xslt :
Is there a reason why it is doing this, as my paragraph of text that displays in the lightbox named "dropdownText" is withing the for each loop and all the children images and nodenames are displaying correctly.
Apologies for the rough lightbox as i've tried for a while to use a more fancier one without the javascript embedded into the xslt but can't seem to have any luck with it so this is what i've resulted to.
Why have you decided to use disable-output-escaping="yes" in your value-of statement?
Wouldn't that be better in the <a href> tag?
Also which lightbox are you using? I've used one recently which which didn't require any javascript to be entered into the xslt. Have a look at this one.http://lokeshdhakar.com/projects/lightbox2/
I placed the disable output escaping because it wasn't rendering with the html tags. I actually already have that lightbox on my site i'm using for a gallery. Will this one work with html content? if so, do i have to have the html content external somewhere? Right now, i've just adjusted to this :
<xsl:template match="/">
<!-- Process all Team Type children of $currentPage -->
Ok, i've got the lightbox i want to use as it displays the content perfect.
My only issue i have now is it is only displaying the very first child content i.e John Smith is the first child and he has 4 paragraphs of text about him.
When i click on any other (person) Child John Smiths details show it doesn't change for anyone else even though my dropdownText is within the for-each loop.
If i don't have any effect or styling and just have the dropdown text display for each they all show the correct information for each person.
OK just so I understand it properly, am I right in thinking that you're linking to the paragraphs in the dropdownText for each employee from their image and title?
I can't really see exactly why it would only bring back the first record every time. Or why it works without any styling...
One thing I might think about doing is putting a new div inside your <li> tag to hold everything which might help with styling. Also is the div id="inline_content" for the lightbox to pick up?
I don't think I've ever linked to a block of text before. What about if you hid the div (with your text in it) off the page with css, with a margin-left: -9999px? then when the link is clicked you could bring it back, rather than hiding it. Just a thought.
Is there anyone that could look at the above link and see if they could help, I really need this to work and can't find anything to help me. It's using colorbox and below is my xslt that is using #inline_content to supposedly show each persons content in the lightbox.
Sorry for the delay in responding. I've been looking at this again and after looking at the link you supplied, I think it's to do with the #inline_content you have set as the link in this line...
All the div's that hold the content for each employee have a div with id="inline_content". That surely is the root of the problem. Because all divs have the same id, all the links just sees the first one, and display that.
I would think about have some dynamic way of naming your div's, and then use that in the link. Does this work?..
xsl-value content showing for 1 child of currentpage when clicking on all other children
Hi There
Need a little help, I have xslt to display all children of the currentpage as an image and page title which displays fine. For each child i have a paragraph of text that i'm displaying in a lightbox when each child is clicken on. However, when i click on any child the lightbox appears with the paragraph of content and child name for the first child of the currentpage no matter what child i click on its the same. Here is my xslt :
Is there a reason why it is doing this, as my paragraph of text that displays in the lightbox named "dropdownText" is withing the for each loop and all the children images and nodenames are displaying correctly.
Apologies for the rough lightbox as i've tried for a while to use a more fancier one without the javascript embedded into the xslt but can't seem to have any luck with it so this is what i've resulted to.
Thanks in advance :)
Molly
Hi Molly,
Why have you decided to use disable-output-escaping="yes" in your value-of statement?
Wouldn't that be better in the <a href> tag?
Also which lightbox are you using? I've used one recently which which didn't require any javascript to be entered into the xslt. Have a look at this one.http://lokeshdhakar.com/projects/lightbox2/
Hi John
I placed the disable output escaping because it wasn't rendering with the html tags. I actually already have that lightbox on my site i'm using for a gallery. Will this one work with html content? if so, do i have to have the html content external somewhere? Right now, i've just adjusted to this :
It isn't displaying as the lightbox because of the content, does this have to be in a frame or other way ?
Thanks
Molly
Ok, i've got the lightbox i want to use as it displays the content perfect.
My only issue i have now is it is only displaying the very first child content i.e John Smith is the first child and he has 4 paragraphs of text about him.
When i click on any other (person) Child John Smiths details show it doesn't change for anyone else even though my dropdownText is within the for-each loop.
If i don't have any effect or styling and just have the dropdown text display for each they all show the correct information for each person.
Here is my code :
Sorry if this is something simple and i just can't see it.
Thanks.
Molly
Hi Molly,
OK just so I understand it properly, am I right in thinking that you're linking to the paragraphs in the dropdownText for each employee from their image and title?
I can't really see exactly why it would only bring back the first record every time. Or why it works without any styling...
One thing I might think about doing is putting a new div inside your <li> tag to hold everything which might help with styling. Also is the div id="inline_content" for the lightbox to pick up?
I don't think I've ever linked to a block of text before. What about if you hid the div (with your text in it) off the page with css, with a margin-left: -9999px? then when the link is clicked you could bring it back, rather than hiding it. Just a thought.
I'll keep thinking.
Hi John
This is the link to where it is :
http://adtemp.co.uk.173-248-172-179.serv14.temphostspace.com/team-test.aspx
It's best to see to know what is going on.
Thanks
Molly
Is there anyone that could look at the above link and see if they could help, I really need this to work and can't find anything to help me. It's using colorbox and below is my xslt that is using #inline_content to supposedly show each persons content in the lightbox.
I would really appreciate if someone could give me a little bit of advice on whether it can even be achievable, as i'm way past a deadline.
Thanks
Hi again Molly,
Sorry for the delay in responding. I've been looking at this again and after looking at the link you supplied, I think it's to do with the #inline_content you have set as the link in this line...
All the div's that hold the content for each employee have a div with id="inline_content". That surely is the root of the problem. Because all divs have the same id, all the links just sees the first one, and display that.
I would think about have some dynamic way of naming your div's, and then use that in the link. Does this work?..
and then change your link line to...
John
is working on a reply...