Copied to clipboard

Flag this post as spam?

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


  • bob baty-barr 1180 posts 1294 karma points MVP
    Jul 27, 2012 @ 17:51
    bob baty-barr
    0

    is there a better way to do this? Jquery and Macros

    Hello all you smart folks out there!

    i am workign on some fairly straight forward code.. i am using jquery and the awesome node2json package demoed at code garden this year to populate a cascading dropdown -- simple enough.

    when using node2json, i am pulling back the nodeName and the nodeID -- of course, when you pick somethign from the second dropdown, it sets the href on teh GO button... right now i can only use the nodeID - so my url looks like http//domain.com/1234

    how can i take advantage of niceUrl() to get the actual niceUrl???

    i have tried the following --

    1. render the href as {localLink:1234} syntax... but since it is dynamic, umbraco would never catch and parse anyway.

    2. i was trying to have a maco in my jquery syntax, but cannot for the life of me figure out how to use a jquery variable as a macro param -- and it would be dynamic anyway... and again... umbraco could not catch and parse on the fly.

    it's like i wish there was a javascript or jQuery extension for umbraco to expose things like niceUrl, etc. -- am i crazy?

    thanks for reading ;)

  • Peter Dijksterhuis 1442 posts 1722 karma points
    Jul 27, 2012 @ 19:37
    Peter Dijksterhuis
    0

    Hey smart Bob!

    if I understand correctly, you want jQuery to do something like umbraco does using {locallink}.

    You can't do that since jquery is frontend and it has no clue of what id's and so on is sitting in the backend.

    But, since you're allready getting the ID from json, why not get the niceURL as well?

    Correct me if I completely misunderstood you.

    Cheers,

    Peter

  • bob baty-barr 1180 posts 1294 karma points MVP
    Jul 27, 2012 @ 19:54
    bob baty-barr
    0

    i suppose i could look into the razor scripting for node2json and hack it for this need ;)

Please Sign in or register to post replies

Write your reply to:

Draft