Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Funka! 398 posts 661 karma points
    Sep 27, 2012 @ 04:04
    Funka!
    0

    Customizing the Widget Grid

    Hey this package looks great, thank you! I have hoped for a more visual data type for certain sites dealing with grids like this and I like how you setup the templating to allow this so easily.

    My question is two-fold: first, are there any plans to release the source code, so others may learn from your awesomeness and/or tweak it to suit their needs? And second, is there anyway to set a limit on the number of widgets picked in any particular cell? (For example, I'd like the user to pick only one in certain places---perhaps in this case even changing the "Add" button to just "Choose", or otherwise just allow a cap to be set on any cell and don't allow adding beyond that limit.)

    Best regards!

  • Matt Brailsford 4125 posts 22223 karma points MVP 9x c-trib
    Sep 27, 2012 @ 09:21
    Matt Brailsford
    2

    Hey Funka,

    I'm glad you like it.

    You can find source code over on bitbucket at the following location:

    https://bitbucket.org/mattbrailsford/widget-grid/src

    Regarding limiting the number of widgets within a grid, this is something I planned to add. My thought was that you would add a data-max="5" attribute to the table cells in the prevalue editor and it would prevent you from adding / dragging in more elements than allowed. I haven't gotten round to implementing it yet, but it's definitely something I want to add.

    Cheers

    Matt

  • Chriztian Steinmeier 2800 posts 8790 karma points MVP 8x admin c-trib
    Sep 28, 2012 @ 18:34
    Chriztian Steinmeier
    1

    I had the exact same idea (using data-attributes) for extending... one thing that would be killer, would be to enable multiple pickers, e.g.:

    <table>
        <tr>
            <td colspan="2" id="banner" data-picker="banner-picker">
                <p>(Banner up here)</p>
            </td>
            <td width="100" rowspan="2" id="sidebar" data-picker="widget-picker" data-max="4">
                <p>(Up to 4 widgets over here)</p>
            </td>
        </tr>
        <tr>
            <td width="25"></td>
            <td></td>
        </tr>
        <tr>
            <td colspan="3" id="footer" data-picker="address-picker">
                <p>(Address widget in here)</p>
            </td>
        </tr>
    </table>

     

    And then have the Editor pick up that there are 3 different picker ids - providing a dropdown (like the on already present) for each of them. Woohoo... :)

     

    /Chriztian

  • Funka! 398 posts 661 karma points
    Sep 28, 2012 @ 19:46
    Funka!
    0

    If we really wanted to get super-crazy, it would be great to be able to have other types of inputs in certain cells, such as textboxes and textareas and richtext editors!

    Of course this might start to outgrow what the Widget Grid is doing now, which is as a single datatype/single property on a document. Another related idea is maybe something where we could organize any number of other regular properties into custom layouts or grids like this of our choosing. So instead of properties always being stacked vertically, the ability to arrange them in a grid like this (or floating divs, or whatever) might give the developer a bit of extra flexibility for making more intuitive and visual backends for the editors. (Like positioning a sidebar truly to the side of the main content.) Just some thinking/rambling here.

  • Funka! 398 posts 661 karma points
    Sep 28, 2012 @ 19:49
    Funka!
    0

    Chriztian's comment about allowing diferent MNTPs for the different cells, means you wouldn't need to support the "data-max" attribute---since you could just set this limit on the MNTP itself!  (I guess you might still want the data-max however if using regular picker instead of MNTP.)

    Thanks again!

Please Sign in or register to post replies

Write your reply to:

Draft