Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
is this possible to have "reusable content" in Umbraco ? Basically, it would be some pieces of HTML that content manager could define then insert into their page via the RTE. And if they change the content of the reusable content, it changes on every page it is used.
I saw that this functionality seems to be included in this package: https://our.umbraco.org/projects/starter-kits/umazel-starter-kit-responsive-bootstrap-theme/ but I don't want to use a whole starter kit just for one functionnality.
Does the content manager needs control over the HTML or the content?
You could take a look at partial view macro's. They can be used in the richtext editor.
If you are using Grid layout you could use DocType grid editor. A great package.
Yeah, that's the thing. Content manager needs to be able to create such content, they don't have to ask us to create some for them to be able to use them.
I'll answer my own question.
Basically, I created a document type called "Reusable content" with just a " ReusableContentBody" property.
Then I created a macro with a content picker parameter and the view is the following:
if (Model.MacroParameters["ReusableContentRef"] != null)
var item = Umbraco.TypedContent(Model.MacroParameters["ReusableContentRef"].ToString());
if (item.DocumentTypeAlias == ReusableContent.ModelTypeAlias)
var rc = item as ReusableContent;
So I just retrieve a reference to the parameter value, I checked if the document type is correct, and if it is, I display the property and poof, I have reusable contents.
That's what I suggested ;-) Glad you found the solution.
Yes but at that time I didn’t really understood your answer hehe.
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted