- This topic has 10 replies, 3 voices, and was last updated 3 years, 3 months ago by
David.
-
AuthorPosts
-
January 13, 2023 at 9:26 pm #2494939
webyogi
Hi!
How do I create a basic drop-down button with toggle functionality like in the link below using GeneratePress?
https://www.w3schools.com/bootstrap/bootstrap_dropdowns.asp
Thanks in advance.
January 14, 2023 at 4:19 am #2495141webyogi
please can you somebody from support respond to my query. thanks.
January 14, 2023 at 9:22 am #2495509David
StaffCustomer SupportHi there,
use a Navigation Menu block, you can add single menu item, with a list of drop down menu items.
January 14, 2023 at 9:31 am #2495523webyogi
Ok am trying it out as we speak.
How do I change the down arrow icon for the drop down to a “+” sign and upon expansion/click change it to “-” ? thanks
January 14, 2023 at 9:56 am #2495556David
StaffCustomer SupportCan i see what you have so far ?
January 14, 2023 at 10:11 am #2495566webyogi
unfortunately can’t share the link but can do a screen shot
January 14, 2023 at 11:42 am #2495612Ying
StaffCustomer SupportHi there,
Are you using the WP navigation block?
If so, GP doesn’t have control over it as its a WP core block, I’ve found this support topic might be helpful:
https://wordpress.org/support/topic/customize-navigation-block-hamgurger-icon/For more info about the navigation block: https://wordpress.com/support/site-editing/theme-blocks/navigation-block/
If you have more questions regarding the navigation block, you can reach out to WP’s support.
January 14, 2023 at 6:57 pm #2495857webyogi
Yes tried creating with the WP Navigation Block as suggested by David.
So my requirement is simple. I would like to create a drop down button in the content area called, “Product +” which has a submenu/options/list called “Product 1”, “Product 2” … and links to their respective product pages. When clicked on the “Product” button it should show the product list as above and change the button text to “Product -“, when clicked again is should hide the product list and change back the product button text to “Product +”.
Using Navigation Block to do this kinda works but not sure if it the most elegant solution but unable to simulate the toggle icon change “+/-” upon expand and collapse. Bootstrap’s Basic DropDown (with the Toggle) is simple near perfect solution.
https://www.w3schools.com/bootstrap/bootstrap_dropdowns.asp
Any help will be much appreciated.
January 15, 2023 at 4:15 am #2496061David
StaffCustomer SupportAdd this CSS to your site:
.custom-nav .wp-block-navigation__container > li > button .wp-block-navigation-item__label:after { padding: 0 5px; font-size: 1.2em; font-weight: bold; content: '+'; } .custom-nav .wp-block-navigation__container > li > button[aria-expanded="true"] .wp-block-navigation-item__label:after { content: '-'; } .custom-nav .wp-block-navigation__container > li > button + .wp-block-navigation__submenu-icon { display: none; }2. Select the Navigation block in the editor, and in Advanced > Additonal CSS Class(es) add:
custom-navJanuary 15, 2023 at 10:18 am #2496490webyogi
It works! Thank you Thank you Thank you!
January 16, 2023 at 3:42 am #2497224David
StaffCustomer SupportYou’re welcome
-
AuthorPosts
- You must be logged in to reply to this topic.