I installed the nibble alt iphone package but these seems to be an issue with the actual js redirect I think the xslt is nor working as the output looks like the following
document.location.href=' ' no pathy so the page just keeps looping, if someone could point me in the right direction so the correct path renders.
It's probably because the code snippet is made with the old XML schema in mind. With the release of v4.5 the XML schema has changed. The snippet above is using the old schema.Therefore it does not match anything and is left empty.
To see how the XML looks like you can checkout the umbraco.config, which is stored in the app_data folder. This is the XML chache that is used. This should give you an idea on how to match the XML in your XSLT.
Well...in the old schema all nodes in Umbraco was defined as <node> elements in the umbraco.config file wether it was a document, image or file etc. - And then the document type was saved in a data element with an attribute value.
Now the schema has changed so that the alias of your document type is in fact the name of the element. So if you have a textpage document type called named "Text page" with an alias of "textpage", this would be a <textpage> element in the umbraco.config file.
This makes it easier to match elements in XSLT etc - the @IsDoc attribute is used on all nodes that are created in the content section since they can be considered as documents, I think. You don't need to include it in your match if it does not make sense in your context. All it does is to make sure that all the elements with this attribute set gets matched by the XSLT expression.
is a bit of time I'm trying to run the alt Page iPhone written by Tim Geyssens, but with poor results. I read in a forum that the scheme that uses the old. Someone managed to get it working? What have you changed? I use version 4.7 of umbraco ...
nibble alt iphone redirect not working in 4.6??
I installed the nibble alt iphone package but these seems to be an issue with the actual js redirect I think the xslt is nor working as the output looks like the following
document.location.href=' ' no pathy so the page just keeps looping, if someone could point me in the right direction so the correct path renders.
<script language=javascript>
if((navigator.userAgent.match(/iPhone/i))||
(navigator.userAgent.match(/iPod/i)))
{
document.location.href='<umbraco:Item field="pageID" runat="server" xslt="umbraco.library:Replace(umbraco.library:NiceUrl(umbraco.library:GetXmlNodeById({0})/ancestor-or-self::node [@level=1]/@id),'.aspx','/iphone.aspx')"></umbraco:Item>';
}
</script>
Cheers
Matt
Hi Matt
It's probably because the code snippet is made with the old XML schema in mind. With the release of v4.5 the XML schema has changed. The snippet above is using the old schema.Therefore it does not match anything and is left empty.
Try this code indstead
<umbraco:Item field="pageID" runat="server" xslt="umbraco.library:Replace(umbraco.library:NiceUrl(umbraco.library:GetXmlNodeById({0})/ancestor-or-self::*[@IsDoc] [@level=1]/@id),'.aspx','/iphone.aspx')"></umbraco:Item>
I think this should do the trick.
/Jan
Tried it it didn't work still got blank location.It's like the xslt does not execute al all If I remove it I just get the id of the current page
Is there an api doc for the schema somewhere?
Hi Matt
To see how the XML looks like you can checkout the umbraco.config, which is stored in the app_data folder. This is the XML chache that is used. This should give you an idea on how to match the XML in your XSLT.
Hope this helps.
/Jan
Is there docs on the aactual umbraco library
i.e. umbraco.library:Replace() etc..
the IsDoc field is null, what is this fiels supposed to do?
I'm not sure what you mean by this?
But yes, there is an extension called umbraco.library:Replace if that is what you mean. You can see the available extensions in the wiki here: http://our.umbraco.org/wiki/reference/umbracolibrary
As you can see this is in fact an existing extension.
/Jan
Yes that is what I was after
what did node represent in the old schema as opposed to IsDoc in the new schema?
I'm just trying to figure out what value i need to get this thing working
Well...in the old schema all nodes in Umbraco was defined as <node> elements in the umbraco.config file wether it was a document, image or file etc. - And then the document type was saved in a data element with an attribute value.
Now the schema has changed so that the alias of your document type is in fact the name of the element. So if you have a textpage document type called named "Text page" with an alias of "textpage", this would be a <textpage> element in the umbraco.config file.
This makes it easier to match elements in XSLT etc - the @IsDoc attribute is used on all nodes that are created in the content section since they can be considered as documents, I think. You don't need to include it in your match if it does not make sense in your context. All it does is to make sure that all the elements with this attribute set gets matched by the XSLT expression.
I hope this makes sense to you? :-)
/Jan
Hi to all,
is a bit of time I'm trying to run the alt Page iPhone written by Tim Geyssens, but with poor results. I read in a forum that the scheme that uses the old. Someone managed to get it working? What have you changed? I use version 4.7 of umbraco ...
I look forward to your help.
Thank you very much,
Regards.
G.
is working on a reply...