Dropdown list for CSS Classes RRS feed

  • Question

  • I keep getting requests for this from clients.  I realize we can't show all the classes from a site, but having a new manifest field where I could add a comma delimited list of classes that I want to support in a particular account would be a big help.  

    Is this a possibility?



    Don Worthley
    Monday, February 23, 2009 3:32 PM

All replies

  • The only way you can do this right now would be to write a plugin or use a plugin like http://www.joecheng.com/code/DynamicTemplate/

    Though, I do think this experience is broken for people that understand HTML, and it is something I hope we can improve in the future.  Perhaps adding it to the manifest is a good solution. 
    -Brandon Turner [MSFT]
    Tuesday, February 24, 2009 1:13 AM
  • Just to think through what this would look like, what happens when you select one of these classes? Does it create a span or div around the current selection? Does it add a class to the existing block element that parents the selection? What happens if the selection spans multiple block elements, or just parts of some blocks?
    Tuesday, February 24, 2009 6:03 PM
  • Thanks for your reply Joe and Brandon.

    I would suggest parsing the selection and wrapping the pieces in span tags as needed.

    So, if you had content that looked like this:

    <p>First paragraph</p>
    <p>Second paragraph</p>

    And you selected like this:

    <p>First paragraph</p>
    <p>Second paragraph</p>

    The result would be this:

    <p>First para<span class="Highlighted">graph</span></p>
    <p><span class="Highlighted">Second pa</span>ragraph</p>

    This is what WLW is currently doing when I select text and click the B I  or U buttons on the toolbar. 

    I've suggested the dynamic template plugin, but many of my clients are looking for something that end users can use without requiring a plugin.

    Thanks for the great product and for considering this request!


    Don Worthley
    Wednesday, February 25, 2009 7:54 PM