Thanks for your reply. Your link got me on the right track. It seems that changing the macro parameter aliases to a more RUBY'ish name will do the trick. I changed the names to:
- language_id - headline
Now I can read them inside IronRuby (highfive). They are just normal variables without any prefixes.
Let's say you want to write out a headline:
puts "<h1>#{headline}</h1>"
---
If my macro parameter name is LanguageId it seems impossible to read it from IronRuby. I have tried various combinations without any luck:
How to get macro parameters inside IronRuby
Hi there,
I've created a very simple IronRuby script, and added a macro on top of it.
The script works fine and renders nicely on my page. Now I have added a couple of parameters to my macro.
- LanguageId (number)
- Headline (text)
How do I retrieve them inside my IronRuby script? I have tried $LanguageId, @LanguageId but no luck!
In IronPython it's possible with:
if globals().has_key("LanguageId"):
languageId = int(LanguageId)
/Dennis
Hi Dennis
I'm not really a programmer myself but I got curious about this when I saw your post so I tried to google a bit and maybe I found something...
I'm not sure...but could this be what you're after? http://webcache.googleusercontent.com/search?q=cache:K7uxCPkWqaoJ:wwww.umbraco.org/forum/developers/extending-umbraco/13698-IronRuby-and-Umbraco+umbraco+ironruby+get+parameter&cd=2&hl=da&ct=clnk&gl=dk&client=firefox-a&source=www.google.dk#comment50617
All the best.
/Jan
Hi Jan,
Thanks for your reply. Your link got me on the right track. It seems that changing the macro parameter aliases to a more RUBY'ish name will do the trick. I changed the names to:
- language_id
- headline
Now I can read them inside IronRuby (highfive). They are just normal variables without any prefixes.
Let's say you want to write out a headline:
puts "<h1>#{headline}</h1>"
---
If my macro parameter name is LanguageId it seems impossible to read it from IronRuby. I have tried various combinations without any luck:
LanguageId
LanguageID
Languageid
languageId
languageID
languageid
Language_Id
Language_ID
Language_id
language_Id
language_ID
language_id
If anyone knows why please leave a message - it could be great to know why :-)
/Dennis
is working on a reply...