Ah yea, I remember you mentioning that before. I think the only flaw in that, is that most machine/triple-tags seem to be for "holding" a "single" piece of information, where as you are "calling" a method with "multiple" parameters.
Your call, but I think forcing the syntax down a path it wasn't really meant for might hinder, rather than help.
The only other way I could think of doing it would be if you used named parameters instead
[Shortcodes:Max param1=123 param2=456]
but I think I'd prefer my first suggestions, plus it's inline with how /base works (doesn't need to know the param names, it's just based on the order)
Thanks for this project! It was a lifesaver! I was trying to get a macro to work inline and it didn't work thanks to the hard-coded way Umbraco handles macros and TinyMCE not letting you put a div inside a p. Then I ran across Morten Bock's excellent article about inline macros, but it said it wouldn't work for macros that take parameters, and it pointed me to ShortCodes.
I couldn't get it to work at first, then I looked at the example again and realized I was quoting string literals, so in case anyone else has this problem, that may help. For example, use [alias:MethodName(Literal1,Literal2)] instead of [alias:MethodName("Literal1","Literal2")]
If you've tried to get a macro with parameters to work inline and haven't had any success, hopefully you can get it done with ShortCodes.
Multiple parameters to a base method?
Hey Lee,
Nice work on getting shortcodes released.
Just wondered how you use / pass in multiple parameters to a base method? It wasn't clear in the demo video.
Cheers
Matt
Hi Matt,
Yeah - didn't get around to doing a demo of multiple parameters (due to Screenr's 5 min limitation).
Multiple parameters in Shortcodes are used liked in /Base ... delimited by slashes:
Depending on feedback, could change this for a future release?
Cheers, Lee.
Ok, seems cool.
Maybe something like this will be more "familiar" to people?
Matt
Yeah, I know what you mean... although, my aim was to follow the machine/triple-tag syntax.
Never say never... I'll give it some thought! :-)
Cheers, Lee.
Ah yea, I remember you mentioning that before. I think the only flaw in that, is that most machine/triple-tags seem to be for "holding" a "single" piece of information, where as you are "calling" a method with "multiple" parameters.
Your call, but I think forcing the syntax down a path it wasn't really meant for might hinder, rather than help.
Just a thought =)
Matt
Thanks Matt, full of thoughts today! ;-)
Good point about the machine-tags... food for thought!
Cheers, Lee.
As you know, I absolutely hate to say that you're right ... but, I think you're right about the syntax:
Looks similar to XsltExtensions... you know I'll have to integrate that next version too! ;-)
Cheers, Lee.
hehe, that must've hurt ;)
The only other way I could think of doing it would be if you used named parameters instead
but I think I'd prefer my first suggestions, plus it's inline with how /base works (doesn't need to know the param names, it's just based on the order)
Matt
Nah, not that painful - well maybe a little! LOL!
The named parameters is how WordPress handles it, which is good too. But I agree, the braces syntax falls more inline with .NET methods.
Cheers, Lee.
Thanks for this project! It was a lifesaver! I was trying to get a macro to work inline and it didn't work thanks to the hard-coded way Umbraco handles macros and TinyMCE not letting you put a div inside a p. Then I ran across Morten Bock's excellent article about inline macros, but it said it wouldn't work for macros that take parameters, and it pointed me to ShortCodes.
I couldn't get it to work at first, then I looked at the example again and realized I was quoting string literals, so in case anyone else has this problem, that may help. For example, use [alias:MethodName(Literal1,Literal2)] instead of [alias:MethodName("Literal1","Literal2")]
If you've tried to get a macro with parameters to work inline and haven't had any success, hopefully you can get it done with ShortCodes.
is working on a reply...