Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Matt Todd 9 posts 29 karma points
    Jan 25, 2011 @ 01:54
    Matt Todd
    0

    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

  • Jan Skovgaard 11280 posts 23678 karma points MVP 10x admin c-trib
    Jan 25, 2011 @ 08:04
    Jan Skovgaard
    0

    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

     

  • Matt Todd 9 posts 29 karma points
    Jan 25, 2011 @ 21:52
    Matt Todd
    0

    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

    document.location.href='';

    Is there an api doc for the schema somewhere?

     

     

  • Jan Skovgaard 11280 posts 23678 karma points MVP 10x admin c-trib
    Jan 25, 2011 @ 21:54
    Jan Skovgaard
    0

    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

  • Matt Todd 9 posts 29 karma points
    Jan 25, 2011 @ 22:36
    Matt Todd
    0

    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?

     

     

  • Jan Skovgaard 11280 posts 23678 karma points MVP 10x admin c-trib
    Jan 25, 2011 @ 22:41
    Jan Skovgaard
    0

    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

  • Matt Todd 9 posts 29 karma points
    Jan 25, 2011 @ 22:49
    Matt Todd
    0

    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

  • Jan Skovgaard 11280 posts 23678 karma points MVP 10x admin c-trib
    Jan 25, 2011 @ 22:56
    Jan Skovgaard
    0

    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

  • Matt Todd 9 posts 29 karma points
    Jan 25, 2011 @ 23:28
    Matt Todd
    0
    I'm giving up on this package is there any other examples working with umbraco out there?
  • Giacomo Cosenza 16 posts 36 karma points
    May 23, 2011 @ 18:23
    Giacomo Cosenza
    0

    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.

Please Sign in or register to post replies

Write your reply to:

Draft