Support

Account

Forum Replies Created

  • Thank you, John! I’m well on my way now : D

    Just curious… it seems that I may have essentially built a Flexible Content field type via the Radio Button method described above.

    If I’ve got the Radio Button method working as intended is there any advantage to using the Flexible Content field instead for this linear sort of page building? Just the slight difference in interface would be my guess.

    Just asking for anyone else who may be in a similar situation looking at this thread.

    All the best!

  • Wow thank you! The explanation was very helpful and the example added a bit to my understanding of PHP and ACF. Very much appreciated.

    By your example of both ‘switch’ and ‘if’ method it looks that I may have solved the issue of content being repeated and retained in each row. However, I’m not able to actually to continue any further with this method without being able to assign an ID or class to each of the 4 potential radio button selections.

    The output is correct, but it needs a container and formatting.

    Is there anyway to integrate a <div> container to wrap around each of the options, or at least assign an ID or Class to each one?

    Example of what I have working now:

    if ($content_type == 'image') {
      the_sub_field('image_content');
    } 
    elseif ($content_type == 'wysiwyg') {
      the_sub_field('wysiwyg_content');
    } 
    elseif ($content_type == 'quote') {
      the_sub_field('text_content');
    } 
    elseif ($content_type == 'video') {
      the_sub_field('video_content');
    } 

    And example of what I’m trying to accomplish (I know this is incorrect, but this is my brute example):

    elseif ($content_type == 'video') {
      <div class="full-width">the_sub_field('video_content');</div>
    } 
  • I have just discovered an answer to my issue via:

    https://support.advancedcustomfields.com/forums/topic/repeater-radio-button-bug/

    However, since this is not defined as a true “bug” I am wondering if there is alternative way to approach this type of build anyone could possibly share with me?

  • Hi Porter

    I’ve found myself puzzling at the exact same experience. While I understand this particular scenario may not actually be a “bug” for ACF to address I am still wondering how you moved forward and handled the situation since what you described (and similarly what I have also built) was catering to a specific need of content building in the WordPress CMS.

    Is there a modified approach to this method? Or did you have to totally re-build this section?

    Thank you, looking forward to your response if this message is not lost in the wind…

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