Comments (5)
Maybe you can use only 2 options if 9 of 10 are the same?
Can you provide the option-type array so we can understand better why you need such functionality?
from unyson.
Sure, here we go:
'box_type_select' => array( 'type' => 'multi-picker', 'label' => false, 'desc' => false, 'picker' => array( 'box_type' => array( 'label' => __('Select type', 'fw'), 'type' => 'select', 'choices' => array( '' => __( 'Default (no icon)', 'fw' ), 'box-1' => __( 'Box-1 title', 'fw' ), 'box-2' => __( 'Box-2 title', 'fw' ), 'box-3' => __( 'Box-3 title', 'fw' ), 'box-4' => __( 'Box-4 title', 'fw' ), 'box-5' => __( 'Box-5 title', 'fw' ), 'box-6' => __( 'Box-6 title', 'fw' ), 'box-7' => __( 'Box-7 title', 'fw' ), 'box-8' => __( 'Box-8 title', 'fw' ), 'box-9' => __( 'Box-9 title', 'fw' ), ) ) ), 'choices' => array( 'box-1' => array( 'box_icon_anim' => array( 'type' => 'select', 'label' => __('Choose an animation icon', 'fw'), 'choices' => array( 'fw-icon-macbook' => __('Animation icon Macbook', 'fw'), 'fw-icon-browser' => __('Animation icon Browser', 'fw'), 'fw-icon-clock' => __('Animation icon Clock', 'fw'), ..... ) ) ), 'box-2' => array( 'box_icon' => array( 'type' => 'icon', 'label' => __('Choose an icon', 'fw'), ) ), box-3' => array( 'box_icon' => array( 'type' => 'icon', 'label' => __('Choose an icon', 'fw'), ) ), box-4' => array( 'box_icon' => array( 'type' => 'icon', 'label' => __('Choose an icon', 'fw'), ) ), box-5' => array( 'box_icon' => array( 'type' => 'icon', 'label' => __('Choose an icon', 'fw'), ) ), box-6' => array( 'box_icon' => array( 'type' => 'icon', 'label' => __('Choose an icon', 'fw'), ) ), box-7' => array( 'box_icon' => array( 'type' => 'icon', 'label' => __('Choose an icon', 'fw'), ) ), box-8' => array( 'box_icon' => array( 'type' => 'icon', 'label' => __('Choose an icon', 'fw'), ) ), box-9' => array( 'box_icon' => array( 'type' => 'icon', 'label' => __('Choose an icon', 'fw'), ) ), ), 'show_borders' => false, ),
from unyson.
I don't know how to solve this.
Maybe you have an idea how this can be done?
from unyson.
Hey @moldcraft ,
I wish I can do something like this:
'box_icon' => array( 'type' => 'icon', 'label' => __('Choose an icon', 'fw'), 'dependencies' => array( 'element' => 'box_type', 'value' => array('box-2', 'box-3', 'box-4', 'box-5', 'box-6', 'box-7', 'box-8', 'box-9') ) )
Hope this makes sense.
Anyway, you guys did a great work with this framework. Thanks so much !
from unyson.
Hello @raynguyen,
This is an interesting idea, for now you could store the repeating options into a variable and merge the multi-picker
choices
with it when you need to include them.
$price_option = array(
'price' => array(
'type' => 'text',
'label' => __('Price', 'fw'),
)
);
$options = array(
'demo' => array(
'type' => 'multi-picker',
'label' => false,
'desc' => false,
'picker' => array(
'gadget' => array(
'label' => __('Test', 'fw'),
'desc' => __('Test', 'fw'),
'type' => 'select',
'choices' => array(
'phone' => __('Phone', 'fw'),
'laptop' => __('Laptop', 'fw')
),
)
),
'choices' => array(
'phone' => array_merge(
$price_option,
array(
'memory' => array(
'type' => 'select',
'label' => __('Memory', 'fw'),
'choices' => array(
'16' => __('16Gb', 'fw'),
'32' => __('32Gb', 'fw'),
'64' => __('64Gb', 'fw'),
)
)
)
),
'laptop' => array_merge(
$price_option,
array(
'webcam' => array(
'type' => 'switch',
'label' => __('Webcam', 'fw'),
)
)
),
),
'show_borders' => false,
),
);
You will have to chose from generating the choices
via code (like in the example above or some tricky foreach
loop) or just stick with copy pasting the options for now.
Hope this helps and thank you for your contribution.
from unyson.
Related Issues (20)
- Request failed. Error code: 403
- Menus Disappeared HOT 1
- Version 2.7.28
- Patch for v2.7.28 to fix missing capability checks HOT 54
- Access violation vulnerability HOT 4
- Something went wrong with the plugin API HOT 4
- Plugin contains an unpatched security vulnerability HOT 4
- Unable to Install Unyson demo content HOT 4
- Unyson is not working with php 8.0 HOT 1
- DEMO CONTENT IS NOT INSTALLING ON USING UNYSONS HOT 3
- Unable to install demo content plugin HOT 3
- Unyson Fork - slowing website
- obsolete front page displayed HOT 1
- Cant EDIT Wordpress pages
- Unyson removed from wordpress.org HOT 2
- Notice: Undefined variable: Solution
- Cant install demo content plugins faulty HOT 2
- The site structure is broken HOT 2
- Is Unyson a no longer a supported product? HOT 1
- SSL Access Violation
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from unyson.