GithubHelp home page GithubHelp logo

sylvainjule / kirby-imageradio Goto Github PK

View Code? Open in Web Editor NEW
58.0 7.0 5.0 128 KB

Add illustrations to Kirby's radio buttons. Kirby 3 and 4.

PHP 71.10% JavaScript 3.40% Vue 20.73% SCSS 4.77%
kirby radio image illustrated illustration

kirby-imageradio's People

Contributors

s1syphos avatar schnti avatar sylvainjule avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

kirby-imageradio's Issues

Options dont get saved in blocks

I have a blueprint where I extend the (new in kirby 3.5) block type gallery like so:

  projectgallery:
    label: Gallery
    type: blocks
    fieldsets:
      gallery:
        extends: blocks/gallery
        fields:
          images:
            max: 3
          display:
            label: Display
            type: imageradio
            columns: 4
            ratio: 3/2
            gap: true
            fit: contain
            options:
              layout1:
                text: Layout 1
                image: layout1.svg
              layout2:
                text: Layout 2
                image: layout2.svg

it looks fine in the backend:

Bildschirmfoto 2021-02-08 um 09 04 29

but when I save, the display value doesnt get saved:
project.txt

----

Projectgallery: [{"content":{"images":["image_1.jpg"]},"id":"0ef7bf26-a46d-4465-b4fa-424c7f9928f3","isHidden":false,"type":"gallery"}]

----

imageradio in Blocks

Hey.

Thanks for this very helpful Plugin!

There seems to be a Problem with using it in Kirby Blocks. It simply gets not recognized as a radio field. In this case, I had to switch to the normal radio field.

Maybe you have an idea to fix this and make your plugin even more powerful.

[Kirby 3] Default value

I think a default value is missing from the Kirby 3 version. Or am I doing something wrong?

beverage:
  label: Beverage
  type: imageradio
  default: wine
  options: 
    beer:
      text: Beer
      image: beer.jpg
    wine:
      text: Wine
      image: wine.jpg

Using smaller thumbnails

Panel takes a long time to load with many large pictures.
The kirby files view uses 400px thumbnails. Perhaps the plugin can use this too.

screenshot 2017-09-28 08 51 04

Native multilang functionality

I think this is a really helpfull plugin, but when trying

text:
en: ...
de: ...

the text variable throws an error. am I doing something wrong? same for the checkbox plugin.

ERROR:
Undefined index: text in file: .../www/site/plugins/kirby-imageradio-master/lib/options/imageradio-options.php line: 69

line 69 would be:
'text' => $option['text'],

thanks in advance

dont work with Conditional fields (when:)

Hello, I would like to use the plugin as an alternative tab in the layout settings. For this I would like to use the Kirby Field Conditional "when:".

Example:

Color-Palette Field

changeTab:
  label: false
  type: background-palette
  columns: 2
  options:
    master:
      background: 'var(--bs-c_1st) url(/assets/backend/img/icon_1.svg)'
      tooltip: MASTER
    2nd:
      background: 'var(--bs-c_2nd) url(/assets/backend/img/icon_2.svg)'
      tooltip: 2nd
  default: master
  width: 4/12

Condotional Field:

 bgColor:
    extends: fields/backgroundColor
    label: Hintergrundfarbe ⇾ Layout
    help: "Element: Layout (.layout)"
    width: 1/2
    when:
      changeTab: 2nd

I adjusted the plugin a bit. My field type is called "background-palette". The color variable is now called Background in my adapted plug-in

It does not work to reference this field via another field (when :).
I need the value of the option (in the "value" array) in my Example "master"

The reason is probably the output as an array in the .txt file.

Is there a way to access the option or value via the condition field (when) within a blueprint?

Alternatively, I would like to change the plugin. Instead of an array, it should only store the "value" or option value. How can I solve this?

I apologize for my bad english. To be on the safe side, here is the text in German;)

Deutsch:

Hallo, ich würde das Plugin gerne als Tab Alternative in den Layout Einstellungen nutzen.

Hierzu möchte ich die Kirby Field Conditional "when:" nutzen.

Ich habe das Plugin etwas angepasst. Mein Feld-Typ heißt "background-palette". Die Variable Color heißt in meinem angepassten Plugin nun Background.

Es funktioniert nicht die dieses Feld über ein anderes Feld (when:) zu referenzieren. ​Ich benötige den Wert der Option (in Array "value") Bsp: master

Der Grund ist vermutlich die Ausgabe als Array in der .txt Datei.
Gibt es eine Möglichkeit auf den Wert -> value über die condition: when innerhalb eines blueprints zuzugreifen?

Alternativ würde ich das Plugin gern entsprechend abändern. Statt einem Array soll es nur den "value" bzw. option Wert speichern. Wie kann ich dies lösen?

text: option not work

Option like a text: "Pic: {{ file.filename }} Size: {{ file.modified('d Y') }}" — not work for me. I see only filename always 😕. Kirby 3.1.1

Class 'Kirby' not found in after Update to Kirby 3.0.3

Fatal error: Uncaught Error: Class 'Kirby' not found in .../vendor/sylvainjule/imageradio/config.php:3 Stack trace: #0 .../vendor/composer/autoload_real.php(66): require() #1 .../vendor/composer/autoload_real.php(56): composerRequiref500705cbefda5b7501a96695f683400('490010e42a89d95...', '/Users/tschneid...') #2 .../vendor/autoload.php(7): ComposerAutoloaderInitf500705cbefda5b7501a96695f683400::getLoader() #3 .../website/kirby/bootstrap.php(18): include('/Users/tschneid...') #4 .../website/index.php(3): require('/Users/tschneid...') #5 {main} thrown in .../vendor/sylvainjule/imageradio/config.php on line 3

Images aren't displayed

Hi there,

Thx for your work Sylvain.

I install the plugin but the images aren't displayed.

Here is my blueprint :
space: type: imageradio fit: cover label: Position des blocs columns: 4 default: options: space\-between: text: Justifiés image: justi.jpg center: text: Groupés au centre image: center.jpg space\-evenly: text: Espacés uniformément image: uni.jpg space\-around: text: Marges additionnées image: add.jpg

Files are placed in the "assets" folder and named exactly the same as in the blueprint.

Any idea ?

Trouble with imageradio type

Hi there!

I've just installed your plugin (which i think is pretty awesome i think :)) but when i put the folder renamed as imageradio in my plugins folder i get the next error:

"The imageradio field is missing. Please add it to your installed fields or remove it from your blueprint"

What am i doing wrong?

Thank you for your help!

Support for 'when:' and nesting inside kirby builder(?)

Hi,

On a side note I have to say that I've been quite impressed by all your plugins so far(!)

So I'm having small issues with the imageradio field. It seems like it does not work when hidden (so either with using the newer 'when' field property or either with putting an imageradio field inside a 'kirby builder').

When doing so, I end up with an error:
'Undefined index: text' (when used with 'when:')
'Undefined offset: 3' (when used inside a 'kirby builder' field)

Has anybody reproduced this?

I wanted to use the imageradio as it's more explicit for grid layout choices :(

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.