I am a newbie with Umbraco so please excuse if I am missing
something obvious. I have trawled the internet, but I can't find a
solution to my problem. If this should be in a different place on the forum, let me know and I'll repost it in it's correct place.
The others videos and tutorials successfully got me through setting
up a responsive nav and sub-nav, but on this issue, I'm stuck.
I am building a site which requires multiple CTAs. The text for these
need to be entered by persons who have no coding experience so I've set
up Document Types containing RichText Editor fields for them to enter
the required text and images.
My "Visualise XSLT" button isn't working though so I don't know what
is would say at this point. I don't get a modal window. (I'm working
remotely onto my client's system so that may have an impact.)
Now, if I insert the accompanying Macro into my template:
that results in not even the ID showing when I view the page:
<div class="rel-art"> </div>
I have tried with and without @nodeName, but no difference.
What is happening? What am I doing wrong? The only thing I can think
of is that I had some trouble getting another Document Type to show up
on the page until I changed its only Property Type from RichText Editor
to Textstring. But I tried that with this one as well, and that didn't
make any difference.
Never be afraid to ask any kind of question in here - we're a really friendly bunch of people who love to help each other out.
If there is something that you can't figure out it's most likely because there is a lack of either documentation or that things are not inituitive enough to figure out easily. So please just keep asking if something does not make sense.
Ok, so now to deal with your problem...
First of all - what version of Umbraco are you using?
The XSLT you're writing above is matching the old XML schema, which was changed in version 4.5 - therefore you won't see anything on the page.
I suggest you try going to "developer" section in Umbraco and right click the XSLT folder and choose to create an XSLT file from one of those premade options there are - does that output anything?
I'm using version 4.9, so if something changed in 4.5, that may be the where the problem lies!
Below is the full XSLT for the related content container (which is the one which isn't working) and the top navigation (which works fine.) The first one was created using a Clean template and the text in bold was put in by me based on the video I mentioned in the first post. If this video was created using a pre 4.5 version of Umbraco, then the code I put in must be what is outdated.
The following Navigation XSLT was created using List Subpages by Level, and I only inserted the Home li (in bold), so the navigation would include a link to the hompage.
Could it be that the code I got from the Umbraco video is outdated? I'm going to need to use the Clean XSLT template quite a lot for this project and I'm sort of relying on the videos for the XML, so if the videos are out of date, then I'm in a bit of trouble... A crash course in XML is needed I think :-)
Now I'm not ignoring this, but I'm working remotely onto my client's system and their remote system has been down for 4 days now so I can't actually test it out at the moment... :-(
I'll let you know how it goes as soon as I can though! :-)
worked and the page is now showing the node name. :-)
Firebug code is showing:
id="left_container">
<divclass="rel-art"> 24hr Branches Link div>
div>
So, the text for these need to be entered by persons who have no coding experience so I've set up Document Types containing RichText Editor fields for them to enter the required text and images.
How do I specify these so that the page displays the H2, article description and feature image? I haven't seen a tutorial for it.
This has a template:
Lorem Ipsum
(it's not showing the Lorem Ipsum)
and of course the now working XSLT file:
So which ones of these do I have to amend to get the H2, article description and feature image to show and what does it need to be? How can I then style each one individually? Can I use
in the XSLT file?
You may have guessed that I'm a newbie and you guys are teaching me so much about Umbraco and XML!
<xsl:value-of select="umbraco.library:GetXmlNodeById($currentPage/relatedContent1)/@nodeName"/> worked and the page is now showing the node name. :-)
Firebug code is showing:
<divid="left_container">
<divclass="rel-art"> 24hr Branches Link </div>
</div>
So, the text for these need to be entered by persons who have no coding experience so I've set up Document Types containing RichText Editor fields for them to enter the required text and images.
So which ones of these do I have to amend to get the H2, article description and feature image to show and what does it need to be? How can I then style each one individually? Can I use <div> in the XSLT file?
You may have guessed that I'm a newbie and you guys are teaching me so much about Umbraco and XML!
<xsl:value-of select="umbraco.library:GetXmlNodeById($currentPage/relatedContent1)/@nodeName"/> worked and the page is now showing the node name. :-)
Firebug code is showing:
<divid="left_container">
<divclass="rel-art"> 24hr Branches Link </div>
</div>
So, the text for these need to be entered by persons who have no coding experience so I've set up Document Types containing RichText Editor fields for them to enter the required text and images.
So which ones of these do I have to amend to get the H2, article description and feature image to show and what does it need to be? How can I then style each one individually? Can I use <div> in the XSLT file?
You may have guessed that I'm a newbie and you guys are teaching me so much about Umbraco and XML!
Document Type not showing on page
I am a newbie with Umbraco so please excuse if I am missing something obvious. I have trawled the internet, but I can't find a solution to my problem. If this should be in a different place on the forum, let me know and I'll repost it in it's correct place.
I am mainly using the Umbraco.TV videos to guide me through this, and in particular, this one: http://umbraco.com/help-and-support/video-tutorials/umbraco-fundamentals/datatypes/using-content-and-media-pickers/TVPlayer.
The others videos and tutorials successfully got me through setting up a responsive nav and sub-nav, but on this issue, I'm stuck.
I am building a site which requires multiple CTAs. The text for these need to be entered by persons who have no coding experience so I've set up Document Types containing RichText Editor fields for them to enter the required text and images.
Tab: Generic Properties
In the Template I have then inserted an Umbraco page field which references the relevant Document Type:
However, when I view the page in a browser, all I'm getting on the page is the Document Type ID:
I have tried setting it up and inserting it as an xslt:
My "Visualise XSLT" button isn't working though so I don't know what is would say at this point. I don't get a modal window. (I'm working remotely onto my client's system so that may have an impact.)
Now, if I insert the accompanying Macro into my template:
that results in not even the ID showing when I view the page:
I have tried with and without @nodeName, but no difference.
What is happening? What am I doing wrong? The only thing I can think of is that I had some trouble getting another Document Type to show up on the page until I changed its only Property Type from RichText Editor to Textstring. But I tried that with this one as well, and that didn't make any difference.
I am using Umbraco v4.9, if that helps.
Any help is gratefully received!
Thanks! :-)
Hi Trine and weclome to our :)
Never be afraid to ask any kind of question in here - we're a really friendly bunch of people who love to help each other out.
If there is something that you can't figure out it's most likely because there is a lack of either documentation or that things are not inituitive enough to figure out easily. So please just keep asking if something does not make sense.
Ok, so now to deal with your problem...
First of all - what version of Umbraco are you using?
The XSLT you're writing above is matching the old XML schema, which was changed in version 4.5 - therefore you won't see anything on the page.
I suggest you try going to "developer" section in Umbraco and right click the XSLT folder and choose to create an XSLT file from one of those premade options there are - does that output anything?
Looking forward to hearing from you.
/Jan
Hi Jan!
Thank you for answering so quickly!
I'm using version 4.9, so if something changed in 4.5, that may be the where the problem lies!
Below is the full XSLT for the related content container (which is the one which isn't working) and the top navigation (which works fine.) The first one was created using a Clean template and the text in bold was put in by me based on the video I mentioned in the first post. If this video was created using a pre 4.5 version of Umbraco, then the code I put in must be what is outdated.
Related Content XSLT. Doesn't work:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet [ <!ENTITY nbsp " "> ]>
<xsl:stylesheet
version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:msxml="urn:schemas-microsoft-com:xslt"
xmlns:umbraco.library="urn:umbraco.library" xmlns:Exslt.ExsltCommon="urn:Exslt.ExsltCommon" xmlns:Exslt.ExsltDatesAndTimes="urn:Exslt.ExsltDatesAndTimes" xmlns:Exslt.ExsltMath="urn:Exslt.ExsltMath" xmlns:Exslt.ExsltRegularExpressions="urn:Exslt.ExsltRegularExpressions" xmlns:Exslt.ExsltStrings="urn:Exslt.ExsltStrings" xmlns:Exslt.ExsltSets="urn:Exslt.ExsltSets" xmlns:twitter.library="urn:twitter.library" xmlns:PS.XSLTsearch="urn:PS.XSLTsearch" xmlns:google.maps="urn:google.maps"
exclude-result-prefixes="msxml umbraco.library Exslt.ExsltCommon Exslt.ExsltDatesAndTimes Exslt.ExsltMath Exslt.ExsltRegularExpressions Exslt.ExsltStrings Exslt.ExsltSets twitter.library PS.XSLTsearch google.maps ">
<xsl:output method="xml" omit-xml-declaration="yes"/>
<xsl:param name="currentPage"/>
<xsl:template match="/">
<xsl:value-of select="umbraco.library:GetXmlNodeById($currentPage/data [@alias = 'relatedContent1'])/@nodeName"/>
</xsl:template>
</xsl:stylesheet>
The following Navigation XSLT was created using List Subpages by Level, and I only inserted the Home li (in bold), so the navigation would include a link to the hompage.
Navigation XSLT. Works perfectly:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet [ <!ENTITY nbsp " "> ]>
<xsl:stylesheet
version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:msxml="urn:schemas-microsoft-com:xslt"
xmlns:umbraco.library="urn:umbraco.library" xmlns:Exslt.ExsltCommon="urn:Exslt.ExsltCommon" xmlns:Exslt.ExsltDatesAndTimes="urn:Exslt.ExsltDatesAndTimes" xmlns:Exslt.ExsltMath="urn:Exslt.ExsltMath" xmlns:Exslt.ExsltRegularExpressions="urn:Exslt.ExsltRegularExpressions" xmlns:Exslt.ExsltStrings="urn:Exslt.ExsltStrings" xmlns:Exslt.ExsltSets="urn:Exslt.ExsltSets" xmlns:twitter.library="urn:twitter.library" xmlns:PS.XSLTsearch="urn:PS.XSLTsearch" xmlns:google.maps="urn:google.maps"
exclude-result-prefixes="msxml umbraco.library Exslt.ExsltCommon Exslt.ExsltDatesAndTimes Exslt.ExsltMath Exslt.ExsltRegularExpressions Exslt.ExsltStrings Exslt.ExsltSets twitter.library PS.XSLTsearch google.maps ">
<xsl:output method="xml" omit-xml-declaration="yes" />
<xsl:param name="currentPage"/>
<!-- Input the documenttype you want here -->
<xsl:variable name="level" select="1"/>
<xsl:template match="/">
<!-- The fun starts here -->
<ul>
<li class="first"><a href="/">Home</a></li>
<xsl:for-each select="$currentPage/ancestor-or-self::* [@level=$level]/* [@isDoc and string(umbracoNaviHide) != '1']">
<li>
<a href="{umbraco.library:NiceUrl(@id)}">
<xsl:value-of select="@nodeName"/>
</a>
</li>
</xsl:for-each>
</ul>
</xsl:template>
</xsl:stylesheet>
Could it be that the code I got from the Umbraco video is outdated? I'm going to need to use the Clean XSLT template quite a lot for this project and I'm sort of relying on the videos for the XML, so if the videos are out of date, then I'm in a bit of trouble... A crash course in XML is needed I think :-)
Thank you again!!
Trine
I have read something about the v4.9 XSLT editor not working properly. Could this have an impact on my problem?
I'm still not sure what I have to do to make it work properly...
Hi Trine,
The highlighted line with the error is as Jan is saying based on the old XML scheme. Try the following:
<xsl:value-of select="umbraco.library:GetXmlNodeById($currentPage/relatedContent1)/@nodeName"/>
The new scheme don't use the data nodes, but the name of the attributes.
Or even better:
This way you'll use the key() function in xslt, witch is pretty fast :-) A bit harder to grasp though!
Now I'm not ignoring this, but I'm working remotely onto my client's system and their remote system has been down for 4 days now so I can't actually test it out at the moment... :-(
I'll let you know how it goes as soon as I can though! :-)
Awsome!
worked and the page is now showing the node name. :-)
Firebug code is showing:
<div class="rel-art"> 24hr Branches Link div>
So, the text for these need to be entered by persons who have no coding experience so I've set up Document Types containing RichText Editor fields for them to enter the required text and images.
Tab: Generic Properties
How do I specify these so that the page displays the H2, article description and feature image? I haven't seen a tutorial for it.
This has a template:
Lorem Ipsum
(it's not showing the Lorem Ipsum)
and of course the now working XSLT file:
So which ones of these do I have to amend to get the H2, article description and feature image to show and what does it need to be? How can I then style each one individually? Can I use
You may have guessed that I'm a newbie and you guys are teaching me so much about Umbraco and XML!
Thanks! :-)
Awsome!
<xsl:value-of select="umbraco.library:GetXmlNodeById($currentPage/relatedContent1)/@nodeName"/> worked and the page is now showing the node name. :-)
Firebug code is showing:
<div id="left_container">
<div class="rel-art"> 24hr Branches Link </div>
So, the text for these need to be entered by persons who have no coding experience so I've set up Document Types containing RichText Editor fields for them to enter the required text and images.
Tab: Generic Properties
How do I specify these so that the page displays the H2, article description and feature image? I haven't seen a tutorial for it.
This has a template:
<%@ Master Language="C#" MasterPageFile="~/masterpages/Main.master" AutoEventWireup="true" %>
<asp:Content ContentPlaceHolderId="ContentArea" runat="server">
<h2>Lorem Ipsum</h2>
</asp:Content>
<%@ Master Language="C#" MasterPageFile="~/masterpages/Main.master" AutoEventWireup="true" %>
<asp:Content ContentPlaceHolderID="ContentPlaceHolderDefault" runat="server">
</asp:Content>
and of course the now working XSLT file:
<xsl:output method="xml" omit-xml-declaration="yes"/>
<xsl:param name="currentPage"/>
<xsl:template match="/">
<xsl:value-of select="umbraco.library:GetXmlNodeById($currentPage/relatedContent1)/@nodeName"/>
</xsl:template>
</xsl:stylesheet>
So which ones of these do I have to amend to get the H2, article description and feature image to show and what does it need to be? How can I then style each one individually? Can I use <div> in the XSLT file?
You may have guessed that I'm a newbie and you guys are teaching me so much about Umbraco and XML!
Thanks! :-)
Awsome!
<xsl:value-of select="umbraco.library:GetXmlNodeById($currentPage/relatedContent1)/@nodeName"/> worked and the page is now showing the node name. :-)
Firebug code is showing:
<div id="left_container">
<div class="rel-art"> 24hr Branches Link </div>
So, the text for these need to be entered by persons who have no coding experience so I've set up Document Types containing RichText Editor fields for them to enter the required text and images.
Tab: Generic Properties
How do I specify these so that the page displays the H2, article description and feature image? I haven't seen a tutorial for it.
This has a template:
<%@ Master Language="C#" MasterPageFile="~/masterpages/Main.master" AutoEventWireup="true" %>
<asp:Content ContentPlaceHolderId="ContentArea" runat="server">
</asp:Content>
<%@ Master Language="C#" MasterPageFile="~/masterpages/Main.master" AutoEventWireup="true" %>
<asp:Content ContentPlaceHolderID="ContentPlaceHolderDefault" runat="server">
</asp:Content>
and of course the now working XSLT file:
<xsl:output method="xml" omit-xml-declaration="yes"/>
<xsl:param name="currentPage"/>
<xsl:template match="/">
<xsl:value-of select="umbraco.library:GetXmlNodeById($currentPage/relatedContent1)/@nodeName"/>
</xsl:template>
</xsl:stylesheet>
So which ones of these do I have to amend to get the H2, article description and feature image to show and what does it need to be? How can I then style each one individually? Can I use <div> in the XSLT file?
You may have guessed that I'm a newbie and you guys are teaching me so much about Umbraco and XML!
Thanks! :-)
is working on a reply...