Copied to clipboard

Flag this post as spam?

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


  • Andreas Pfanner 196 posts 314 karma points
    Apr 13, 2011 @ 18:03
    Andreas Pfanner
    0

    Multiple sites + Rich text editor styles

    Hi,

    I have a site in my umbraco installation, where I set the site stylesheet as "Related Stylesheet" for the Rich Text Editor data type. So content is appearing the rich format on RTE.

    Well, if I add an additional site to the same installation with its own, independant style sheet, and it's own document types, I have to duplicate the RTE data type to use the different style sheet for the new site's RTE fields. When adding several sites, I have to add several RTE data types, which are identical apart from the style sheet applied to it. 

    Is there a more elegant way to solve this, without adding x copies of the RTE data type?

    Best Regards

    Andreas

  • Jan Skovgaard 11280 posts 23678 karma points MVP 10x admin c-trib
    Apr 13, 2011 @ 19:07
    Jan Skovgaard
    0

    Hi Andreas

    If I understand your post correctly you use the same styles in the dropdown, but you need them to appear differentli on each site, correct?

    Because then it should really be a matter of using the same RTE on all sites with the same stylesheet attached.

    Then you could look into giving the root element in your html source (The <html> element) and id, which could be id="domain-com" so every site has a unique id. This can be either hardcoded or done dynamically. It depends how you want it to work.

    But by having an id on the <html> element you can use the same styles etc. and just use #domain-com h1{color:#0000FF} in the stylesheet.

    Does this suggestion make sense to you?

    /Jan

  • Andreas Pfanner 196 posts 314 karma points
    Apr 14, 2011 @ 10:03
    Andreas Pfanner
    0

    Hi Jan,

    thanks for your reply.

    No, every site has its own style sheet, and editing contents for a specific site in TinyMCE should use the site's style sheet.
    To achieve that, I need to add a RTE data type for each site, select the specific style sheet for it, and assing the specific data type to the site's document types:

    Style Sheets:
    Site1.css

    Site2.css

    DataTypes:
    Rich text editor Site 1
    Related Stylesheets: Site1.css

    Rich text editor Site 2
    Related Styleheets: Site2.css

    Document Types:
    Site1 Textpage:
    body (Rich text editor Site 1)

    Site 2 Textpage
    body (Rich text editor Site 2)

    This way it works, but having many sites, many copies of the RTE data type are necessary, which is not very elegant I guess.. Is it nevertheless the way to go in Umbraco, or is there an alternative approach?

  • Jan Skovgaard 11280 posts 23678 karma points MVP 10x admin c-trib
    Apr 14, 2011 @ 22:35
    Jan Skovgaard
    0

    Hi Andreas

    Is the content in the Site1.css and Site2.css identical?

    Do you have

    h1,h2,h3,h4,h5,h6 etc. in both of them?

    If so...I think you should reconsider the approach I suggest above and then move those styles from site1.css and site2.css into your style.css or whatever your general stylesheet is called.

    In there you can have default styling of h1-h6 and then using the #site-id id you can overwrite the headings dependant on the site. This way you don't need to make different RTE's to be able to style the elements uniquely.

    Otherwise I'm not sure I fully understand your issue.

    /Jan

  • Andreas Pfanner 196 posts 314 karma points
    Apr 15, 2011 @ 10:23
    Andreas Pfanner
    0

    Hi Jan,

    The sites should be completely independant from each other, so I would like to have separate .css files (their contents could differ completely). 

    So I guess then its necessary to create separate data types for each site, right? What I would need to avoid that is a possibility to override data type settings on document type level. Then I could use the same data type when defining the different document types (for each site), and just set the parameter which differes there (in that case related style sheet) on document type level (not data type level).. Would be a cool feature, wouldn't it?


    Best Regards

    Andreas

  • Daniel Bardi 927 posts 2562 karma points
    Apr 15, 2011 @ 10:28
    Daniel Bardi
    0

    Why not have to separete Umbraco installations?

  • Andreas Pfanner 196 posts 314 karma points
    Apr 15, 2011 @ 12:34
    Andreas Pfanner
    0

    Hi Daniel,

    Thanks for your suggestion.

    Is that really the desired approach, even if there are several sites to manage? Isn't Umbraco thought as multi-site environment? I thought it is, and I would find it a bit hard to maintain several separate installations (updates etc.)?!

    Best Regards
    Andreas

  • Stewart Ellis 25 posts 64 karma points
    May 10, 2011 @ 18:45
    Stewart Ellis
    0

    I'm looking at a situation identical to Adreas' and would love to get some input from a veteran umbraco user.

    Thanks

    Stewart

  • Jan Skovgaard 11280 posts 23678 karma points MVP 10x admin c-trib
    May 10, 2011 @ 22:50
    Jan Skovgaard
    0

    Hi Andreas

    It should not be neccesary to run the multiple installations to have multiple different designed sites, which can reuse the different macroes etc.

    I'm not sure how I can explain this in a clearer way than I have tried to in the above...which frustrates me a bit since I'm sure that we're not far from the goal here...

    But since the two sites should be independant I guess you would create a different set of templates for the sites?

    Otherwise you could make an xslt file where you place the links to your CSS files and make a check to see, what nodeid your root note has. If it's site A, use CSS for site A, if it's site B use CSS for site B. Does it make sense? This way you should be able to reuse the templates if the content structure is the same.

    Regarding tinyMce you should really be able to only have ONE RTE stylesheet where you declare the styles that should be listed in the RTE. Now the trick is to NOT add the styling for the RTE elements on the different styles you have created in the stylesheets folder in the settings section. Instead you handle the styling in your external stylesheet. This of course does not make the styling visible inside the Rich text editor, which can possible be a drawback dependent on the content editors understanding of what is going on...

    Does this explanation make sense, or am I missing something totally? :-)

    /Jan

  • Andreas Pfanner 196 posts 314 karma points
    May 16, 2011 @ 17:41
    Andreas Pfanner
    0

    Hello Jan,

    thanks again for the explanation, but unfortunately it IS required to make the different styles (depending on the site) visible inside the Rich Text Editor. It should be real WYSIWYG for the editors. If Site1 uses pink headlines, they should appear pink in RTE when editing a Site 1 content and so on...

    Best Regards,
    Andreas

  • Rich Green 2246 posts 4008 karma points
    May 16, 2011 @ 17:48
    Rich Green
    0

    Hey Andreas,

    I think you will be better off with separate installs.

    Although Umbraco does support 'Multi Sites' in practice (IMO) this should only be used for sites that are very closely related (multi-lingual sites).

    There are too many problems with trying to acheive what you are trying, for example there's no recycle bin if you have the start nodes set to a specific site, macros rendered in RTE's are global across each site, teh problems you are having etc.

    Rich 

  • Jan Skovgaard 11280 posts 23678 karma points MVP 10x admin c-trib
    May 16, 2011 @ 18:08
    Jan Skovgaard
    0

    Hi Andreas

    Yes, you're right about that. Totally forgot about this because I was so eager to come up with a solution. Obviously it's not 100% bulletproof...

    I'll keep you posted if I find a usefull approach on how to solve this (If there is any).

    /Jan

  • Mark Mitchell 35 posts 60 karma points
    Feb 19, 2012 @ 00:05
    Mark Mitchell
    0

    I think it would be great if we could over-ride RTE stylesheet on the document type node or even better on the property level.  I am trying to find a better way to address similiar issues and this is just for a single site install. The site has a couple different major sections that have different styles applied to common elements such as p, h1, li, etc.

    Even if we could just apply a custom class name / filter to the html in the RTE at the property level it would help a lot. I also have a couple document types for more complex page layouts with several rich text editors (one per tab) so that they can edit the text in several predefined divs in the template. The font size & colors are drastically different in each of those divs. It makes getting a nice WYSIWYG experience from the RTE very difficult, which is kind of the whole point of the RTE. : (

     

     

Please Sign in or register to post replies

Write your reply to:

Draft