There isn't a way to specify the node to take the property values from - that's generally a wider Umbraco issue.
For RenderTemplate, the way I would approach it is to do this programatically, see this code snippet:
protected void Page_Load(object sender, EventArgs e)
{
// get the property value from the specific node
var settingsNode = uQuery.GetNode(1234);
var nodeIds = settingsNode.GetProperty<string>("leftContentWidgets ");
// manually create the RenderTemplate control
var ctrl = new uComponents.Controls.RenderTemplate() { NodeIds = nodeIds };
// add the control to a placeholder (or wherever)
this.Page.Controls.Add(ctrl);
}
I implemented this in my own server control today and it worked perfectly. My control takes a CurrentPage parameter which allows me to set the location of the node ids. This would be really good to include in uComponents in the future. RenderTemplate is a really control is excellent!!!
Using a settings page as the source for RenderTemplate
I'm using the render template macro on a content page which is working great, but would also like to set the page source to another node.
This will allow me to have a global area to power my widgets but i can also add additional on the page.
NodeIds="[#leftContentWidgets],[#defaultWidgets],1111" this only looks a the leftContentWidgets or defaultWidgets fields on the current page,
I need a way of saying #leftContentWidgets is on node number X
Thanks
Hi Craig,
There isn't a way to specify the node to take the property values from - that's generally a wider Umbraco issue.
For RenderTemplate, the way I would approach it is to do this programatically, see this code snippet:
Hope that makes sense?
Cheers, Lee.
Hi Lee,
I implemented this in my own server control today and it worked perfectly. My control takes a CurrentPage parameter which allows me to set the location of the node ids. This would be really good to include in uComponents in the future. RenderTemplate is a really control is excellent!!!
Thanks
Craig
is working on a reply...