nav always assumes start from / if start_from is invalid

litzinger's Avatar


09 Aug, 2016 04:38 PM

I have a scenario where the nav tag is on a 404 page, e.g., obviously that is not a valid segment, so the value that gets sent into the start_from tag is /asfasfds, and it can't find a segment, so Structure defaults to "/" instead, which IMO is a bit unintuitive. It shouldn't show any navigation if it can't find a valid segment to start from. I changed it to this:

if ($found_key !== FALSE) {
$branch_entry_id = $found_key; } else { return ''; }

  1. Support Staff 1 Posted by Support on 10 Aug, 2016 01:15 PM

    Support's Avatar

    Thanks for passing this along.

    We're going to have to give this one some thought as a whole, to make sure there isn't unintended side effects to our changing this.

  2. 2 Posted by litzinger on 10 Aug, 2016 01:19 PM

    litzinger's Avatar

    Could always make a parameter override so the behavior is optional. Would be backwards compatible too.

  3. 3 Posted by litzinger on 06 Apr, 2017 02:04 PM

    litzinger's Avatar

    Coming back to this one to see if adding an override param is an option so we don't have to keep patching Structure after upgrading it.

  4. Support Staff 4 Posted by Support on 06 Apr, 2017 07:27 PM

    Support's Avatar

    We have added a param override called "strict_start_from" that if set, will return an empty string if "start_from" is provided but does not match a key.

    This is set to go out in the next version.

  5. Support closed this discussion on 06 Apr, 2017 07:27 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts


? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac