Support

Account

Home Forums ACF PRO Link values of multiple selects to text field from optionpage

Unread

Link values of multiple selects to text field from optionpage

  • Hi, i’m building an option where a client can set there option inside a call to action bar on top of a site.

    The client can fill some data like phonenumber, emailaddress, mobilephone and socials in an option page.

    Now I’ve created a multiple select field where the client can select the above named options. They’re just simple select options, no dynamic loading from they options page (would also be nice though..)

    the next thing is loading the selected options, but i would like load the phonenumber/emailaddres/mobile from the options page when some or mulitple are selected. Now i could make a simple if phonenumber is selected (), but then there’s no use for the drag & drop function inside the multiple select field. I would like to see the order of selected items to show up in this call to action bar.

    printscreens of my fields en settings
    Theme options
    fields
    field overview

    I have the following code:

    
    $cta_bar_options = get_field( 'cta_bar_options','option');
    $phonenumber = get_field('phonenumber','option');
    $mobilenumber = get_field('phonenumber','option');
    $emailaddress = get_field('emailaddress','option');
    
    <section id="ctabar" class="no-padding"  style="background-color: {{$cta_bar_bg_color}}; color: {{$cta_bar_text_color}};">
    		<div class="container">
    			<div class="row">
    				<div class="col-12 text-{{$cta_bar_alignment}}">
    					@if( $cta_bar_options )
    						<?php echo implode( ', ', $cta_bar_options ); ?>
    					@endif
    				</div>
    			</div>
    		</div>
    	</section>
Viewing 1 post (of 1 total)

The topic ‘Link values of multiple selects to text field from optionpage’ is closed to new replies.