GithubHelp home page GithubHelp logo

sumanwebidigital / pimcore-plugin-dynamicdropdown Goto Github PK

View Code? Open in Web Editor NEW

This project forked from thomaskeil/pimcore-plugin-dynamicdropdown

0.0 0.0 0.0 220 KB

Adds an input element to pimcore that gets it's data from object contents

License: Other

JavaScript 70.46% PHP 27.36% CSS 2.18%

pimcore-plugin-dynamicdropdown's Introduction

Pimcore - Dynamic Dropdown

License Latest Stable Version

Dynamic Dropdown allows you to populate pimcore input fields with the content of other objcts.

Interface

Getting started

  • Download Plugin and place it in your plugins directory
  • Open Extension Manager in Pimcore and enable/install Plugin
  • After Installation within Pimcore Extension Manager, you have to reload Pimcore

or install it via composer on an existing pimcore installation

composer require thomas-keil/dynamic-dropdown

Configuring

The plugin doesn't require any configuration but provides several input elements. These input fields can be configured like any other of pimcore's input elements.

Usage

The plugin extends pimcores class data compent menu in the section "Select". Four new elements can be used:

  • Dynamic Dropdown: a single select dropdown menu Single select example

  • Dynamic Dropdown (multiselect): a box with several items to select. Select one by clicking it, all other will be deselected. Hold the CTRL-key while clicking to add the item without deselecting the others. Multiselect example

  • Itemselector: the items are displayed in two columns, on the left are the available (or remaining) items, on the right are the selected ones. Transfer to the other column by doubleclicking or using the left/right arrow button. Up/down arrow buttons arrange the order. Itemselector example

  • Superbox Select: Like a "tag field". Select one item and it get's displayed, click the little "x" next to it to remove it. Superbox Select example

Options

The options for all input elements are the same, only the way the information is presented differes.

Options

Following options need to be set:

  • Width: the width of input element
  • Parent ID: the path to the folder containing the source objects. You can use drag&drop
  • Recursive: check this if objects in subfolders shall be used as well
  • Unpublished selectable: usually unpublished objects will be displayed in the item list, but be of a grey color and unselectable. Check this if you want unpublished objects to be selectable. This option is currently only used by the single select dropdown!
  • Sort by: either "Value" or "Id". By value is alphabetically ascending, by Id is numerically ascending by pimcore's object id.
  • Allowed classes: the object class, that provides the data. Only objects of this class we be considered, all others will be ignored.
  • Method: the method that provides the data. The possible methods are extracted from the class definition of the source class.

Dynamic Dropdown

Dynamic Dropdown

The Dynamic Dropdown is the "classic" version of the provided input elements: a dropdown input field (ExtJS: Combobox). Every option is provided by an object in a configured folder, by a configured method. The folder can have nested subfolders, but only one type of object class can provide the data.

This input element extends pimcore's href element. Programatically, you can set it's value with the API like you'd do with a href.

Dynamic Dropdown (multiselect)

The multiselect Dynamic Dropdown is like the single select version, but you can select more than one item. It uses ExtJS' UX MultiSelect. It extends pimcore's multiselection. Setting it with the API is like working with a multiselection.

Itemselector

The Itemselector is like the Multiselect, but uses the ItemSelector as UI element.

SuperboxSelect

The SuperboxSelect is like the Multiselect, but uses the TagField as UI element.

Example

use Pimcore\Model\Object;
  
$myHrefElement = Document::getById(23);
$myOtherHrefElement = Document::getById(23);
 
$myMultihrefElements[] = $myHrefElement;
$myMultihrefElements[] = $myOtherHrefElement;
 
$myObjectsElements[] = Object\Product::getById(98);
$myObjectsElements[] = Object\Product::getById(99);
 
$object->setDynamicDropdown($myHrefElement);
$object->setDynamicDropdownMultiple($myMultihrefElements);
$object->setItemselector($myMultihrefElements);
$object->setSuperboxSelect($myMultihrefElements);
 
$object->save();

pimcore-plugin-dynamicdropdown's People

Contributors

thomaskeil avatar brusch avatar chrisjung-dev avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.