Copied to clipboard

Flag this post as spam?

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


  • Rik Helsen 670 posts 873 karma points
    Jul 05, 2010 @ 15:13
    Rik Helsen
    0

    Suggestions for having reusable content-snippets available in tinymce

    I have a client and he would like to be able to centrally manage some text snippets that contain information that appears throughout the site and changes frequently.

    something like "There are 17 partners involved", where the number changes every few months, and is present in quite a few pages...

    If i want to centrally manage the number (17) in the above example, inside content editors are there alternatives to using macro's ?

  • Tim 1193 posts 2675 karma points MVP 4x c-trib
    Jul 07, 2010 @ 17:48
    Tim
    1

    Some folks (myself included) occasionally make a separate section in Umbraco called "Settings" that contains several documents that just contain several sets of settings that can be edited using the Umbraco back office. These are normally just a few fields, say for example the footer copy (where a site has registered office etc in the footer), or the phone number for the company.

    You can then use the library to get the settings nodes by id in a macro and dumping out the contents. Not sure if that's what you're looking for?

  • David Conlisk 432 posts 1008 karma points
    Jul 07, 2010 @ 18:25
    David Conlisk
    1

    You could try using the dictionary. Create an entry for your number, e.g. NumberOfPartners, and in the English textbox enter 17. Give your users access to the dictionary section so that they can keep it updated. Then you can use the umbraco.library.GetDictionaryItem() function in your .NET user control or XSLT macro to retrieve the values as required.

    Hmm, on re-reading your question you seem to want the content editor to be able to access these items from within tinymce. I'm not sure that this is helpful in that case! You could try something like letting content editors use ##NumberOfPartners## in the content editor, which you then parse out when displaying it on the site and replace it with the value from the dictionary. Messy but it would work.

  • Rik Helsen 670 posts 873 karma points
    Jul 08, 2010 @ 14:23
    Rik Helsen
    0

    Thanks Tim & David,

    As i thought, there doesn't seem to be a better alternative than to use dictionary items or custom datatype in the content area and insert these in the page content using macro's... we still have to decide how we'll implement it exactly.

     

  • Matt Brailsford 4125 posts 22223 karma points MVP 9x c-trib
    Jul 08, 2010 @ 14:52
    Matt Brailsford
    0

    Hi Rick,

    Can't say how much dev it would be, but you could look in the source at how the umbraco macros integrate with TinyMCE and create another button "Placeholders". If you made it all event driven, you could hook up the event in an app base class and pass in a load of Key Values to be replaced, That would make it reusable, and handy for a lot of people.

    Again, doubt it would be easy, but would make a nice package =)

    Matt

  • Matt Brailsford 4125 posts 22223 karma points MVP 9x c-trib
    Jul 08, 2010 @ 15:02
    Matt Brailsford
    0

    Hi Rick,

    Checkout this package for an example of adding a custom button to TinyMCE

    http://our.umbraco.org/projects/wvd-media-tinymce-insert-embed-code

    Matt

Please Sign in or register to post replies

Write your reply to:

Draft