Home › Forums › Add-ons › Flexible Content Field › Nested Flexible Content Field? › Reply To: Nested Flexible Content Field?
Same like Philipp Kuehn here, my code:
if (have_rows('content-formular')):
while (have_rows('content-formular')) : the_row();
if (get_row_layout() == 'content'):
?>
<img id="image2" style="float:<?php the_sub_field('imageposition'); ?>;" src="<?php echo wp_get_attachment_url(get_sub_field('image2')); ?>" />
<div class="subhead" style="margin-<?php the_sub_field('imageposition'); ?>: 51%;"><h2><?php the_sub_field('subheadline'); ?></h2></div>
<div id="text" style="margin-<?php the_sub_field('imageposition'); ?>: 51%;"><?php the_sub_field('text'); ?></div>
<div class="clearfix"></div>
<?php
elseif (get_row_layout() == 'form'):
if (have_rows('formfelder')):
while (have_rows('formfelder')): the_row();
if (have_rows('innerform')):
echo 'pups';
while (have_rows('innerform')): the_row();
?>
<form method="post" action="#">
<?php
if (get_row_layout() == 'name'):
?>
<label for="name">Vor- und Nachname</label>
<input type="text" name="name" />
<?php
elseif (get_row_layout() == 'e-mail'):
?>
<label for="email">E-Mail-Adresse</label>
<input type="text" name="email" />
<?php
elseif (get_row_layout() == 'code'):
?>
<label for="code">Code</label>
<input type="text" name="code" />
<?php
elseif (get_row_layout() == 'street'):
?>
<label for="street">Straße und Hausnr.</label>
<input type="text" name="street" />
<?php
elseif (get_row_layout() == 'zip'):
?>
<label for="zip">PLZ</label>
<input type="text" name="zip" />
<?php
elseif (get_row_layout() == 'city'):
?>
<label for="city">Wohnort</label>
<input type="text" name="city" />
<?php
endif;
?>
</form>
<?php
endwhile;
endif;
endwhile;
endif;
?>
<?php
endif;
endwhile;
endif;
?>
I’m not sure if the code helpes, otherwise just ignore it. The form isn’t even displayed.
My Site: http://dev.scavi-ray.npire.de/
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.