Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: Breadcrumb returns empty div when no breadcrumbs #111

Open
alana29s opened this issue Jan 20, 2022 · 1 comment
Open

Bug: Breadcrumb returns empty div when no breadcrumbs #111

alana29s opened this issue Jan 20, 2022 · 1 comment
Labels

Comments

@alana29s
Copy link
Contributor

While setting up Breadcrumbs for law https://github.com/bu-ist/r3-law/pull/114, it was discovered that the breadcrumbs function returns an empty div(element chosen) when there are no breadcrumbs. It would be preferable to return an empty string instead. If that may break something, a new option to return an empty string could be added.

Sample code from r3-law

						$breadcrumb_args = array(
							'glue'            => ' / ',
							'container_tag'   => 'div',
							'container_id'    => '',
							'container_class' => 'bu-banner-breadcrumbs',
							'anchor_class'    => 'crumb',
							'crumb_current'   => false,
							'anchor_current'  => false,
							'echo'            => true,
							'include_hidden'  => true,
						);

						bu_navigation_breadcrumbs( $breadcrumb_args );
					}

Screen Shot 2022-01-20 at 3 06 01 PM

@alana29s alana29s added the bug label Jan 20, 2022
@jdub233
Copy link
Contributor

jdub233 commented Jan 21, 2022

It's an interesting question as to whether removing the empty div would mess up any other existing layouts.

One approach could be to add another arg to the breadcrumbs() function to optionally skip the empty divs. I think that would go here:

function bu_navigation_breadcrumbs( $args = '' ) {

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants