I am wondering if there is some way to extend the TinyMCE editor to allow access to document properties. For example, I have a "min interest rate" and "max interest rate" texstring properties on my home page's Properties tab. These rates will be used throughout the site, so it's set once on the homepage and called recursively. I'd like to be able to reference them in a rich text editor in my Content tab of my homepage. Something like, "rates between 1.2% and 3.5%. Email or call to find out how." Is this doable? I know I can use nodeFactory to get the values dynamically, but I'm stumped as far as getting it into the RTE or even rendering them on the frontend. Any suggestions on how this could be accomplished with an RTE or without in some editble area would be greatly appreciated. Thanks and have a good one!
Hi. If I'm right that you just want to be able to insert the values of properties to your rich text content then you can always do it with creating some macro which returns this values and insert this macro into your content (the macro should have the "use in editor" option turned on).
It must have been a long week because that didn't even occur to me. Yes that will work. Thanks for the suggestion. The problem now though is that I have nested macros. The rich text editor mentioned is part of a macro that renders a sidebar widget. I tried using umbraco.library:RenderMacro, but can't display the rates within the RTE in a <li> tag. Tried MacroContainer data type as well and also unsuccessful. Is there a way around this that doesn't involve restructuring the macro(s)? Thank you!
Above is a screenshot of the backend. The "borrow widget" is rendered using a macro. I'd like to get a "min interest rate" and "max interest rate" property stored in the "Global Variables" tab and insert those values in the bullet of the RTE. Using a macro to get the those interest rates would work except that it would be nested in another macro.
Let me try to explain again. We are attempting to create macro's that hold site wide variables, such as borrowerRate and minAprRate and several others. We would like administrators to be able to set these Global variables and writers and editors to be able to include them in the Rich Text Editor via the Insert Macro button. All is working wonderfully up to this point.
Here's where it get's tricky…
We are using Umbraco as a Content Repository, and then grabbing the generated xml via 1 of 2 methods:
First Method: asp.net Repeater with the datasource set to the umbraco.config xml file.
Second Method: using the jQuery Get /base method.
Regardless of the above approaches the outputted xml simply outputs: <?UMBRACO_MACRO macroAlias="MinAprRate"/> instead of the value of the macro.
Does anyone know how to get the macro to output their contents or values to the XML so minAprRate value can be accessed via the above results? Would the Rndr or UComponent packages be useful? Thank you!
I came across this post while searching for a solution to my current challenge: I'd like to render a 'global' or site wide variable such as a rate or start date from within the RTE.
Parial View Macro adds p tags and quotation marks seem to appear on the surrounding text - so it is not working for me at the moment. I'd like to have the short variable string appear completely inline.
The goal is to have access to variables which are used/rendered throughout the site but can be updated in a single location. At the moment I have no idea how to do this in Umbraco 7.
After a lengthy search and a very late night, I was able to achieve the goal of accessing properties through the RTE using the method described here by Morten Bock. Much of the work was getting the templates module running in the RTE/tinymce in Umbraco7 but found a helpful guide for doing this.
I could not get Macro Partial Views to work as an placed Macro, however a UserControl Macro placed in a .aspx template is working as expected.
I find this a very useful feature! Thanks to Mr. Bock for the detailed instructions.
Access properties in a rich text editor
Hello
I am wondering if there is some way to extend the TinyMCE editor to allow access to document properties. For example, I have a "min interest rate" and "max interest rate" texstring properties on my home page's Properties tab. These rates will be used throughout the site, so it's set once on the homepage and called recursively. I'd like to be able to reference them in a rich text editor in my Content tab of my homepage. Something like, "rates between 1.2% and 3.5%. Email or call to find out how." Is this doable? I know I can use nodeFactory to get the values dynamically, but I'm stumped as far as getting it into the RTE or even rendering them on the frontend. Any suggestions on how this could be accomplished with an RTE or without in some editble area would be greatly appreciated. Thanks and have a good one!
Phil
Hi. If I'm right that you just want to be able to insert the values of properties to your rich text content then you can always do it with creating some macro which returns this values and insert this macro into your content (the macro should have the "use in editor" option turned on).
Hey Rodion
It must have been a long week because that didn't even occur to me. Yes that will work. Thanks for the suggestion. The problem now though is that I have nested macros. The rich text editor mentioned is part of a macro that renders a sidebar widget. I tried using umbraco.library:RenderMacro, but can't display the rates within the RTE in a <li> tag. Tried MacroContainer data type as well and also unsuccessful. Is there a way around this that doesn't involve restructuring the macro(s)? Thank you!
Phil
Hi Phillip...have you tried using umbraco.library:GetItem() to render your output?
/Jan
Hi, Philip. So, am I right that for the moment the problem is to draw several macros as a <ul> list?
Above is a screenshot of the backend. The "borrow widget" is rendered using a macro. I'd like to get a "min interest rate" and "max interest rate" property stored in the "Global Variables" tab and insert those values in the bullet of the RTE. Using a macro to get the those interest rates would work except that it would be nested in another macro.
This package wouldn't help me with the nested macro problem right? Thanks.
Bump.
Let me try to explain again. We are attempting to create macro's that hold site wide variables, such as borrowerRate and minAprRate and several others. We would like administrators to be able to set these Global variables and writers and editors to be able to include them in the Rich Text Editor via the Insert Macro button. All is working wonderfully up to this point.
Here's where it get's tricky…
We are using Umbraco as a Content Repository, and then grabbing the generated xml via 1 of 2 methods:
Regardless of the above approaches the outputted xml simply outputs: <?UMBRACO_MACRO macroAlias="MinAprRate"/> instead of the value of the macro.
Does anyone know how to get the macro to output their contents or values to the XML so minAprRate value can be accessed via the above results? Would the Rndr or UComponent packages be useful? Thank you!
Hello all,
I came across this post while searching for a solution to my current challenge: I'd like to render a 'global' or site wide variable such as a rate or start date from within the RTE.
Parial View Macro adds p tags and quotation marks seem to appear on the surrounding text - so it is not working for me at the moment. I'd like to have the short variable string appear completely inline.
The goal is to have access to variables which are used/rendered throughout the site but can be updated in a single location. At the moment I have no idea how to do this in Umbraco 7.
Thanks,
Steve
Hello again,
After a lengthy search and a very late night, I was able to achieve the goal of accessing properties through the RTE using the method described here by Morten Bock. Much of the work was getting the templates module running in the RTE/tinymce in Umbraco7 but found a helpful guide for doing this.
I could not get Macro Partial Views to work as an placed Macro, however a UserControl Macro placed in a .aspx template is working as expected.
I find this a very useful feature! Thanks to Mr. Bock for the detailed instructions.
Steve
is working on a reply...