Copied to clipboard

Flag this post as spam?

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


  • Nik Wahlberg 639 posts 1237 karma points MVP
    Sep 16, 2009 @ 14:09
    Nik Wahlberg
    0

    TinyMCE Template(s)

    Hi all,

    I have a need to provide 'canned' layouts for content editors. I certainly ues MasterPages and inheriting, but the layouts that I want to provide are snippets for boxes, callouts, tabular data, etc. I tried following this article in the Wiki:

    http://our.umbraco.org/wiki/how-tos/enabling-the-%27template%27-plugin-for-tinymce

    But, I am not sure that it is the complete set of instructions. It doesn't seem to make any difference when adding the changes suggested. I found the tempalte plugin instruction on WikiPedia. They are extensive and I was wondering if Umbraco has any of this 'built in'?

    Thanks all.

    -- Nik

  • Mikael Mørup 297 posts 326 karma points
    Sep 17, 2009 @ 09:48
    Mikael Mørup
    0

    I followed the instructions you link to, and the only problem i have had was that the extra stuff you have to put in the tinyMCE config file to describe the template files, need to be formatted in a special way to work.

    Also if you have your templates in a folder under wwwroot, you need to add that folder to UmbracoReservedPaths in web.config.

    But the button came up just as expected in the TinyMCE toolbar, and clicking it presents the dialog that lets you select a template.

     

    Mikael

  • Nik Wahlberg 639 posts 1237 karma points MVP
    Sep 25, 2009 @ 17:09
    Nik Wahlberg
    0

    Hmmm...can you share the config that you used for the tinyMCE file?Also, waht does your template file look like?

    Thanks,
    Nik

  • Mikael Mørup 297 posts 326 karma points
    Sep 25, 2009 @ 23:53
    Mikael Mørup
    0

    This was added to the <commands>  section:  


     <command>
          <umbracoAlias>Templates</umbracoAlias>
          <icon>images/editor/template.gif</icon>
          <tinyMceCommand value="" userInterface="true" frontendCommand="template">template</tinyMceCommand>
          <priority>75</priority>
     </command>


    this was added to the <plugins> section:

        <plugin loadOnFrontend="true">template</plugin>


    This is how my <customconfig> section looks:

    I have 3 very simple templates, thah just contains some <div> tags for styling 3 different coloumn layouts

    The way the linebreaks are positioned is VERY important:

    <customConfig>
        <config key="entity_encoding">raw',
          template_templates:[
          {
          title : "To spalter",
          src : "/tinytemplates/twocols.txt",
          description : "To spaltet layout"
          },
          {
          title : "Tre spalter",
          src : "/tinytemplates/threecols.txt",
          description : "Tre spaltet layout"
          },
          {
          title : "En spalte",
          src : "/tinytemplates/threecols.txt",
          description : "En spaltet layout"
          }],
          template_popup_height : '400</config>
      </customConfig>


    This is the entire contents of my 3 col template file:

    <div class="col31">
        
    </div>
    <div class="col32">
        
    </div>
    <div class="col33">
        
    </div>


    Remember to put the folder the templates are in in the umbracoReservedPaths key in web.config (in my case: wwwroot/tinytemplates)

    Hope this helps a bit

    Mikael

     

  • Mikael Mørup 297 posts 326 karma points
    Sep 25, 2009 @ 23:59
    Mikael Mørup
    0

    Forgot to mention that my template files are plain txt files, not HTML or ASPX. I don't know if that is important.

    Mikael

  • Nik Wahlberg 639 posts 1237 karma points MVP
    Sep 29, 2009 @ 18:35
    Nik Wahlberg
    0

    Awesome, thanks for clarifying. Will give this another shot.

    -- Nik

  • Jeroen Breuer 4908 posts 12265 karma points MVP 5x admin c-trib
    Jun 17, 2010 @ 16:31
    Jeroen Breuer
    0

    Hello,

    I did the same steps but nothing seems to be different. After adding shouldn't there be an extra button in TinyMCE to choose a template? I looked at the Richtext editor datatype and I can't select any extra buttons. I'm new to TinyMCE templates so I could be wrong about the extra button :).

    Jeroen

  • Jeroen Breuer 4908 posts 12265 karma points MVP 5x admin c-trib
    Jun 17, 2010 @ 16:53
    Jeroen Breuer
    0

    Already knew what I was doing wrong :). I didn't recycle the application pool / touch web.config to see the changes in the tinyMceConfig.config propogated. Updated the wiki with this message :).

    Jeroen

Please Sign in or register to post replies

Write your reply to:

Draft