Support

Account

Home Forums Add-ons Repeater Field Repeater / Checkbox / …

Solving

Repeater / Checkbox / …

  • Hi guys,

    I have huge problems getting things to our frontend 🙂

    1. (label)Kundenbezeichnung / (name)Kundenbezeichnung /(type)Text
    2. Anweisung / anweisung / Repeater
    2.1 Artikel / artikel / Select
    2.2 Anweisung / anw / Repeater
    2.2.1 Thema / thema / Select
    2.2.2 Art der Anweisung / artanweisung / Checkbox
    2.2.3 Maschine / maschine / Text
    2.2.4 Material / material / Text
    2.2.5 Text / text / Text Area
    2.2.6 Abteilung / abteilung / Checkbox
    2.2.7 Fotos / fotos / Repeater
    2.2.8 Daten / daten / Repeater
    2.2.9 PDF / pdf / Repeater

    Choices for Checkbox 2.2.6 are:
    fonts:Fonts
    material:Material
    street:Street
    country:Country

    Now what I need on my frontend:

    Check if any of those boxes 2.2.6 are checked and if so have a heading
    like <h1>Material</h1> and below list all upcoming entries with that specific value below showing all other field entries, like Artikel, Thema, Text, …

    Puuuuh. I am far far away from getting this done. I hope someone out there can help me to solve this.

    Thank you so much!

  • This reply has been marked as private.
  • Vielen Dank für die Hilfe! Ich komme nun erfolgreich voran, hänge aber an der Abfrage für 2.2.6…

    Wenn Checkbox FONTS ausgewählt ist, zeige folgenden Inhalt…
    Auch die Anleitung bringt mich leider nicht zum Ziel 🙁 Ne Idee?

  • Sorry für die späte antwort:
    bin ziemlich stark mit Arbeit ausgelastet, daher fehlt mir auch die zeit genauer auf dein Problem einzugehen.

    Die Hauptfrage ist: was passiert wenn 2.2.6 ausgewält ist?
    solange es nur auswirkungen auf 2.2.x hat ist es nicht sehr schwer.
    wenn es jedoch auswirkungen auf ausgaben im repeater darüber hat wird es kompliziert.

    because you use a checkbox inside a repeater it use sub_field.
    use this code inside your 2.2 repeater loop:

    //multi option checkbox
    if( in_array( 'fonts', get_sub_field('abteilung') ) )
    {
        //... 
    echo "fonts is checked";
    }
    //single option checkbox
    if(get_sub_field('abteilung') == 'fonts')
    {
        //... 
    echo "fonts is checked";
    }

    that should work and i hope that it help you to build what you like

    je nach dem was du genau vorhast, wäre es evtl. sinvoller das ganze anders aufzubauen. um das zu beurteilen fehlt mir jedoch die zeit (zudem wären zusätliche bzw. genauere angaben nötig)

Viewing 4 posts - 1 through 4 (of 4 total)

The topic ‘Repeater / Checkbox / …’ is closed to new replies.