Having problems trying to create a popup Options
Jasko
Posted: Wednesday, May 14, 2008 1:44:29 PM
Rank: Devotee

Joined: 12/11/2006
Posts: 47
Hi

I am currently trying to make a popup window, with a larger image than the original image.

I am using a javascript for this, which is located in an external javascript file.

I have created a node called "popup" and I my images to just popup in this node, so I do not need to create a popup node, for every node, which must have a popup window.

I am having some troubles figuring out how I can tell my XSLT, which image it should popup. And I hope some of you can helt me :)

My thoughst are that I need to count the nodes and based on that count I should be able to tell the XSLT what which nodes content it should open in the new window. But I have not had any luck figuring it out yet.

Currently my code looks like this:

<xsl:template match="/">

<xsl:variable name="rootNode" select="umbraco.library:GetXmlNodeById(1102)"/>
<xsl:variable name="countNodes" select="$rootNode/node"/>

<img src="{umbraco.library:GetXmlNodeById(1102)/node[@id = 1103]/data [@alias = 'propertyHousePlandrawingBig']}" alt="" />

</xsl:template>

As you can see I have hardcoded the id, which @id should match, to 1103. I want this number to reflect the ID of the node that is chosen, but I can't figure out how.

Please let me know if there is something that is unclear.

Cheers!

/Jan
drobar
Posted: Wednesday, May 14, 2008 2:39:18 PM

Rank: Umbracoholic

Joined: 9/8/2006
Posts: 1,410
Location: KY, USA
Take at look at the photo gallery macro in Warren's Create Web Site package. His code should show you how to get the file you're looking for.

cheers,
doug.

MVP 2007-2009 - Official Umbraco Trainer for North America - Percipient Studios
Jasko
Posted: Wednesday, May 14, 2008 4:36:47 PM
Rank: Devotee

Joined: 12/11/2006
Posts: 47
Hi Doug

Thank you for your reply.

I am not quite sure I understand - I have looked at the XSLT files named "ListPhotos" and "ListGalleries". But I don't think I see the solution there? :). Maybe I am misunderstanding your post?

In my nodetree I have a structure like this:

Content
- homepage
- Nordsø-modeller
- Model 1
- Model 2
- Model 3
- Model 4
- Etc.
- Utilities
- Popup

In my XSLT I need some kind of looping through the nodes beneath "Nordsø-modeller", and grab the image on the one that needs to pop-up.

If you follow this link you can see what I have currently got. http://lh.anet.dk/hustyper/nordsoe-serien/nordsoe-modeller.aspx - As you can see it is the same image, that is popping up no matter what you select. Naturally it is doing so, because of the hardcoded ID of 1103.

I hope to hear from you again.

cheers!

/Jan
Jasko
Posted: Thursday, May 15, 2008 8:49:41 PM
Rank: Devotee

Joined: 12/11/2006
Posts: 47
...And so it turns out, that I just needed to modify my Javascript a bit to fix my problem...doh! :)

Kudos to Morten Bock for helping me out.

Cheers!

/Jan
Users browsing this topic
Guest


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.