In this video we’ll take a look at the Pro version of Advanced Template Manager.
In the previous video we looked at the assignments available in the Free version.
We have already seen how we can assign template styles by a whole range of different conditions. That includes assigning template styles based on Joomla! Content, Users, Components, URLs, Devices and much more.
The Pro Version adds even more assignment types which we will look at in this video.
We now have the latest Pro version of Advanced Template Manager installed, which at the moment is version 3.7.0. And what you see here is a Joomla 3.9.2 setup. If you are using newer versions, things might look a bit different.
Make sure to first check out the “Getting Started” video if you haven’t already. Let’s pick up from where we left off. To try things out, we created an alternative version of the protostar template with a red color scheme. And we also assigned colour tags to easily distinguish the template styles in the list.
Let’s head over to the same template we played around with in the previous video.
As you can see, currently all assignments are set to ignore,
So the template that is set as Default, the original protostar with a blue scheme, is used on all pages of the website.
We have already discussed the Menu Items and Home Page assignments, as they are available in the free version too.
But here in the Date & Time section we now have more than just the Date assignment. We can use a specific template style during a specific Season, Month or only on a specific Day of the week.
We could even only have this template style used between a starting and ending Time of the day.
And like with any assignments here, we can combine these Date assignments anyway we want too.
Let’s say we would like to use a different template style for each Season.
For example, let’s set this red scheme template style to only get used in Autumn.
And let’s add a description here so we can clearly remember what this template style is for.
Now, we could simply create another two copies of our template. For example, one with a yellow scheme, and one with a green scheme. I’ll just create these real quick.
As you can see, I also gave them a color tag and added a description.
We set the red one to Autumn, let’s set the yellow one to Summer.
And let’s set the green one to Spring.
Since the only season we left out is Winter, the default template will automatically be used for Winter.
This is just an example of what you can do. Of course, you can use any Template Style you have installed on your website.
Another assignment that is exclusive to the Pro version is the Users Assignment.
We have already seen how in the Free version we can assign a template style based on User Groups. With the Pro version, we can also make the style only be used for a specific user or a selection of users.
The Pro version also allows us to assign template styles based on specific IP addresses. Or ranges of IP addresses. But in most cases it is probably easier to use Geolocation.
With the Geolocation assignments we can make a template style only be used on one or more Continents… Countries… Regions, States or Provinces… and even on ranges of Postal Codes.
To be able to use Geolocating, we need to install the Regular Labs GeoIP library, which is free.
We can install the GeoIP library just like any other Regular Labs extension.
On the Regular Labs website you can view the installation video and instructions on how to install it.
Once the GeoIP library is installed, we are free to use any of these location based assignments.
Of course, keep in mind that Geolocating is not always 100% accurate. The Geolocation is based on the IP address of the visitor, and not all IP addresses are fixed or known.
The Pro version also adds support for plenty of 3rd party components, including CCKs and eCommerce extensions.
As we can see here, the supported CCKs are: EasyBlog… FLEXIContent… Form2Content… K2 Content… and Zoo Content.
Advanced Template Manager Pro also supports eCommerce extensions Hikashop… Mijoshop… Redshop… and Virtuemart.
These assignments for the 3rd party components will only show up if you have that extension installed. When you do, you will be able to assign template styles based on its page types, categories and items.
And if all of this still isn’t enough and we still need to assign our template to something that is not available in the assignments… well, we can!
That’s because we have the ability to assign a template style by custom PHP code.This allows us to assign to just about anything we can think of. However, this does require some PHP knowledge and how to use this assignment.
We can call on any data that is available through php in Joomla and do checks on it. This includes data from the url, cookies, the current active component, the current article, the user and even anything from the database.The PHP code we enter here must return the value “true” or “false”. For instance, we could use this code to only make our template be used on articles that have more than a certain number of hits. Say 500.
Let’s check if that works.
This “Animals” article has more than 500 hits. So our red template is used here.
But the article “Cats” has less than 500 hits, so this page falls back to the default template.
For more examples and ready-to-use PHP scripts, you can check out the PHP Assignment Guide on the Regular Labs website.
So, we have now seen all the Assignment Types offered by Advanced Template Manager in both the Free and Pro versions, and how to use each of them.
In the next video we’ll walk through the Settings that help us control how Advanced Template Manager works.