I made xlst macro with parameters. This macro will use this parameters to write "description" and "keyword" tags. I put this macro in the template content.
I want to allow my customer to set up macro parameters easily from page editor.
Is it possible somehow to allow site admin to set up macro parameters in page editor for each page?
My customer should be able to set up macro parameters from page editor, assuming that each page inherited from template with macro what have some parameters to input.
Are you wanting to allow your editors to insert the macro into the Richtext editor? If so, you can do that by editing the Macro in the Developer section and tick the "Allow macro in richtext editor" box. Then when you click Insert Macro this macro will appear and prompt for any parameters.
But I think what you are wanting is to have the macro in the template, and populate the parameters based on page fields? If so you can do that too using Advanced Macro Parameter Syntax. So you can add two fields to your document type(s), metaDescription and metaKeywords, then reference the macro like this:
XLST Parameters
Hi!
I made xlst macro with parameters. This macro will use this parameters to write "description" and "keyword" tags. I put this macro in the template content.
I want to allow my customer to set up macro parameters easily from page editor.
Is it possible somehow to allow site admin to set up macro parameters in page editor for each page?
Some moar info:
My customer should be able to set up macro parameters from page editor, assuming that each page inherited from template with macro what have some parameters to input.
Is it possible somehow?
Hi,
Are you wanting to allow your editors to insert the macro into the Richtext editor? If so, you can do that by editing the Macro in the Developer section and tick the "Allow macro in richtext editor" box. Then when you click Insert Macro this macro will appear and prompt for any parameters.
But I think what you are wanting is to have the macro in the template, and populate the parameters based on page fields? If so you can do that too using Advanced Macro Parameter Syntax. So you can add two fields to your document type(s), metaDescription and metaKeywords, then reference the macro like this:
<umbraco:Macro Alias="myMacro" description="[#metaDescription]" keywords="[#metaKeywords]" runat="server" />
See the above link for some other options like making the properties recursive.
-Tom
Thank you for your answer.
I would like to know: how can i add fields to document type?
Hi,
You would do this under Settings -> Document Types -> (your document type), then click the Generic Properties tab
I would suggest you check out this video: Document types from the Introduction to Umbraco series for more info
Thanks,
Tom
Thanks! That was helpfull!
/thread
is working on a reply...