Forums Forums Search & Filter Pro ACF Link field shows title and link on dropdown (opened)

Viewing 8 posts - 1 through 8 (of 8 total)
  • Anonymous
    #273575

    Hi,

    Following closed topic: https://support.searchandfilter.com/forums/topic/acf-link-field-shows-title-and-link-on-dropdown/#post-273222

    The first time, as I commented on previous post, I could remove the “no-title” options, but if I open the dropdown again, other options are showed… I understand this is no correct way to do this.

    Could you help me, please?

    Access on next private post.

    Thanks!

    Best,

    Anonymous
    #273576
    This reply has been marked as private.
    Anonymous
    #273585

    Hi again,

    I’m using this:

    $(document).ready(function() {
    $(“[name=’_sfm_post_project[]’] option[value^=’http'”).remove();
    $(“[name=’_sfm_post_project[]’] option[value=’_blank”).remove();
    $(“[name=’_sfm_post_project[]’] option[value=’#'”).remove();

    });
    (function ( $ ) {
    “use strict”;
    $(document).on(“sf:ajaxfinish”, “.searchandfilter”, function(){
    $(“[name=’_sfm_post_project[]’] option[value^=’http'”).remove();
    $(“[name=’_sfm_post_project[]’] option[value=’_blank”).remove();
    $(“[name=’_sfm_post_project[]’] option[value=’#'”).remove();
    });
    }(jQuery));

    And now it works fine … but I wonder if there is another more “elegant” way to do it.

    Thanks again.

    Trevor
    #273612

    What type of ACF field is this? This setting in the ACF Field Group:

    https://www.screencast.com/t/YD0jUsfdFBHK

    Anonymous
    #273621

    Hi Trevor,

    I’m using a ACF ‘Link’ field (as Array).
    I need to select an internal or external link (with ‘target’ attribute) depending on the case.
    Dropdown lists all array values from field: title, url, and target.
    I only need to show the title.

    Thanks,

    Trevor
    #273624

    Ah, that is why it shows all the parts. It is not a field type we explicitly support, so your solution is probably a good one.

    Anonymous
    #273675

    Ok!

    Perfect.

    Thank you so much,

    Best

    Trevor
    #273677

    Thanks for getting back to me. I will close this thread for now.

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