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

[add-resource] New Plugin/Theme #3895

Open
acalcutt opened this issue Jan 27, 2025 · 3 comments
Open

[add-resource] New Plugin/Theme #3895

acalcutt opened this issue Jan 27, 2025 · 3 comments

Comments

@acalcutt
Copy link

acalcutt commented Jan 27, 2025

I would like to add my new plugin/theme to the Grav Repository.
Here are the project details: acalcutt/grav-plugin-subpages

it displays a list of direct, visible sub-pages for the current page.

@pamtbaau
Copy link
Contributor

I've taken the liberty to take a quick look at the plugin. This is what I've noticed:

Template:

  • It is common in Grav to add 'html' to the template name, to distinguish between other output formats like xml/json/rss etc.
  • The name would then be 'subpages.html.twig'

PHP

  • There is no need to test if plugin is enabled. If not enabled, none of its event-callbacks will be called.
  • What is the added value of the if-statement in onPluginsInitialized?

README

  • Installation section
    • Why is there no section on GPM?
    • Why is composer recommended and not GPM?
  • Usage section
    • The include should be wrapped inside an if-statement to test if the plugin is enabled. Else an exception will be thrown.
      {% if config.plugins.subpages.enabled %}
        {% include 'subpages.html.twig' %}
      {% endif %}
      
      Note the name of the template
  • Example section
    • The folder structure shown only contains pages which are invisible by default, because the folders have no numerical prefix. Adding numbers might be more correct.
    • Adding a screenshot of the output would make it more intuitive for non technical users (which many are).

@acalcutt
Copy link
Author

Thanks for the review, I will work on adding the screenshots, renaming the files, and making the readme update you mentioned

I worked with Google AI to make this plugin to fill a need on my own site, which I wanted to make links to all the subpages like https://techidiots.net/downloads/open-base-map-torrents/mbtiles/ . I was originally trying the Directory Listing plugin, but I didn't want to display the top level and it also showed pages that were not visible, which this plugin doesn't do. I submitted this mainly because I thought it could be useful to others.

@pamtbaau
Copy link
Contributor

The author of Directory Listing is a well respected and active user. You might consider creating a feature request about excluding invisible, non-routable pages as well as design preferences.

Just a thought...

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

No branches or pull requests

2 participants