Naming Pod Templates and Pod Helpers with a Slash and why it makes sense
When things first started out with Pods, the naming conventions for Pod Templates and Pod Helpers were pretty much a free-for-all.
Examples of names would be like:
- event_list (template)
- event_detail (template)
- event_save (pre-save helper)
- image_full (display helper)
- image_thumb (display helper)
- subscriber_get_info (display helper – advanced)
- etc…
But, now that your sites are becoming more complex, and you’re using many more Pods — I bet you are starting to see managing all of these becoming quite difficult. This is why I’d like to introduce to you the new standard we’ll be using in our examples, demo videos, tutorials, and our documentation.
Slashing without fear
Don’t worry, you can use slashes to help further distinguish your templates and helpers from each other! To construct a name, follow these simple rules and you’ll find yourself with easier to navigate management as well as perhaps a bit more readability when you implement them.
- If your template or helper is specific to one pod, try prefixing the name with pod_name/ otherwise try general/ or categorize it in a way that makes sense to you so you can keep templates and helpers that are alike together for easy usage
- Two levels may not be enough, you can use as many slashes as you want
- 2.0 will change the way helpers are grouped in management, so don’t worry about mixing up Display / Input / Pre-save / Post-save / etc.. types of helpers based on their names, that’s taken care of in the new UI
So examples of the new naming convention would be as follows:
- event/list (template)
- event/detail (template)
- event/save (pre-save helper)
- image/size/full (display helper)
- image/size/thumb (display helper)
- subscriber/get-info (display helper – advanced)
- etc…
I know that once you start using this new standard, you’ll find navigating like-minded Templates and Helpers much easier.
Masino Sinaga 1:32 am on June 12, 2011 Permalink
Great news. Thanks, Scott. I have been waiting for this feature.
kimantebedan 1:07 pm on June 12, 2011 Permalink
Nice share Scott. Thank you