|
|
 Rank: Addict
Joined: 7/19/2006 Posts: 649 Location: Preston, UK
|
Guys,
I have page when i publish it then make changes save and preview all works as expected. If however the page is not published then i try preview i get "Cannot widen from target type to primitive type" [XsltException: Function 'umbraco.library:NiceUrl()' has failed.]
This is umbraco 2.1.7.
Any ideas?
Regards
Ismail
Level 2 certified. If it aint broke dont fix.
|
|
 Rank: Devotee
Joined: 7/6/2007 Posts: 69 Location: Brussels
|
Ismail Mayat wrote: Guys,
I have page when i publish it then make changes save and preview all works as expected. If however the page is not published then i try preview i get "Cannot widen from target type to primitive type" [XsltException: Function 'umbraco.library:NiceUrl()' has failed.]
This is umbraco 2.1.7.
Any ideas?
Regards
Ismail
I have the same problem. Did you find out / resolve it Ismail?
^(B(astia{2}n)?)(\s)?(W(ak{2}ie)?)$ IRC --> irc://irc.freenode.org/umbraco
|
|
 Rank: Addict
Joined: 7/19/2006 Posts: 649 Location: Preston, UK
|
Bastian, I had to do the following hack not nice but it worked: Code: <!-- are we in preview mode? --> <xsl:if test="umbraco.library:RequestQueryString('umbVersion')=''"> <li> <a target="_blank"> <xsl:attribute name="href"> <xsl:choose> <xsl:when test="$currentPage/@id='1057'"> <xsl:value-of select="umbraco.library:NiceUrl('1057')" /> ?altTemplate=print home </xsl:when> <xsl:otherwise> <xsl:value-of select="umbraco.library:NiceUrl($currentPage/@id)" /> ?altTemplate=print </xsl:otherwise> </xsl:choose> </xsl:attribute> Print </a> </li> </xsl:if>
regards Ismail
Level 2 certified. If it aint broke dont fix.
|
|
Rank: Newbie
Joined: 10/26/2007 Posts: 2
|
I had a similar issue, and came upon this post. Even though it didn't provide me a solution, I did find one so I thought I'd share it.
For some reason, when the node isn't published, $currentPage for me contains the entire site tree so $currentPage/@id gave me an empty string. It's easy to test whether this is happening to you just by adding a few debug statements.
To get around this, I used umbraco.library:PageId() instead.
|
|
|
Guest |