I have a problem when it comes to inherit css and javascript to nodes lower than the second level.
To make the interface easy for the end user, I have put all nodes (that the user can access from the menu), in files under the home page. For every node that have more children, these are then place under its parent node. In this way I will get a nice hierarchal folder system. The doctypes are as the content, placed in the hierarchal structure.
All templates are placed directly under a master template which they inherit from. The master template imports all the css and javascripts files. The problem is when the content pages are located more than one level under the homepage, the javascript and the css stops working, even though their templates are locater irectly under the master template. It works fine for the nodes directly under the home page. How can I make the inheritance work through the whole hierarchal structure?
The second problem I have is related to this problem. I have imported the jCarousel packet and it works fine, when the node keeping the carousel is placed directly under the Content folder. I would like to take the javascript out from the xslt and put it in the javascrit file, so I have everything in one place. But the script tag includes some xslt, and I do not know how to seperate them.
I could be misunderstanding your first problem here, but if you put a leading '/' character in front of your javascript and css file paths then they should always load correctly.
Yes, as jonok suggests, check whether you're referencing your js correctly, most probably you're not having a leading slash.
Don't think there's a way to separate js from the xslt, but you don't need to include it in your xslt. you can include the js in your template and use <%=umbraco.presentation.nodeFactory.Node.GetCurrent().getProperty("alias") instead of the <xsl:value-of> from your xslt.
I don't really see how you could solve the second problem, if you really (really!?) need the slider speed to be configurable from Umbraco, then you'd need something like you already have there..
Inheritance problems
I have a problem when it comes to inherit css and javascript to nodes lower than the second level.
To make the interface easy for the end user, I have put all nodes (that the user can access from the menu), in files under the home page. For every node that have more children, these are then place under its parent node. In this way I will get a nice hierarchal folder system. The doctypes are as the content, placed in the hierarchal structure.
All templates are placed directly under a master template which they inherit from. The master template imports all the css and javascripts files. The problem is when the content pages are located more than one level under the homepage, the javascript and the css stops working, even though their templates are locater irectly under the master template. It works fine for the nodes directly under the home page. How can I make the inheritance work through the whole hierarchal structure?
The second problem I have is related to this problem. I have imported the jCarousel packet and it works fine, when the node keeping the carousel is placed directly under the Content folder. I would like to take the javascript out from the xslt and put it in the javascrit file, so I have everything in one place. But the script tag includes some xslt, and I do not know how to seperate them.
Does anyone know how to do this?
Thankful for all help I can get!
I could be misunderstanding your first problem here, but if you put a leading '/' character in front of your javascript and css file paths then they should always load correctly.
Thank you Jonok, that solved my first problem! =)
Yes, as jonok suggests, check whether you're referencing your js correctly, most probably you're not having a leading slash.
Don't think there's a way to separate js from the xslt, but you don't need to include it in your xslt. you can include the js in your template and use <%=umbraco.presentation.nodeFactory.Node.GetCurrent().getProperty("alias") instead of the <xsl:value-of> from your xslt.
Hope this helps.
Regards,
/Dirk
I don't really see how you could solve the second problem, if you really (really!?) need the slider speed to be configurable from Umbraco, then you'd need something like you already have there..
Ok, thanks a lot for all your replies. I will keep the javascript in the xslt then.=)
is working on a reply...