Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dont work with Conditional fields (when:) #18

Open
besserdesign opened this issue Apr 15, 2021 · 0 comments
Open

dont work with Conditional fields (when:) #18

besserdesign opened this issue Apr 15, 2021 · 0 comments
Assignees
Labels
question Usage question

Comments

@besserdesign
Copy link

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?

@sylvainjule sylvainjule self-assigned this Nov 24, 2021
@sylvainjule sylvainjule added the question Usage question label Nov 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Usage question
Projects
None yet
Development

No branches or pull requests

2 participants