We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 18646
    • 106 Posts
    So I’ve added a custom selector to the CSS Selectors in the configuration named multi_column. The way it needs to work is like so:

    <ul class="multi_column">
    	<li>item 1</li>
    	<li>item2</li>
            <li>item2</li>
    </ul>


    The problem is, whenever I try to apply this to any list within the visual editor, I get this:

    <ul>
    	<li class="multi_column">item 1</li>
    	<li class="multi_column">item2</li>
            <li class="multi_column">item2</li>
    </ul>


    This class must be applied to the UL, not the LI’s. Any ideas how I could do this without having to recode the class? I need to this to be easy to apply though the visual editor. Thanks all!

    Regards,
    Matt
    http://www.thinkingishard.net/
      • 16183
      • 1,390 Posts
      Hi,

      Are you using wayfinder? How do your chunks (templates) look like, could you post them here?  If you are using wayfinder, it seems you are applying that class to the row items (li)..you need to apply them to the &outerTpl, and they should appear within the ul....I think that’s the problem, if am wrong you will get a better/correct answer  wink

      If you are not using wayfinder, what visual editor are you using?
        • 18646
        • 106 Posts
        No wayfinder here. This code is in the body of my pages. I set up a UL list with the unordered list icon in the visual editor, put a few list items in, then dropdown the styles menu and select my custom selector. And as I described in the above post, the class is being assigned to the li, not the ul.

        Regards,
        Matt
          • 16183
          • 1,390 Posts
          OK,

          What visual editor are you referring to, the modx document editor?
            • 18646
            • 106 Posts
            Yes, tinyMCE.
              • 16183
              • 1,390 Posts
              OK, I get you. I have never used TinyMCE to apply styles like that....If I need to do something like this I use the html tab of TinyMCE and edit the raw html. Have you tried that? I have just tried it and it works fine....created a list item in the visual editor, then switched to html and added a class to the <ul>. Am using modx 0.9.6.2, you?

              /k
                • 18646
                • 106 Posts
                Yes I understand that. I use the HTML view most of the time. The problem is my client doesn’t know HTML, nor are they expected to use the HTML tab. I need to apply the style to the UL in a front-end way. They will not be editing the source code.

                Regards,
                Matt
                  • 27708 MODX Staff
                  • 2,502 Posts
                  I’d be interested to know why you are leaving it up to the client to remember to do this. Is this multicolumn class something necessary to control layout? Will it be available on all pages?

                  My experience is never -ever let the client control layout and styles.

                  Do you have a link or screem cap? My own thought is to create a style using the cascade for all uls within the content space but if not all Uls wil have this there are ways to handle this without getting the user involved.
                  .
                    Author of zero books. Formerly of many strange things. Pairs well with meats. Conversations are magical experiences. He's dangerous around code but a markup magician. Blog ✦ Twitter ✦ LinkedIn ✦ GitHub
                    • 18646
                    • 106 Posts
                    Yes maybe I should clarify. I’ve already styled the generic UL element based on the website design. So that’s fine, when the user hits the unordered list icon, the list displays as I’ve defined it based on CSS.

                    The "multi_column" class is a two column unordered list. I want to have the dropdown styles menu apply to the UL element in order to create side by side bullet points without having to edit the HTML manually.

                    Like this: http://fu2k.org/alex/css/cssjunk/ListColumns.mhtml

                    So this class doesn’t have anything to do with template layout control. That’s all been locked away from the clients control. Hope this clears things up.

                    Regards,
                    Matt
                      • 27708 MODX Staff
                      • 2,502 Posts
                      I understand what.

                      Now under what circumstances would the client/user opt to use the .twocol etc.? Just so I can think of solution. There are so many ways to skin cat usually thinking about workflow/reasons makes answer easier to find.
                        Author of zero books. Formerly of many strange things. Pairs well with meats. Conversations are magical experiences. He's dangerous around code but a markup magician. Blog ✦ Twitter ✦ LinkedIn ✦ GitHub