.Net User Control property values based on current page
Hi guys,
I have created a User Control that has a number of properties that controls the layout and behavior of this control.
The basic functionality is to dynamically create a form, where the user can interact with certain information on the site. I create form fields based on two comma separated string properties, and I would like to pass information in through the template based on the current page.
One example is, that I would like to pass in the name of the page and the values of two properties I have defined in my Document Type. These values should be part of the comma separated string that also holds some "hard coded" values defined when creating the template.
I have an example of what I would like to do here:
Maybe Dirks article about parameter chaining could be useful here as well. But it sounds like you're putting too much responsibility into one macro call though..
Very interesting articles indeed! But it unfortunately not exactly what I am looking for. The parameter chaining syntax looks like clashes with my own syntax. I am not looking for chaining, but rather multiple values and hard coded text in the macro properties. Så when I enter:
inputParameter="[#title], [$otherTitle], My default title"
I would like that to pass in the value "title, otherTitle, My default title" rather than just one of them. I am going to try with a semicolon separated list instead of a comma separated.
.Net User Control property values based on current page
Hi guys,
I have created a User Control that has a number of properties that controls the layout and behavior of this control.
The basic functionality is to dynamically create a form, where the user can interact with certain information on the site. I create form fields based on two comma separated string properties, and I would like to pass information in through the template based on the current page.
One example is, that I would like to pass in the name of the page and the values of two properties I have defined in my Document Type. These values should be part of the comma separated string that also holds some "hard coded" values defined when creating the template.
I have an example of what I would like to do here:
I want to pass in the Page Name in the Values list, but this is not necessarily always the Page Name. It could be something else like this:
Where I would like to pass in a Document Type Property to the same control but in a different Template.
Any thoughts on how to do this best... or should I redesign the properties completely?
Thanks in advance, and Happy Holidays!
RasB
Using umbraco v 4.0.3 (Assembly version: 1.0.3625.27276)
Hi rasb,
Have a look at this wiki page on how to pass document properties from your macro to the user control.
Hope this helps.
Regards,
/Dirk
Maybe Dirks article about parameter chaining could be useful here as well. But it sounds like you're putting too much responsibility into one macro call though..
Hi Dirk and Sebastian,
Very interesting articles indeed! But it unfortunately not exactly what I am looking for. The parameter chaining syntax looks like clashes with my own syntax. I am not looking for chaining, but rather multiple values and hard coded text in the macro properties. Så when I enter:
I would like that to pass in the value "title, otherTitle, My default title" rather than just one of them. I am going to try with a semicolon separated list instead of a comma separated.
Thanks for the input guys!
Hi Guys,
I ended up sending in the NodeId of the page, and then parsing properties myself. Reading values like that doesn't work apparently.
Thanks for the input guys,
RasB
is working on a reply...