I wish to be able to insert raw HTML into page content for the purposes of affiliate advertising, banner ads, etc. I understand how to add code to templates, but not to individual pages from within the editor. Raw HTML editing is out of the question.
I would imagine this can be done via an XSLT or other script macro? For example Amazon affiliate links are iframe.
I will give it a try right now dan... my XSLT skills are quite limited (I can alter the code of others, but don't know the structure well enough to write my own yet).
Does not work. When I click on the macro after SAVING the page, the multiline text is edited. It appears that the first set of double quotes causes a problem.
The richtext editor is fine. But clicking the "HTML" button and trying to insert code on the page is very clumsy and unmanageable at best I would like a way to simply drop code snippets into the richtext editor. That is, I have a need for a function or macro in the sense of "insert script here".
Another option is to create a folder in your tree with "advertisings" and there you put a specific documenttype that holds your advertising. After that you can create a macro that simply puts the advertising in its place.
Doing so allows you to reuse advertisings as well.
Yes, the items need to be inserted just as you would an image or other page element. If I use the Multiline Text property of the document, I must edit the template to change the placement of the item (or am I missing something again), and I need to create multiple text property boxes in the document definition, 1 for each "code item".
In other editors (be it frontpage, dreamweaver, etc) there in "insert script" button or buttons that simply insert the desired script (be it iframe, java, basic, whatever) at the desired location.
Had you already seen my last reply when you wrote this? I think thats the best solution in your case. Especialy when the script changes it would be nice to be able to change it in one location.
the Macro take the same param 'advertisementScriptId' as a contentpicker. and the checkbox 'use in editor' shoud be on. 'Render content in editor' should be off.
Now you can insert it into your editor and you only have to select the script you want.
Thank you for the help. It all appears to work with your assistance. While I don't think the solution is ideal (I don't like the idea of all of the extra nodes bogging down XSLT sorts, etc) It will suffice for now. I have added the umbracoNaviHide field to "folder" and all of the advertisement children.
Is there any problem with allowing the code to render in the editor other than it creating an active hyperlink?
If you put the advertisement folder outside your website it won't slow down at all. Then it won't be added to your site xml. That is also the reason why I use "umbraco.library:GetXmlNodeById"
Please select a solution so this item can be closed.
Macro to insert Raw script blocks
please forgive my ignorance...
I wish to be able to insert raw HTML into page content for the purposes of affiliate advertising, banner ads, etc. I understand how to add code to templates, but not to individual pages from within the editor. Raw HTML editing is out of the question.
I would imagine this can be done via an XSLT or other script macro? For example Amazon affiliate links are iframe.
Thoughts?
Hi There
You could perhaps create a macro with a single paramater of type "textMultiLine", then output it with xslt while using
Remembering to disable rendering in the editor.
Worth a shot!
Dan
I will give it a try right now dan... my XSLT skills are quite limited (I can alter the code of others, but don't know the structure well enough to write my own yet).
No luck
Does not work. When I click on the macro after SAVING the page, the multiline text is edited. It appears that the first set of double quotes causes a problem.
There has to be an easy way to do this.
The content passed to a macro is always set between two quots so it is never posible to pass quot's into a macro.
What did you mean by Raw HTML editing is out of the question?
That you do not want to use a richtext editor?
The richtext editor is fine. But clicking the "HTML" button and trying to insert code on the page is very clumsy and unmanageable at best I would like a way to simply drop code snippets into the richtext editor. That is, I have a need for a function or macro in the sense of "insert script here".
I hope I have explained myself well.
Is it nessesary to insert it on any location? Otherwise you can use a textMultiLine property on your page and insert it whereever you want.
Ron
Another option is to create a folder in your tree with "advertisings" and there you put a specific documenttype that holds your advertising.
After that you can create a macro that simply puts the advertising in its place.
Doing so allows you to reuse advertisings as well.
Ron
Yes, the items need to be inserted just as you would an image or other page element. If I use the Multiline Text property of the document, I must edit the template to change the placement of the item (or am I missing something again), and I need to create multiple text property boxes in the document definition, 1 for each "code item".
In other editors (be it frontpage, dreamweaver, etc) there in "insert script" button or buttons that simply insert the desired script (be it iframe, java, basic, whatever) at the desired location.
Bill
Had you already seen my last reply when you wrote this?
I think thats the best solution in your case.
Especialy when the script changes it would be nice to be able to change it in one location.
Ron
Thanks Ron... I had not seen the response when I posted. I am not real clear on the steps needed to get this setup.
I understand that I need to create:
I tried to create a macro with a media picker to insert the slected "advertising script" media, but I don't seen any results.
Step 5 is not correct.
You should create an xslt that takes a param `advertisementScriptId` and selects the script:
the Macro take the same param 'advertisementScriptId' as a contentpicker. and the checkbox 'use in editor' shoud be on. 'Render content in editor' should be off.
Now you can insert it into your editor and you only have to select the script you want.
Ron
the advertisement folder and the advertisement script both do not need a template
Ron
Thanks for the clarification. I will give it a try this afternoon and let you know how it turns out.
Thank you for the help. It all appears to work with your assistance. While I don't think the solution is ideal (I don't like the idea of all of the extra nodes bogging down XSLT sorts, etc) It will suffice for now. I have added the umbracoNaviHide field to "folder" and all of the advertisement children.
Is there any problem with allowing the code to render in the editor other than it creating an active hyperlink?
If you put the advertisement folder outside your website it won't slow down at all.
Then it won't be added to your site xml.
That is also the reason why I use "umbraco.library:GetXmlNodeById"
Please select a solution so this item can be closed.
Ron
is working on a reply...