Jump to content

Page Field Select Creator


adrian

Recommended Posts

  • 10 months later...

Hi @adrian,

This will probably sound like an odd request given the name of the module...

What do you think about adding an option to not actually create a Page Reference field but only create the templates and pages (if any)?

The smart template naming and template restriction features are so useful that I often execute the module and then just delete the Page Reference field because I don't need it. I'm not sure if you or anyone else ever do this, but if I'm not the only one maybe it would be a handy addition to the module?

  • Like 1
Link to comment
Share on other sites

1 minute ago, Robin S said:

I'm not sure if you or anyone else ever do this, but if I'm not the only one

I've definitely done that before as well, so you're not the only one ?

You're right that it kinda makes the module name a bit weird, but then it's always been a bit of a mouthful anyway.

The thing is I am not sure what would be the most logical way to support this - everything is pre-populated based on the field label and its plurality. I am thinking that there should be a "Create Field" checkbox in the field settings that is checked by default, but if you uncheck, the field settings are hidden and the form starts at the "Page Settings" fieldset where you need to manually enter the Parent Page Title and that is used to automatically populate the parent and child template field lables/names (rather than coming directly from the field label? 

Any thoughts?

  • Like 1
Link to comment
Share on other sites

3 minutes ago, adrian said:

I am thinking that there should be a "Create Field" checkbox in the field settings that is checked by default, but if you uncheck, the field settings are hidden and the form starts at the "Page Settings" fieldset where you need to manually enter the Parent Page Title and that is used to automatically populate the parent and child template field lables/names (rather than coming directly from the field label?

That sounds sensible. I guess Pluralize would need to be reinitialised with different settings depending on if a field is being created or not, so you could put that JS into a function with a parameter that switches the type of initialisation and then call that on window load and on checkbox change. Or there are probably other ways too.

Link to comment
Share on other sites

Yeah, I am sure I can sort out the Pluralize issues.

Of course the really simple solution here would be keep the field settings even with the create field checkbox unchecked - this way nothing else would need to be changed - you'd just use the field label as the way to generate all the other things. It would work well, but would be a strange / confusing interface.

  • Like 1
Link to comment
Share on other sites

1 minute ago, adrian said:

f course the really simple solution here would be keep the field settings even with the create field checkbox unchecked - this way nothing else would need to be changed

I'd be totally fine with that. It could be a "Don't create field" checkbox and you could even use some custom CSS to put it somewhere subtle and out-of-the-way. That way it's not distracting/confusing for people who use the module in the standard way but is available for those who want it.

Link to comment
Share on other sites

  • 1 year later...

I have what might seem like a strange request, but is it possible to pick the delimiter for the name generation for templates?

I typically use a dash delimiter for template and the underscore for fields, so I end up having to rename templates every time I generate them with the module.

I don't know if there is a best practice for these conventions - I just have always understood that underscores in URLs were to be avoid in favor of dashes and so I use dashes in my template names and underscores in my field names to keep them sraight.

Just an option to be able to separately pick or enter alternative delimiters for the template and field name generation would be nice.

Link to comment
Share on other sites

24 minutes ago, gornycreative said:

I just have always understood that underscores in URLs were to be avoid in favor of dashes and so I use dashes in my template names and underscores in my field names to keep them sraight

Just to clarify, in case you don't know, having a template name with an underscore doesn't at all impact the URL of pages using that template?

That said, I've gone ahead and added an option to choose from an underscore or dash for the template names. Please grab the latest version.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...