jonom / silverstripe-betternavigator

Front-end utility menu for SilverStripe websites featuring administration and development tools
60 stars 31 forks source link

[Question] How does one add extra dev tool links in 5.4.1 #66

Closed mooror closed 1 year ago

mooror commented 1 year ago

I noticed that in the latest release (v6) that the template paths/namespaces were updated. But I am still using Silverstripe 4 and so I'm stuck with version 5.4.1 and cannot seem to figure out how to add extra links to the developer tools section

I have tried templates/JonoM/BetterNavigator/Includes/BetterNavigatorExtraDevTools.ss, templates/BetterNavigator/Includes/ BetterNavigatorExtraDevTools.ss and templates/BetterNavigator/BetterNavigator/Includes/ BetterNavigatorExtraDevTools.ss without any effect (and I made sure to flush after updating the template).

Am I using the wrong paths? Or does this have something to do with me trying to overwrite the template from my own module rather then the theme template folder?

mooror commented 1 year ago

Hmmmm... So when I added the template to the templates/BetterNavigator/Includes/BetterNavigatorExtraDevTools.ss in my themes folder, it works fine, but not from within my module templates folder :thinking:

mooror commented 1 year ago

I think I will need to alter the module priority to load my module before this one for the templates to apply properly

mooror commented 1 year ago

For anyone who has this same issue, you just need to boost the priority of your module using the following YAML in a config file (Make sure to replace "vendor/your-module" with your modules vendor and name)

---
Name: modulepriority
Before:
  - 'jonom/silverstripe-betternavigator'
Only:
  moduleexists:
    - 'jonom/silverstripe-betternavigator'
---

SilverStripe\Core\Manifest\ModuleManifest:
  module_priority:
    - "vendor/your-module"
RoyalPulp commented 1 year ago

My suggestion would have been: Integrate the new full path in the Template structure: templates/JonoM/BetterNavigator/Includes/BetterNavigatorExtraDevTools.ss