David Peck (Peck Tech)
05/22/2024, 12:44 PM<ul />
needs a class to do that.
Using an RTE stylesheet I don't appear to be able to achieve this. I might end up adding a block inside my RTE, which I don't love.
I'm sure this used to be possible by setting the stylesheet selector as ul.green
but this wraps an additional <ul />
around my original one. Just .green
puts ``s inside my ``s.
TIAMobyDog
05/22/2024, 1:49 PMDavid Peck (Peck Tech)
05/22/2024, 2:40 PMuseAlternativeListStyle
property. However it's not intuitive and styles all lists in the block in the same way. I'd love to find a solution within the RTE UI but I don't know as one exists.Jason
05/22/2024, 10:21 PMDean Leigh
05/23/2024, 12:48 PMDean Leigh
05/23/2024, 12:50 PMDean Leigh
05/23/2024, 12:51 PMLamont
05/23/2024, 1:54 PMDean Leigh
05/23/2024, 2:05 PMDavid Peck (Peck Tech)
05/23/2024, 2:06 PMul.red
as the selector is what should be the solution. However in your example it creates no <li />
tags, and it you apply it to a list then it adds an extra <ul />
wrapping the existing one. As @Lamont points out, this then requires some HTML coding. If they're doing that then they might as well add the class themselves.
Adding the option to the list type would be πͺπ», but I don't see an option in the Advanced List plugin to allow that. I think we're probably stuck with workarounds, but it was worth posting in case someone had a solution.Dean Leigh
05/23/2024, 2:07 PMJason
05/23/2024, 2:50 PMDean Leigh
05/23/2024, 3:15 PMDean Leigh
05/23/2024, 3:17 PM"RichTextEditor": {
"CustomConfig": {
"style_formats": "[{\"title\": \"Headers\", \"items\": [{ \"title\": \"Header 2 (H2)\",\"block\": \"h2\"},{\"title\": \"Header 3 (H3)\",\"block\": \"h3\"}]},{\"title\": \"Languages\",\"items\": [{\"title\": \"English\",\"inline\": \"span\",\"attributes\": { \"lang\": \"en\" }},{\"title\": \"Japanese\",\"inline\": \"span\",\"attributes\": { \"lang\": \"ja\" }},{\"title\": \"Chinese\",\"inline\": \"span\",\"attributes\": { \"lang\": \"zh-Hans\" }}]}]"
}
}
Jason
05/23/2024, 3:22 PMDavid Peck (Peck Tech)
05/23/2024, 3:55 PMDavid Peck (Peck Tech)
05/23/2024, 4:18 PM<li><div class="green">foo</div></li>
but if you create the container first then you can add a UL in it.
https://cdn.discordapp.com/attachments/1242820269517832203/1243236526335459371/image.png?ex=6650bdbe&is=664f6c3e&hm=f1e3ca186336677cd19877d566fe6ffc283711029fae7d29a375109f616412d0&
https://cdn.discordapp.com/attachments/1242820269517832203/1243236526683459706/image.png?ex=6650bdbe&is=664f6c3e&hm=0c32de575ee3e1c029044c95e2b524855176a900a36cff98c76ee181c09d10b8&David Peck (Peck Tech)
05/23/2024, 4:18 PMDan
05/23/2024, 4:31 PM"RichTextEditor": {
"CustomConfig": {
"style_formats": "[{\"title\":\"Lists\",\"items\":[{\"title\":\"Alternative List\",\"selector\":\"ul\",\"classes\":\"alternative\"}]}]"
}
}
I tend to group my formatting styles into 'Headings', 'Paragraphs', 'Images' etc, as it just makes for a clearer editing experience, like this:
"RichTextEditor": {
"CustomConfig": {
"style_formats": "[{\"title\":\"Headers\",\"items\":[{\"title\":\"Heading 2\",\"block\":\"h2\"},{\"title\":\"Heading 3\",\"block\":\"h3\"},{\"title\":\"Heading 4\",\"block\":\"h4\"},{\"title\":\"Heading 5\",\"block\":\"h5\"}]},{\"title\":\"Paragraphs\",\"items\":[{\"title\":\"Intro\",\"block\":\"p\",\"classes\":\"intro\"}]},{\"title\":\"Lists\",\"items\":[{\"title\":\"Alternative List\",\"selector\":\"ul\",\"classes\":\"alternative\"}]}]"
}
}
The key with ol/ul elements is to use selector: ul
in the config, rather than block: ul
(which, similar to Dean's suggestion above prevents li
elements from being added as children). It does mean that the block you're wanting to style needs to be a ul
before you can select the style (i.e. the content editor needs to make it a list using the list button first) which might be a showstopper for you, but it's the only way I can think of doing it without something custom or a little hacky, and it seems reasonable to me. πDean Leigh
05/23/2024, 4:33 PMJason
05/23/2024, 4:37 PMDavid Peck (Peck Tech)
05/23/2024, 4:37 PMDean Leigh
05/23/2024, 4:50 PMDean Leigh
05/23/2024, 4:52 PMDavid Peck (Peck Tech)
05/23/2024, 5:54 PMDan
05/31/2024, 3:11 PMBjarne Fyrstenborg
06/17/2024, 10:59 AMDan
06/17/2024, 1:50 PMBjarne Fyrstenborg
06/17/2024, 1:58 PMformats
and templates
properties under CustomConfig
it would be even cooler π
https://cdn.discordapp.com/attachments/1242820269517832203/1252260990058496111/image.png?ex=6671926d&is=667040ed&hm=5bcb50058ca5141756764c486c9ce26c67ac6558acee93bdcbb8c1bab9110fdd&Dan
06/17/2024, 2:12 PMformats
but saw that documented (https://www.tiny.cloud/docs/tinymce/latest/user-formatting-options/#interactive-examples) β I hadn't actually tried out whether that works in Umbraco but good to know it does. Not sure what you mean by templates though?Bjarne Fyrstenborg
06/17/2024, 9:13 PM"RichTextEditor": {
"CustomConfig": {
"formats": "{\"cite\":{\"block\":\"cite\"}},\"checklist\":{\"block\":\"ul\",\"classes\":\"check-list\"},\"arrowlist\":{\"block\":\"ul\",\"classes\":\"arrow-list\"},\"numberlist\":{\"block\":\"ol\",\"classes\":\"number-list\"}",
"style_formats": "[{\"title\":\"Paragraph\",\"format\":\"p\"},{\"title\":\"Blockquote\",\"format\":\"blockquote\"},{\"title\":\"Cite\",\"format\":\"cite\"},{\"title\":\"Code\",\"format\":\"code\"},{\"title\":\"Headers\",\"items\":[{\"title\":\"Heading h1\",\"block\":\"h1\"},{\"title\":\"Heading h2\",\"block\":\"h2\"},{\"title\":\"Heading h3\",\"block\":\"h3\"},{\"title\":\"Heading h4\",\"block\":\"h4\"},{\"title\":\"Heading h5\",\"block\":\"h5\"},{\"title\":\"Heading h6\",\"block\":\"h6\"}]},{\"title\":\"Checkmark list β\",\"format\":\"checklist\"},{\"title\":\"Arrow list β\",\"format\":\"arrowlist\"},{\"title\":\"Number list β\",\"format\":\"numberlist\"}]",
"templates": "[{\"title\":\"Checkmark list\",\"description\":\"Unordnered list with checkmark bullets\",\"url\":\"/App_Plugins/MCB.Umbraco.RTE/Templates/unordered-list-checkmark.html\"},{\"title\":\"Arrow list\",\"description\":\"Unordnered list with arrow bullets\",\"url\":\"/App_Plugins/MCB.Umbraco.RTE/Templates/unordered-list-arrow.html\"},{\"title\":\"Number list\",\"description\":\"Ordnered list with numbers\",\"url\":\"/App_Plugins/MCB.Umbraco.RTE/Templates/ordered-list-number.html\"}]"
},
"Commands": [
{
"Alias": "blockquote",
"Name": "Blockquote",
"Mode": "Selection"
},
{
"Alias": "template",
"Name": "Template",
"Mode": "All"
}
],
"Plugins": [
"template"
]
}
Bjarne Fyrstenborg
06/17/2024, 9:17 PM<ul>
and <ol>
lists with a CSS class and 6 items by default, but it can be used to scaffold a table layout or other HTML markup.
The formats are used to set format (class) on existing inserted lists.A hub and casual space for you to interact with fellow community members and learn more about Umbraco!
Powered by