Copied to clipboard

Flag this post as spam?

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


  • Guo 3 posts 23 karma points
    Dec 22, 2011 @ 15:57
    Guo
    0

    what did the @id means here.

    in demo i get a scope of script in file umbTopNavigation.xslt .

    <xsl:if test="$currentPage/@id = $currentPage/ancestor-or-self::* [@level=$level]/@id">

    where the @id come from? and what is means?

     

    by the way the script

    <a class="navigation" href="{umbraco.library:NiceUrl(@id)}">

    I can't find the NiceUrl method in the umbraco source code.  do you got it ?

    thank

  • awm 187 posts 376 karma points
    Dec 22, 2011 @ 16:11
    awm
    1

    the @id field is the id of the node ie. 1234. That test you have there is basically checking to see if the current page id matches a parent node or self's id.

    The umbraco.library.NiceUrl function returns a user-friendly path instead of a messy raw url. I'm not sure why you'd want to view the source for that function? To do that you'd have to view the uncompiled source, which I think you can download off codeplex?

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Dec 22, 2011 @ 18:13
    Jan Skovgaard
    0

    Hi Guo and welcome to our :)

    As alimac is saying above @id represents the id of the page. It's an attribute on the XML node that the XSLT is consuming.

    All of your content is available in umbraco.config, which is an XML file and the data structure in here is the structure your XSLT files are matching up against when you create XSLT macroes.

    /Jan

  • Guo 3 posts 23 karma points
    Dec 23, 2011 @ 03:46
    Guo
    0

    Thanks Alimac and thanks Jan.

    Is that means the @id is come from the URL? 

    About the umbraco.library.NiceUrl function, I was just want to know how can i get more similar function?

    So thanks. I'm the beginner to umbraco.

  • Dirk De Grave 4541 posts 6021 karma points MVP 3x admin c-trib
    Dec 23, 2011 @ 09:18
    Dirk De Grave
    0

    Guo,

    Each document has a unique id, that's what id is coming from. (Id of each document can be found on the 'Generic Properties' tab).

    Can you explain what you want exactly, what do you mean by "get more similar function". Do you want an overview of all available library functions? If so, have a look at this wiki entry.

     

    Cheers,

    /Dirk

  • Guo 3 posts 23 karma points
    Dec 23, 2011 @ 09:33
    Guo
    0

    Dirk,

    Thanks. You have got my mind. Your reply is what my need.

    Guo

Please Sign in or register to post replies

Write your reply to:

Draft