• Resolved aztec91

    (@aztec91)


    Hey this is not a question, but I have an idea for a nice to have.

    Have you thought about conditions in custom blocks? That would be an awesome feature.
    You could hide / show elements in gutenberg editor.

    Greeting Aztec

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Contributor Ryan Kienstra

    (@ryankienstra)

    Hi @aztec91,
    Great idea, we have thought of that.

    What condition(s) would help you the most?

    Maybe ‘If x field is not empty, display this field’?

    Or ‘If x field has the value of y, display this field’?

    Or maybe something else?

    Thread Starter aztec91

    (@aztec91)

    Hey Ryan,

    thanks for your answer.

    Let me try to explain:

    lets assume I have an a simple image in my block.php (its set on position relative)
    in my block creator I have 2 Range fields. These fields controll the top and left value od the image.

    Now comes the Conditions part:
    I want to have for example a radio Button that has 2 options: “Move image / Dont move image”

    In the hirachy the radio button is before the 2 range fields. Only if I click “Move Image” the 2 Range fields appear (while editing in Gutenberg).

    It would be awesome to have these kind of Conditions… I hope my example was understandable. This way you could “unbloat” a lot of blocks with many different fields.

    And I have another idea:
    Me and my Teammates would love, if you could add simple html text or an h1 h2(in the block creator) that is not rendered in the final view. Its just so that you can seperate /stylize the fields for Gutenberg better.

    Thanks for the awesome Plugin and kind regards
    Aztec

    Plugin Contributor Ryan Kienstra

    (@ryankienstra)

    Hi @aztec91,
    Thanks, that’s a great example of displaying the 2 fields only if a radio button is selected.

    Are there other condition types that would help, in addition to that?

    Me and my Teammates would love, if you could add simple html text or an h1 h2(in the block creator) that is not rendered in the final view. Its just so that you can seperate /stylize the fields for Gutenberg better.

    Interesting, could you create a sketch of how that would look? Would it be like ‘help’ text for the entire block?

    Thread Starter aztec91

    (@aztec91)

    Hey Ryan

    Let me try to explain.

    When you create a Block you can choose between various options (Text / Radio /multi select and so on).

    It would be nice to have a seperate section in the dropdown menue. This section could Just contain custom HTML. Then you could have the posibility to style the Blocks better. This custom HTML will Not be rendered on the Frontend. This way you could have margins, Breaks and further explaination for the sections in your crested Block.

    Regards
    Aztec

    Plugin Contributor Ryan Kienstra

    (@ryankienstra)

    Hi @aztec91,
    Sorry for the delay!

    Ah, that makes sense. So it sounds like the Custom HTML could be any markup, including something like <style>.foo { color: red; }</style>

    Thread Starter aztec91

    (@aztec91)

    Yeah or something like :

    <h2>the following Radio Buttons controll the visbility</h2>
    --custom Block Radio buttons--
    <br>
    <h2>the following Text field will add a caption</h2>
    --custom Block textfield--

    But in the Frontend all the HTML wont be rendered Just in Gutenberg so you have a better overview.

    Greetings

    • This reply was modified 4 years, 1 month ago by aztec91.
Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Conditions’ is closed to new replies.