blueriver / MuraConfiguratorExample

A very simple example of a Mura plugin with a per instance display object configurator.
http://getmura.com
Apache License 2.0
4 stars 3 forks source link

"available/selected fields" example #1

Closed guustnieuwenhuis closed 12 years ago

guustnieuwenhuis commented 12 years ago

Can you add an example of the "available/selected fields" used by Mura?

mattlevine commented 12 years ago

Can you provide a small description of the general use case. The general idea is that any form field in the configurator with a class of objectParam is serialized and provided to the display object method as a struct with $.event('objectParams').

guustnieuwenhuis commented 12 years ago

I would like to implement the following: https://skitch.com/lagaffe/8k2df/mura-cms-site-manager

I've tried copying the html code from the administrator, but I seem to be missing some javascript as I can't move the tiles.

guustnieuwenhuis commented 12 years ago

I believe adding some extra display objects with some different interface example (used by mura in the administrator) to this "plugin" would be very useful.

mattlevine commented 12 years ago

Here's the markup that is used with the local indexes"

    <p class="dragMsg"><span class="dragFrom">Drag Fields from Here&hellip;</span><span>&hellip;and Drop Them Here.</span></p>
  • #i#
  • #i#
```
``` You can see the file here: https://github.com/blueriver/MuraCMS/blob/develop/admin/view/vArchitecture/ajax/objectclass/dsp_feed_configurator.cfm ```
mattlevine commented 12 years ago

Here an example init method as well:

function initMyDisplayObject(data){
    initConfigurator(data,
        {
            url: '../plugins/myplugin/displayObjects/configurators/myDispayObject/configurator.cfm',
            pars: '',
            title: "Loading...",
            init: function(data,config){

                    if (jQuery("#availableListSort").length) {
                    jQuery("#availableListSort, #displayListSort").sortable({
                        connectWith: ".displayListSortOptions",
                        update: function(event){
                            event.stopPropagation();
                            jQuery("#displayList").val("");
                            jQuery("#displayListSort > li").each(function(){
                                var current = jQuery("#displayList").val();

                                if (current != '') {
                                    jQuery("#displayList").val(current + "," + jQuery(this).html());
                                }
                                else {
                                    jQuery("#displayList").val(jQuery(this).html());
                                }

                            });

                            updateAvailableObject();
                        }
                    }).disableSelection();
                }
                }
        }
        );

        return true;
    }
}
guustnieuwenhuis commented 12 years ago

Great, thank you!