@ Mitch
I’d keep an eye on the WP repository…
I have not quite pushed it out yet. I’m still writing the changelog and other assorted dot i’s and cross t’s type of things.
The changelog really doesn’t do justice the amount of changes that have taken place under the hood. Likewise, the end user perspective isn’t going to look all that much different either. One thing is certain, the teaks and suggestions you have given me over the years are no far more easily accomplished and I look forward to all the things this release will allow me and the users to do.
One feature I think you’ll like… template file overriding…
I completely refactored the cnTemplate class. This class is basically responsible for core template features.
What it does do now is allow template file overriding and allow loading template file loading based on context much like WP handles loading theme files. Let me try to explain.
Say you’re using the cMap template and you want to make a tweak. Currently you’d open the core template PHP file and make your changes. If you happened to update the cMap, you would lose those changes. Now, instead, you can duplicate the file and put it in one of the following paths [ordered by priority, first highest priority]
../wp-content/theme/{child-theme}/connections-templates/{template_slug}
../wp-content/theme/{parent-theme}/connections-templates/{template_slug}
../wp-content/uploads/connections-templates/{template_slug}
../wp-content/plugins/{template_folder}
This is important because in-admin updates are coming to templates making it very easy to lose tweaks. If the tweaked file is in one of the override paths, their tweak is update safe! Of course they may not benefit from any new features, but more importantly, the likely hood of their setup breaking is reduced.
Oh, the same goes for the template’s, CSS file and JS file.
Another new feature, template file loading based on context…
Currently template could be setup with a list card and a single card. This has been significantly enhanced! Now you can load templates based on if you viewing a specific category or specific region or specific entry and so. Here’s the run down of template files that are supported:
card-category-{category-slug}.php
card-category.php
card-country-{country}.php
card-country.php
card-region-{region}.php
card-region.php
card-postal-{postal-code}.php
card-postal.php
card-locality-{locality}.php
card-locality.php
card-organization-{organization}.php
card-organization.php
card-deparment-{deparment}.php
card-deparment.php
card-{entry-slug}.php
card-single.php
card.php
The same search paths from above also apply. So if a template has one of the above template file, it too can be overridden… or added, if the template does not have one.
Yep, this too, works with the template’s CSS and JS file. Instead of “card” as the file name base it would be the template slug and instead of php, either css or js for the extension.
Suppose you do not want to override the core CSS to Connections or a template, Connections will search the above paths for:
cn-custom.css
{template-slug}-custom.css
These, if found will be loaded as a dependency of either the core CSS file template CSS file. This allows you to have update safe CSS tweaks for both the core CSS and the template CSS files.
And this is just “one” of the core enhancements!
Good stuff?!?
