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

Implement navigation menu overrides to replace hardcoded links #18

Open
bobbingwide opened this issue May 4, 2021 · 3 comments
Open
Assignees
Labels
bug Something isn't working enhancement New feature or request

Comments

@bobbingwide
Copy link
Owner

The templates and template parts which contain hard coded links prefixed https://s.b/wp55/thisis/ are acceptable when used in a local development environment but not at all acceptable in a live site. The browser attempts to find s.b and takes an awfully long time. Alternatively, in my local development environment, I may not notice the switch.

Given that this is an experimental theme, and I expect to make many changes to template parts with navigation blocks, it would make sense to automatically adjust any URL starting https://s.b/thisis/ to the siteurl(). This may result in a 404, but that’s OK.

Requirement

  • Dynamically adjust the URL prefix for certain hardcoded navigation links
  • Change the prefix to siteurl() - or network_url() - whichever is necessary for WordPress Multi Site

Proposed solution

  • As already implemented for Fizzie and SB
  • But with improvements to cater for Gutenberg’s improvements to the Navigation link’s Server Side Rendering.
@bobbingwide bobbingwide added bug Something isn't working enhancement New feature or request labels May 4, 2021
@bobbingwide bobbingwide self-assigned this May 4, 2021
@bobbingwide
Copy link
Owner Author

bobbingwide commented May 4, 2021

The logic in thisis_fiddle_nav_atts() doesn't properly cater for links of the form
https://s.b/wp55/thisis/?page_id=nn

The link to the blog, in the header is of this form, with page_id=36.
When the URL is parsed the resulting value matches the $url_path, so this is shown as the current menu item when we're viewing the home page.

Conversely, when we visit the blog page Blog is not considered to be the current menu item

Workaround

Change the URL to use a permalink.

@bobbingwide
Copy link
Owner Author

The Contact link suffers a similar prolem since the actual URL is about/contact rather than contact.

@bobbingwide
Copy link
Owner Author

bobbingwide commented May 7, 2021

The Contact page link needs correcting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant