- I am trying to display node names from web/interactive's and logo/identity's child pages (Work test 1) on my home page. - I have created a xslt with content picker which picks "Portfolio". - When i insert my macro in the home page template, it picks web/interactive instead of its child page.
here is my xslt, I would really appritiate if someone could help me with this, as I dont have good knowledge about XSLT.
<!-- Don't change this, but add a 'contentPicker' element to --> <!-- your macro with an alias named 'source' --> <xsl:variable name="source" select="/macro/source"/>
<xsl:template match="/">
<!-- The fun starts here --> <ul> <xsl:for-each select="umbraco.library:GetXmlNodeById($source)/* [@isDoc and string(workDisplayHomepage) != '0']"> <xsl:sort select="@createDate" order="descending"/> <li> <a href="{umbraco.library:NiceUrl(@id)}">
<!-- we're under the item - you can do your own styling here --> <xsl:attribute name="class">selected</xsl:attribute>
<!-- Don't change this, but add a 'contentPicker' element to --> <!-- your macro with an alias named 'source' --> <xsl:variable name="source" select="/macro/source"/>
<xsl:template match="/">
<!-- The fun starts here --> <ul>
<xsl:for-each select="umbraco.library:GetXmlNodeById($source)/descendant-or-self::* [@isDoc and string(workDisplayHomepage) != '0']">
<xsl:for-each select="umbraco.library:GetXmlNodeById($source)/descendant::* [@isDoc and string(workDisplayHomepage) == '1']">
Does web/interactive even have the 'workDisplayHomepage' field? You can make this even better by requiring a certain document type as possible candidates, e.g.
<xsl:for-each select="umbraco.library:GetXmlNodeById($source)/descendant-or-self::* [@isDoc and string(workDisplayHomepage) == '1' and name() == 'Work test 1 document type alias']">
2. You probably need to check if 'workMainImage' is set:
I am getting this error when I loaded the twitter package on to my site. I am not sure why this is showing up, checked my marco and xslt and everything looks fine.
I haven't really got any experience with the Twitter wrapper from Warren Buckley, however I might be able to point you in the right direction anyway. Btw I've just installed it on a test Umbraco site and it works fine for me, so that means we'll have to do some digging your end.
Have a look at the Umbraco log if you can see some exception being thrown, and try to add ?umbdebugshowtrace=true to your url, that will give you a whole lot more of info on how the page gets parsed etc. Did you provide all the necessary details when you placed the Xslt on your template? In my test I filled out the Twitter alias, set the number of statuses to display to 50 and left everything else empty as it is.
It might also be worth just typing this into your browser:
thanks for your reply Sacha. You have been very kind to me and my umbraco errors.
But none of the above worked for me and I am still stuck. I will be very thankful if you could help me with this. In return i can help you with my design skills when u need it.
sorry I haven't replied earlier. Have you got it working now? If not please try the support forum for Twitter for Umbraco, Warren or sombebody else from this great community will probably fix your issue in no time, I'm afraid I haven't really got any experience with the package.
Help me in getting the right node
Hi my site's content page looks like this.
- I am trying to display node names from web/interactive's and logo/identity's child pages (Work test 1) on my home page.
- I have created a xslt with content picker which picks "Portfolio".
- When i insert my macro in the home page template, it picks web/interactive instead of its child page.
here is my xslt, I would really appritiate if someone could help me with this, as I dont have good knowledge about XSLT.
<?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"
exclude-result-prefixes="msxml umbraco.library Exslt.ExsltCommon Exslt.ExsltDatesAndTimes Exslt.ExsltMath Exslt.ExsltRegularExpressions Exslt.ExsltStrings Exslt.ExsltSets ">
<xsl:output method="xml" omit-xml-declaration="yes" />
<xsl:param name="currentPage"/>
<!-- Don't change this, but add a 'contentPicker' element to -->
<!-- your macro with an alias named 'source' -->
<xsl:variable name="source" select="/macro/source"/>
<xsl:template match="/">
<!-- The fun starts here -->
<ul>
<xsl:for-each select="umbraco.library:GetXmlNodeById($source)/* [@isDoc and string(workDisplayHomepage) != '0']">
<xsl:sort select="@createDate" order="descending"/>
<li>
<a href="{umbraco.library:NiceUrl(@id)}">
<!-- we're under the item - you can do your own styling here -->
<xsl:attribute name="class">selected</xsl:attribute>
<xsl:value-of select="@nodeName"/>
</a>
</li>
</xsl:for-each>
</ul>
</xsl:template>
</xsl:stylesheet>
You need to change this line
<xsl:for-each select="umbraco.library:GetXmlNodeById($source)/* [@isDoc and string(workDisplayHomepage) != '0']">
to this so it picks up all children (independent of level):
<xsl:for-each select="umbraco.library:GetXmlNodeById($source)/descendant-or-self::* [@isDoc and string(workDisplayHomepage) != '0']">
[You can leave out the '-or-self' part when your Portfolio page will never be selected this way.]
Hope that helps,
Sascha
thanks heaps!!
Upfortunately it is picking up the web/interactive level as well, even after leaving out "-or-self"
Now that i want to display image from "Work Test 1", its coming up with XSLT error.
My code looks like this now.
<?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"
exclude-result-prefixes="msxml umbraco.library Exslt.ExsltCommon Exslt.ExsltDatesAndTimes Exslt.ExsltMath Exslt.ExsltRegularExpressions Exslt.ExsltStrings Exslt.ExsltSets ">
<xsl:output method="xml" omit-xml-declaration="yes" />
<xsl:param name="currentPage"/>
<!-- Don't change this, but add a 'contentPicker' element to -->
<!-- your macro with an alias named 'source' -->
<xsl:variable name="source" select="/macro/source"/>
<xsl:template match="/">
<!-- The fun starts here -->
<ul>
<xsl:for-each select="umbraco.library:GetXmlNodeById($source)/descendant-or-self::* [@isDoc and string(workDisplayHomepage) != '0']">
<xsl:sort select="@createDate" order="descending"/>
<li>
<a href="{umbraco.library:NiceUrl(@id)}">
<!-- we're under the item - you can do your own styling here -->
<xsl:attribute name="class">selected</xsl:attribute>
<xsl:value-of select="@nodeName"/>
<xsl:variable name="media" select="umbraco.library:GetMedia(workMainImage, 0)" />
<img src="{$media/umbracoFile}" alt="{@nodeName}" />
</a>
</li>
</xsl:for-each>
</ul>
</xsl:template>
</xsl:stylesheet>
1. Try to do this
<xsl:for-each select="umbraco.library:GetXmlNodeById($source)/descendant::* [@isDoc and string(workDisplayHomepage) == '1']">
Does web/interactive even have the 'workDisplayHomepage' field? You can make this even better by requiring a certain document type as possible candidates, e.g.
<xsl:for-each select="umbraco.library:GetXmlNodeById($source)/descendant-or-self::* [@isDoc and string(workDisplayHomepage) == '1' and name() == 'Work test 1 document type alias']">
2. You probably need to check if 'workMainImage' is set:
<xsl:if test="./workMainImage != ''">
<xsl:variable name="media" select="......" />
<img ...... />
</xsl:if>
Thanks Sascha!!! you are a star...you are my saviour :)
Its working perfect and the result is here, on the home page the sliding banner...you fixed it for me :) thanks!
http://anildesign.com.139.gppnetwork.com/
Sweet, glad you got it working. Looks great!! :)
Hi Sascha,
I am again stuck with an Umbraco error, wondering if you can help me out.
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; line-height: 16.0px; font: 13.0px Arial}
Error parsing XSLT file: \xslt\CWS_twitterStatus.xslt
I am getting this error when I loaded the twitter package on to my site. I am not sure why this is showing up, checked my marco and xslt and everything looks fine.
Hey,
I haven't really got any experience with the Twitter wrapper from Warren Buckley, however I might be able to point you in the right direction anyway. Btw I've just installed it on a test Umbraco site and it works fine for me, so that means we'll have to do some digging your end.
Have a look at the Umbraco log if you can see some exception being thrown, and try to add ?umbdebugshowtrace=true to your url, that will give you a whole lot more of info on how the page gets parsed etc. Did you provide all the necessary details when you placed the Xslt on your template? In my test I filled out the Twitter alias, set the number of statuses to display to 50 and left everything else empty as it is.
It might also be worth just typing this into your browser:
http://api.twitter.com/1/statuses/user_timeline.xml?screen_name={your-Twitter-Username}&include_rts=0&count=200
This should return the xml feed for your statuses.
Warren has also set up a help forum for this package, have a look if you can find something that might help you out:
http://our.umbraco.org/projects/website-utilities/twitter-for-umbraco/help
Cheers,
Sacha
thanks for your reply Sacha. You have been very kind to me and my umbraco errors.
But none of the above worked for me and I am still stuck. I will be very thankful if you could help me with this. In return i can help you with my design skills when u need it.
Hi again,
sorry I haven't replied earlier. Have you got it working now? If not please try the support forum for Twitter for Umbraco, Warren or sombebody else from this great community will probably fix your issue in no time, I'm afraid I haven't really got any experience with the package.
Cheers,
Sascha
is working on a reply...