Thank you for your reply. I was hoping if that wasnt necessary as it would be a lot of work. The macro is a usercontrol and thats another team working on them, not to mention the same macro is used other places.
Oh well, but if its impossible i will try and propose Rodion's solution.
Hi again. I can suggest some trick that looks like a bit of a hack and I cannot be absolutely sure that it will work in your case, but I used it one day in the past for some other purposes and it worked for me that time.
So, well, if you look into the source code of the 'Macro' control there's a piece in the very beginning of the 'CreateChildControls' that reads:
protected override void CreateChildControls() { // collect all attributes set on the control var keys = Attributes.Keys; foreach (string key in keys) MacroAttributes.Add(key.ToLower(), Attributes[key]);
Since the method is virtual you can simply inherit your own control from Macro and override this method:
public class MyMacro: Macro { protected override void CreateChildControl() { // In this place the 'Attributes' collection contains // the macro's parameter among other attributes // and since that you can modify them the way you want
// and then, the base class's method will be called with modified attributes base.CreateChildControl(); } }
Then you compile your class and register them as a usual custom control and then you can use it istead of the stadard umbraco:Macro where you want.
With this method you won't need to modify any way the macro or underlying user contro themselves since you play around only with the Macro control that's in fact is just a wrapper by which the macro placed into a page.
Very quick question
In a template, i have this
When that template is shown, a value is passed in the url that other macro's use with [@valueNameHere]
I want to pass that with the macro, and that can be done like so:
Which works, but i want to combine them like this:
But that doesnt work. Any suggestions?
As a very quick solution I would just split the 'RedirOnLogin' parameter to a couple and then concatenate them inside the macro.
Thank you for your reply. I was hoping if that wasnt necessary as it would be a lot of work. The macro is a usercontrol and thats another team working on them, not to mention the same macro is used other places.
Oh well, but if its impossible i will try and propose Rodion's solution.
Hi again. I can suggest some trick that looks like a bit of a hack and I cannot be absolutely sure that it will work in your case, but I used it one day in the past for some other purposes and it worked for me that time.
So, well, if you look into the source code of the 'Macro' control there's a piece in the very beginning of the 'CreateChildControls' that reads:
Since the method is virtual you can simply inherit your own control from Macro and override this method:
Then you compile your class and register them as a usual custom control and then you can use it istead of the stadard umbraco:Macro where you want.
With this method you won't need to modify any way the macro or underlying user contro themselves since you play around only with the Macro control that's in fact is just a wrapper by which the macro placed into a page.
is working on a reply...