A div around the list element would work. Do you edit that in WYSIWIG mode? When I highlight the list items in the editor and apply a style, I get something like this:
Ugh. Yeah, sometimes its tough to get the editor to apply the styles the way you want. If you are careful about how much you select and maybe include a line before and/or after the list, you might get it to work.
However, something as delicate as this might require you to step outside of the editor. Another approach I often use is to just have a standard list style for WYSIWYG editors and wrap the output in the view with a style. Obviously that limits your ability to have different list styles in the same editor. This would mean having a standard list in the editor and something like this in the view:
Just a heads up that the quotes in the JSON matter (I think Umbraco doesn't like it if you use unquoted JSON keys).
In my case, I was trying to make a UL have checkmarks rather than bullet points. If you also want the styles to appear in the back office, you can edit the CSS file that Umbraco creates for tinyMCE rich text editors to include the styles:
Remember that you'll have to configure your rich text data type to make use of that stylesheet.
There doesn't appear to be a tinyMceConfig file anymore, just a massive minified js file, and inserting an RTE format for 'ul.class-name' generates a ul tag with the class but no inner li tags.
Not very user friendly ^^;
Edit
Current way I've found to handle this that requires the least amount of knowledge and work for a non-savvy user is to use the 'ul.class-name' in the RTE styles for applying what you need to the ul tag. In my example, making the list two-column -- so you cannot have this on the li tags.
When editing have the editor use the regular UL button, type out their list, highlight it all after they're done & select the special style format from the dropdown.
This encapsulates the existing list with the special ul.class-name instead of putting the class on every li inside the list. It just requires the editor to then go into the Source tab and remove the plain ul /ul tags... ... or you could leave the improper html markup & style around this case so no one notices visually...
Noting this still is pretty ugly, especially for nested lists. It becomes an absolute mess if you try to do this with a list that has a nested list in it.
Rich Text Editor styles for lists
Is it possible to have a style in the Rich Text Editor apply directly to an list, such as:
I've found it exceedingly difficult to force a style to attach itself to a particular HTML element. Generally, you end up with something like:
I usually just update the CSS to accommodate:
A div around the list element would work. Do you edit that in WYSIWIG mode? When I highlight the list items in the editor and apply a style, I get something like this:
Ugh. Yeah, sometimes its tough to get the editor to apply the styles the way you want. If you are careful about how much you select and maybe include a line before and/or after the list, you might get it to work.
However, something as delicate as this might require you to step outside of the editor. Another approach I often use is to just have a standard list style for WYSIWYG editors and wrap the output in the view with a style. Obviously that limits your ability to have different list styles in the same editor. This would mean having a standard list in the editor and something like this in the view:
I have done this before by modifying
~/config/tinyMceConfig.config
like so:Just a heads up that the quotes in the JSON matter (I think Umbraco doesn't like it if you use unquoted JSON keys).
In my case, I was trying to make a UL have checkmarks rather than bullet points. If you also want the styles to appear in the back office, you can edit the CSS file that Umbraco creates for tinyMCE rich text editors to include the styles:
Remember that you'll have to configure your rich text data type to make use of that stylesheet.
Your solution worked like a charm Nicholas, thank you.
Stil works like a charm for Umbraco Version 8.17.1. Thank you Nicholas.
Is there some way to accomplish this for v9?
There doesn't appear to be a tinyMceConfig file anymore, just a massive minified js file, and inserting an RTE format for 'ul.class-name' generates a ul tag with the class but no inner li tags.
Not very user friendly ^^;
Edit
Current way I've found to handle this that requires the least amount of knowledge and work for a non-savvy user is to use the 'ul.class-name' in the RTE styles for applying what you need to the ul tag. In my example, making the list two-column -- so you cannot have this on the li tags.
When editing have the editor use the regular UL button, type out their list, highlight it all after they're done & select the special style format from the dropdown.
This encapsulates the existing list with the special ul.class-name instead of putting the class on every li inside the list. It just requires the editor to then go into the Source tab and remove the plain ul /ul tags... ... or you could leave the improper html markup & style around this case so no one notices visually...
Noting this still is pretty ugly, especially for nested lists. It becomes an absolute mess if you try to do this with a list that has a nested list in it.
is working on a reply...