Home › Forums › Add-ons › Flexible Content Field › Flexible Content Row Bookmarks › Reply To: Flexible Content Row Bookmarks
The hope was that ACF had something built in for bookmarks. Modifying templates requires more advanced knowledge and adds the risk of breaking other things, plus a template update (for non-custom themes) would lose the changes. The suggestion made by John only accounts for one section of the page, not multiple sections as a result of flexible content. – Thank you for the input, though.
I ended up creating a text field in my flexible content, so that I could define what would be used for the bookmark for each person’s content. I then modified the template to pull the text field’s content and apply it to the flexible content loop ID property. Fortunately our theme and templates are custom, so I don’t have to worry about losing changes in an update.
<?php
$staffname = get_sub_field('name');
$staffbiog = get_sub_field('bio');
$staffmark = '"' . get_sub_field('bookmark') . '"';
?>
<section class="block flex_detail" id=<?php echo $staffmark; ?>>
<article class="flexcon">
<div class="flexentry">
<header>
<h4><?php echo $staffname; ?></h4>
</header>
<?php echo $staffbiog; ?>
</div>
</article>
</section>
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.