Skip to content

Only suggest template files with valid template names#305

Open
JanRomero wants to merge 1 commit intoprocesswire:devfrom
JanRomero:sanitize-suggested-template-files
Open

Only suggest template files with valid template names#305
JanRomero wants to merge 1 commit intoprocesswire:devfrom
JanRomero:sanitize-suggested-template-files

Conversation

@JanRomero
Copy link
Copy Markdown
Contributor

@JanRomero JanRomero commented Sep 21, 2024

When using periods in template filenames, these files would be suggested in the Add Template screen. However, when you would choose such a file, say “my.template.php”, the resulting template name would become “my-template”. You would then be notified that the template lacks a file, even though you created it from ProcessWire’s file suggestion.

This PR uses the same sanitizer method templateName() to filter suggested files which is also used to sanitize template names. Before, only name() was used, which allows periods. Thus, “my.template.php” is no longer suggested.

In my case, that’s what I want anyway, because I’m using the period to denote partials related to the template.

Thank you!

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

Successfully merging this pull request may close these issues.

1 participant