MWDelaney / sage-bootstrap4-navwalker

MIT License
73 stars 34 forks source link

what does '...' mean? #13

Closed ftrotter closed 5 years ago

ftrotter commented 5 years ago

Hello.

I bought the book. Which links to a forum post, which in turn links to this repo.

You recommend using your logic "in the controller". But you do not say where that controller is located, just that it should be in App.php. Also do not detail the location of header.blade.php in either "solution".

Now I am trying to add the proper code to the proper place, but I do not know what to add.
You have '...' which in documentation is the equivalent of "the stuff that should normally go there" but I have no idea what that is, and no idea where to look for it.

What is the function "primarymenu()" in the controller doing? Not documented, no link. What is the argument "theme_location" in the argument array for? Not documented, no link. What is the "menu_class" argument doing? Not documented, no link. Where do I figure out what '...' means? Not documented, no link. Is the /app/Controllers/App.php the 'app.php' that you are referring to? Not documented, no link.

I hate to be a pest, but setting up a drop down menu is basically the first thing that anyone is going to try and setup. The book gives no detail about how to do this, but simply implies that doing so is not "responsive" enough. I am not building a "responsive" website. Why is the documentation telling me I should not be doing what I am doing, when it has no idea what I am trying to do or why I am trying to do it?

Why is doing something that is normally so simple so hard to figure out in this framework? The book does not actually detail how to do any other wrong solutions either. So its not like doing the "right" thing is made easier either.

It is not fun to hit walls that require me to read code to figure it out. Could these questions just be answered in your Readme? Or just link to the place in the Sage documentation that makes this clear...

I know that 80% of the problem here resides with sage dropping functionality and I appreciate you picking up the slack. Despite me frustration, I appreciate your FOSS contribution.

Regards,

-FT

alwaysblank commented 5 years ago

The readme for this package provides a link to Controller, but here it is again: . Controller is not a part of Sage 9, but it is used frequently by people building sites in Sage 9. It provides a layer between WordPress itself and your blade templates, which allows you to keep your logic in that layer (instead of putting in in your blade templates). It is not required for this package or for Sage.

The location of header.blade.php is immaterial: You can put your nav menu in whatever part of your theme you like. header.blade.php is just a file that comes with Sage (it can be found in resources/views/partials, which can be determined by searching your filesystem for header.blade.php).

theme_location and menu_class are argument for wp_nav_menu() which is a core WordPress function, not part of this package or Sage. You can read about what those arguments do in the Codex:

In the context of the example in the readme, the ... inside of the $args array just represents any additional arguments you may wish to pass to wp_nav_menu(), not anything required to use this package.

All of the examples in the readme are just examples of how to instantiate wp_nav_menu() with a custom walker, which is what this package provides.

MWDelaney commented 5 years ago

Thanks @alwaysblank, I was typing something similar when your reply appeared.

@ftrotter, I'm sorry you're having difficulty with this package and with the Sage book.

To be perfectly clear, this package only provides a walker which adds Bootstrap-specific classes to standard WordPress nav menus. The documentation provided in this package's README are usage suggestions, but generally speaking you can use this the same way you'd use any WordPress nav walker (which is standard WordPress functionality, not part of this package or Sage).

If you have feedback on the Sage book, that feedback is best directed to the writers of that book at the Roots Discourse.