Prompted by a conversation at: http://compositec1.codeplex.com/discussions/430310
Please could we have a new public function, that when you supply it with a PageId and PlaceHolderId, will output the HTML from the content block of another page?
This will allow users to duplicate content from one page/area of a website into another, without having to copy/paste every time the original page is edited.
Comments: ** Comment from web user: Hainesy82 **
Please could we have a new public function, that when you supply it with a PageId and PlaceHolderId, will output the HTML from the content block of another page?
This will allow users to duplicate content from one page/area of a website into another, without having to copy/paste every time the original page is edited.
Comments: ** Comment from web user: Hainesy82 **
@burningice - I adjusted your code to compile, but it doesn't work, it still presents a textbox
```
[FunctionParameter(Label = "PlaceHolder", WidgetFactoryMethod = "GetPlaceholdersWidget")]
public string PlaceHolderId { get; set; }
```
```
public IWidgetFunction GetPlaceholdersWidget()
{
return StandardWidgetFunctions.DropDownList(typeof(_Page_App_Data_Razor_MyTest_GetContent_cshtml), "GetPlaceholders", "Key", "Value", false, true).WidgetFunction;
}
```
```
public static IDictionary<string, string> GetPlaceholders()
{
using (var dc = new DataConnection())
{
return dc.Get<IPagePlaceholderContent>().Select(x => x.PlaceHolderId).Distinct().ToDictionary(x => x);
}
}
```
Any ideas?