Quantcast
Channel: C1 CMS Foundation - Open Source on .NET
Viewing all articles
Browse latest Browse all 2540

Commented Feature: Feature Request: New function for content reuse [1580]

$
0
0
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 **

@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();
}
```


Viewing all articles
Browse latest Browse all 2540

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>