How to make Macro parameters easy to edit by end user
Hi,
very much a neewbie question, but I am totally sold on Umbraco as a development environment but I need to ensure that the editing of the site is as easy as possible for our clients.
I have created an Image Hyperlink macro that has two parameters, a url parameter supplied by a nodepicker and a media parameter supplied by a mediapicker.
All works fine when I insert the macro into the template, I get to choose the values through the two picker controls and the hyperlink image displays fine.
But on an ongoing basis how does my clicent easily change the image or url for this hyperlink?
Do I create a generic parameter and pass that into the macro, if so what is the point of specifying the Macro parameter type of media/node picker if its only used once (when the macro is inserted). I can't see my client being comfortable going into the template Html to editing or remove/add the macro again.
Is there a way of making it editable though the Canvas interface?
Probably the best way is to add the two picker fields to your doctype, and let the user edit them from there. Then you can adjust the template to read in the parameters from the values the user specified on the page rather than hardcoding them. You can do this with placeholders
How to make Macro parameters easy to edit by end user
Hi,
very much a neewbie question, but I am totally sold on Umbraco as a development environment but I need to ensure that the editing of the site is as easy as possible for our clients.
I have created an Image Hyperlink macro that has two parameters, a url parameter supplied by a nodepicker and a media parameter supplied by a mediapicker.
All works fine when I insert the macro into the template, I get to choose the values through the two picker controls and the hyperlink image displays fine.
But on an ongoing basis how does my clicent easily change the image or url for this hyperlink?
Do I create a generic parameter and pass that into the macro, if so what is the point of specifying the Macro parameter type of media/node picker if its only used once (when the macro is inserted). I can't see my client being comfortable going into the template Html to editing or remove/add the macro again.
Is there a way of making it editable though the Canvas interface?
Thanks in advance...
Probably the best way is to add the two picker fields to your doctype, and let the user edit them from there. Then you can adjust the template to read in the parameters from the values the user specified on the page rather than hardcoding them. You can do this with placeholders
You can also do recursive fields using $ instead of # - more info here: http://umbraco.org/documentation/books/macro-parameters-syntax/advanced-parameter-syntax
Thanks Tom,
I'd added some doctype pickers before but couldn't get the syntax correct on how to pass them in - simple when you know how ;)
Can editing these values be done also through Canvas editing?
Not too sure about Canvas, I don't use it much :) But I don't think it allows editing macros.
Hopefully someone else can chime in...
is working on a reply...