Currently you can create a Stylesheet Property to format a text selection as a H2, or apply a class to it (e.g. .redHeader) but not both unfortunately. For some reason the RTE insists on applying class-based styles to span elements and won't allow Stylesheet Properties that have an alias combining an element and a class to be applied.
For example, you could do this:
Property 1 Alias: H2
Property 2: Alias: .redHeader
Both of the above are valid, the following is not:
Property 3: Alias: H2.redHeader
Having said that, you can apply both rules to the Heading to achieve the desired result; almost. By applying both Property 1 and Property 2 to the same element, I get the following HTML:
Heading 1
Hope this helps...
Rob.
Edit: It looks like you've already figured that one out... In thinking about it, it looks to me like it may be a shortcoming of the Umbraco RTE style plugin - perhaps it should be reported as a feature request in the issue tracker...
RTE - How to have multiple h2 tags?
I'm trying to add custom formats to TinyMCE but can't figure this out:
My site has 2 different h2's on it, each slightly different. In Umbraco 7 I can create the style for the default h2 but how can I create more than 1?
My css on the front end is like:
h2 { standard h2 rules here }
h2.other { different rules }
I can create a css rule that makes it look like the "other" one, but it renders it as a span whereas I want it rendered as either:
< h2 >blah
or
< h2 class="other" >
Hi IanS and welcome to our :)
Why do the two
<h2>
headers need different styling? And how do they differ? Is it by color, size or something else?Looking forward to hearing from you.
/Jan
Hi Jan,
It's by color yes.
Hi Ian,
Currently you can create a Stylesheet Property to format a text selection as a H2, or apply a class to it (e.g. .redHeader) but not both unfortunately. For some reason the RTE insists on applying class-based styles to span elements and won't allow Stylesheet Properties that have an alias combining an element and a class to be applied.
For example, you could do this:
Property 1
Alias: H2
Property 2:
Alias: .redHeader
Both of the above are valid, the following is not:
Property 3:
Alias: H2.redHeader
Having said that, you can apply both rules to the Heading to achieve the desired result; almost. By applying both Property 1 and Property 2 to the same element, I get the following HTML:
Hope this helps...
Rob.
Edit: It looks like you've already figured that one out... In thinking about it, it looks to me like it may be a shortcoming of the Umbraco RTE style plugin - perhaps it should be reported as a feature request in the issue tracker...
Thanks a lot for the help Rob, it's been driving me up the wall!
is working on a reply...