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
Hi again
I have created several sections of a site as Macros which I want the user to be able to choose which one they would like to use on certain pages.
I have added a True/False property and attempted to wrap the macro(s) in a If = 1 (or True etc) then display logic
eg
@if (item.GetPropertyValue("displayServices") == "True") { @Umbraco.RenderMacro("Services") }
If I add the @Umbraco.RenderMacro("Services") direct into the page then it works fine but how can i let the user decide if they want to display it or not?
Is it even possible to do this way?
Thanks
Ben
I have found this which works but I would like the user to be able to edit the details of the macro
http://www.ablogaboutcoding.com/2015/10/02/creating-a-custom-component-in-umbraco-7/
Using it this way does not allow the user to edit the text, If is grayed out, Is there a way that I can make this editable?
Or am I going about it all wrong?
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Allow a user to choose to display a macro.
Hi again
I have created several sections of a site as Macros which I want the user to be able to choose which one they would like to use on certain pages.
I have added a True/False property and attempted to wrap the macro(s) in a If = 1 (or True etc) then display logic
eg
If I add the @Umbraco.RenderMacro("Services") direct into the page then it works fine but how can i let the user decide if they want to display it or not?
Is it even possible to do this way?
Thanks
Ben
I have found this which works but I would like the user to be able to edit the details of the macro
http://www.ablogaboutcoding.com/2015/10/02/creating-a-custom-component-in-umbraco-7/
Using it this way does not allow the user to edit the text, If is grayed out, Is there a way that I can make this editable?
Or am I going about it all wrong?
is working on a reply...