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 ?
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?
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.
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.
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 =)
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 ?
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?
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.
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.
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
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
is working on a reply...