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: burningice **
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: burningice **
@Hainesy82 it sure is easy to create such a dropdown list.
On your Input Parameter on the razor function you specify a WidgetFactoryMethod like this
```
[FunctionParameter(Label = "Placeholder", WidgetFactoryMethod = "GetPlaceholdersWidget")]
```
Then you specify the widget like this
```
public static IWidgetFunction GetPlaceholdersWidget()
{
return StandardWidgetFunctions.DropDownList(GetType(), "GetPlaceholders", "Key", "Value", false, true).WidgetFunction;
}
```
and finally the list of placeholders like this
```
public static IDictionary<string, string> GetPlaceholders()
{
return Data.Get<IPagePlaceholderContent>().Select(p => p.PlaceHolderId).Distinct().ToDictionary();
}
```