• Resolved petitshoo

    (@petitshoo)


    Hi,

    I used your plugin to make a dropdown menu in a content block which is very handy. Only problem is the instead of showing the menu item it shows “Select” at the top fo the dropdown. Is there a way to change this?

    Thank you!

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author linux4me2

    (@linux4me2)

    Without the placeholder “Select,” there would be no way to navigate to the link associated with the first menu item, which would be selected by default. The plugin uses the “change” action of the drop-down to navigate to the page associated with the menu item, so without a placeholder, one of the options would already be selected and unusable.

    If you tell me what you’re trying to accomplish, I might be able to give you a better answer.

    Thread Starter petitshoo

    (@petitshoo)

    I have a main topic “Racial Equity Resource Guide” that doesn’t link to anywhere…I’d like to have that be in place of “Select”. And then it would drop down the cateogories: Books, Movies and Documentaries, etc that would go to those specific pages. Is this possible?

    Thanks,
    Jen

    Plugin Author linux4me2

    (@linux4me2)

    I can see how it would be helpful to be able to specify the text of the placeholder. I will look into adding that functionality to the plugin.

    In the meantime, if you are only using the plugin on one page, you can use a text editor to edit the file /wp-content/plugins/menu-in-post/menu-in-post.php and replace this line (line 76):

    
    $args['items_wrap'] = $select . '<option value="#">' . esc_html(__('Select...', 'menu-in-post')) . '</option>%3$s</select>';
    

    with this:

    
    $args['items_wrap'] = $select . '<option value="#">' . esc_html(__('Racial Equity Resource Guide', 'menu-in-post')) . '</option>%3$s</select>';
    

    That will change the placeholder everywhere you use a Menu-In-Post shortcode to “Racial Equity Resource Guide.” Your changes will be overwritten the next time I update the plugin, but it will get you what you want now, and maybe I can add a setting to change the placeholder text soon.

    If you’re using the plugin in more than one place, that won’t help you, unfortunately.

    Keep an eye on the changelog of the plugin when I release an update to see if I’ve added the feature, and you can then modify your shortcode to incorporate the setting so it won’t be overwritten in future updates.

    I’ll try to post here to notify you when I have the feature added.

    Thread Starter petitshoo

    (@petitshoo)

    Thank you! I’ll be using it in a global content block, so I think making this change should work. I appreciate the prompt reply and the workaround.

    Thanks again!
    Jen

    Plugin Author linux4me2

    (@linux4me2)

    You’re welcome.

    I should have the updated version out later today or tomorrow if you’re not in a big hurry.

    Plugin Author linux4me2

    (@linux4me2)

    I just uploaded a new version of the plugin that will allow you to set the placeholder text for each shortcode you build. It will be version 1.1.4. It hasn’t shown up on this site yet, but it should shortly.

    Once you install the new version, be sure to clear your browser cache if you use the Menu In Post Tools page to build a new shortcode. The new version uses javascript to build the shortcode, and your browser may cache the old version of the javascript, preventing the new code from running.

    An alternative to rebuilding your shortcode will be to just add the following attribute to your existing shortcode:

    
    placeholder_text="Racial Equity Resource Guide"
    

    That should do the trick, and it will only change the “Select” for that shortcode.

    thanks, it helps us too: D

    Plugin Author linux4me2

    (@linux4me2)

    @stf2000 I’m glad to hear it.

    @petitshoo Did the update solve the problem for you?

    Plugin Author linux4me2

    (@linux4me2)

    @petitshoo I haven’t heard back from you, so I’m going to assume the workaround/update solved your problem and mark this as resolved. Just post again if you’re still having issues.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Take “Select” Out of Dropdown Menu’ is closed to new replies.