Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Phillip Ng 148 posts 250 karma points
    Dec 10, 2011 @ 04:35
    Phillip Ng
    0

    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

  • Rodion Novoselov 694 posts 859 karma points
    Dec 10, 2011 @ 05:10
    Rodion Novoselov
    0

    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). 

  • Phillip Ng 148 posts 250 karma points
    Dec 10, 2011 @ 23:08
    Phillip Ng
    0

    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

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Dec 11, 2011 @ 00:05
    Jan Skovgaard
    0

    Hi Phillip...have you tried using umbraco.library:GetItem() to render your output?

    /Jan

  • Rodion Novoselov 694 posts 859 karma points
    Dec 11, 2011 @ 00:21
    Rodion Novoselov
    0

    Hi, Philip. So, am I right that for the moment the problem is to draw several macros as a <ul> list?

  • Phillip Ng 148 posts 250 karma points
    Dec 11, 2011 @ 00:49
    Phillip Ng
    0

    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.

     

     

     

  • Phillip Ng 148 posts 250 karma points
    Dec 13, 2011 @ 21:11
    Phillip Ng
    0

    This package wouldn't help me with the nested macro problem right? Thanks.

  • Phillip Ng 148 posts 250 karma points
    Dec 22, 2011 @ 03:29
    Phillip Ng
    0

    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:

    • 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!

  • Steve 140 posts 321 karma points
    Nov 12, 2014 @ 23:49
    Steve
    0

    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

  • Steve 140 posts 321 karma points
    Nov 13, 2014 @ 15:39
    Steve
    0

    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

     

Please Sign in or register to post replies

Write your reply to:

Draft