I want to create a simple banner ( some text and a button with a special layout) and I want to make it reusable for detail pages, but only with some specific content.
In the last time, I often used macro partials to insert some code fragments to my content pages. So I can easily reuse it. But in this case it seems to be too much, because the banner doesn't have much logic.
But on the other way, I don't want to make a property to show this banner on some pages, it also seems as I would integrate too much unneccessary properties for pages where I don't need this item.
So, can you please tell me how you would solve this task in a "clean and friendly" Umbraco manner??
Reuseable Content - Best practice
Hey people,
I want to create a simple banner ( some text and a button with a special layout) and I want to make it reusable for detail pages, but only with some specific content.
In the last time, I often used macro partials to insert some code fragments to my content pages. So I can easily reuse it. But in this case it seems to be too much, because the banner doesn't have much logic.
But on the other way, I don't want to make a property to show this banner on some pages, it also seems as I would integrate too much unneccessary properties for pages where I don't need this item.
So, can you please tell me how you would solve this task in a "clean and friendly" Umbraco manner??
:) Thank you for your advice,
Nadine
Hi Nadine,
May be the below link help you.
https://our.umbraco.com/forum/using-umbraco-and-getting-started/92091-reusable-content#comment-293145
Thanks
Hello Nadine,
Are you familiar with the repository pattern in Umbraco?
Hi Nadine
So in saying you only want it for some specific content are you referring to specific document type(s) ?
My response is assuming the answer to the above is "Yes"
So:
The partial from step 3 should have something along the following lines:
Hope this helps.
Cheers
Nigel
is working on a reply...