Copied to clipboard

Flag this post as spam?

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


  • Daniel Horn 319 posts 344 karma points
    Dec 15, 2010 @ 11:26
    Daniel Horn
    0

    Letting the RTE autostyle text?

    Would it be possible for the RTE to autoset style to Headline (H1) on first-child ?

    It would be possible if you could insert a javascript file which could run in the backend (RTE) - but is that possible?

  • Tom Fulton 2030 posts 4998 karma points c-trib
    Dec 15, 2010 @ 14:45
    Tom Fulton
    0

    I think you could inject the javascript using a custom datatype added to that doctype, not sure how well it would work though.

    In a past project I used the Standard Values package to automatically insert <h1>...nodeName....</h1> into the RTE, might be an alternative?

  • Magnus Eriksson 122 posts 362 karma points
    Dec 15, 2010 @ 15:32
    Magnus Eriksson
    0

    Just curious, why would you want to have the h1 in the RTE and not in a separate field/property?

    Regards,
    Magnus

  • Daniel Horn 319 posts 344 karma points
    Dec 15, 2010 @ 15:51
    Daniel Horn
    0

    Tom: Not the prettiest solution :), but thanks.

    Magnus: To make the backend even more userfriendly so it will have the same styling and setup as the page has, and so that you don't have to manually select the styles on the text :)

    It's working in the backend but we have to make it work also in the frontend, we need to tweak tinymce somehow.

  • Magnus Eriksson 122 posts 362 karma points
    Dec 15, 2010 @ 16:00
    Magnus Eriksson
    0

    Yeah, I understand why you would like to autostyle the h1 if you have it in the RTE, but what I don't get is why you would place it in the RTE in the first place. I usually keep my h1 separate from the RTE/bodyText since it will (1) always be displayed and (2) almost always be placed at the same place on every page and (3) I would need it as a separate property for displaying it in news lists, site maps etc. This is how my templates usually look like:

    <h1><umbraco:Item runat="server" field="header" useIfEmpty="pageName" /></h1>
    <umbraco:Item runat="server" field="bodyText" />

    Regards,
    Magnus

  • Rich Green 2246 posts 4008 karma points
    Dec 15, 2010 @ 16:11
    Rich Green
    0

    I agree with Magnus here, unless there's a specific reason?

  • Daniel Horn 319 posts 344 karma points
    Dec 15, 2010 @ 16:28
    Daniel Horn
    0

    Magnus: Yes, thats the way we normally do it - but in this case the customers wanted a very userfriendly backend - so they are partly using canvas and then everything is in one RTE in each page, they can't skip the header and they can see how it looks right away.

    They explicitly told us not to have a lot of boxes to fill in - they have had umbraco before, so thats mainly why we want it :)

Please Sign in or register to post replies

Write your reply to:

Draft