As most of you already know, the Gantry 5 framework is one of the most advanced, most properly coded and most awesome frameworks available on the Web. It is the first-ever platform-independent framework and it works on Joomla, WordPress and the Grav CMS.
But developing a true platform-independent framework is quite of a challange. The Gantry 5 developers (the awesome guys at Rockettheme) had to come up with the concept and with the architecture and in my opinion they did it in the best possible way! They had to standardize the different aspects of the platforms which is why you see things like "Particles", "Atoms" and so on.
Now, the only "problem" that I see in the Gantry 5 framework is that it is super flexible. You can do one thing in several different ways and none of them is wrong. For some users this is awesome because it gives great freedom in configuring your website but for others it might be quite confusing as well. It might be quite confusing because the Gantry 5 framework does not make the decisions for you and does not limit you to a single way of doing things!
And this is what this blog post is all about - to give you as much details as possible and to show you the recommended way of using the Gantry 5 framework!
Gantry 5 does have a great and very detailed documentation that explains most of the things in details but it does not show you or tell you the recommended way of using the framework. Still, you do need to go through the documentation in order to be able to build a website with Gantry 5.
In this blog post I will explain the things that most of the users get confused with. So, let's get started...
Layout Manager - drag and drop particles directly vs. "Gantry 5 Particle" module/widget
Well, the recommended approach here varies depending on the CMS you are on.
Joomla - The Layout Manager should mostly be used for creating your module positions. Apart from the module positions, you should also keep the static content there. By "static content" I mean those elements that will apear on all pages - the Logo particle, the Menu particle, the System Messages particle, the Page Content particle, the To Top particle and the Mobile Menu particle.
You might ask "Why should I do that". Well, the simple answer is - because this is how Joomla works. You publish "Modules" in Module Positions and assign them to Menu Items.
Once you have created your module positions in the Layout Manager you will use the Module Manager to assign your modules, as you would do in any other framework as well as in the default Joomla. If you want to publish the particles that come with the template you will use the "Gantry 5 Particle" module.
There are many, many advantages in using the "Gantry 5 Particle" module instead of adding the particles directly in the Layout Manager. Here are just few of them:
- You can utilize and benefit from the features that come from Joomla itself. Those are ACL, Module Assignment, Module Title, Module Class Suffixes and so on and so forth.
- You will not need a new/dedicated Outline for each page as you would if you drag and drop the particles directly in the Layout Manager. Actually, all our Joomla templates come with a single outline - "TemplateName - Default" as you can see in the screenshots below. We do believe that the template configuration should be as simple as possible - one Outline that controls everything! And from there on, if the user needs to override some settings or to override the Layout of a particular page, they can just create a new Outline, assign it to the page (menu item) they want and modify it as they wish. But once again, we do believe that the template should come with as less Outlines as possible by default!
- Well, you will use Joomla as it is supposed to be used - you will simply assign modules to menu items!
WordPress - Since WordPress does not have the ACL and Assignment features for its widgets by default, you do need to have quite some Outlines. A new/dedicated Outline for most of your pages. Therefore, you can drag and drop the particles directly in the Layout Manager and build your pages there.
But still, if you want to publish a WordPress widget (not a Gantry 5 particle), you need to add the widget position to the Layout of the Outline (page) where you want this widget to appear, and then you would just assign it from Appearance -> Widgets.
Of course, you can use the same approach from Joomla in WordPress as well. You can use the Layout Manager mostly for creating your widget positions and then publish the particles from Appearance -> Widgets using the "Gantry 5 Particle" widget. It is just that there is no such crucial benefit of this approach in Wordpress as there is in Joomla.
"Default" Outline vs. "Base" Outline (Joomla)
First, there is something very important that you need to know so you can see the "big picture" - there is no "Default" outline in Gantry 5 on WordPress and Grav CMS! The "Default" outline is present in Joomla only!
Now, how many of you guys have wondered why there are two main Outlines (Default and Base) and where you are supposed to do your changes?
Yeah, I was in the same boat in the beginning! So, let shed some light on the matter...
Basically, the "Default" outline is needed because of the way Joomla works.
There are some things in Gantry 5 that require a "Master" template to hold the default settings (for particles and other things). But in Joomla there is no master style ("Style" is the same thing as "Outline" - in Joomla it is called "Style", in Gantry 5 it is "Outline"). All the styles are equal, except for a single one that is assigned as fallback (or default) if there's nothing else set. Only a single style can act as a default, so everything else needs to be assigned to a page. There is also no special treatment between the styles. As long as you have more than one style, you can assign or set any of them as your default one. You can also delete any of them as long as you will not delete either the default or the last one.
Did the above paragraph confuse you even further? :D
Don't worry, the above is just the technical/theoretical explanation. Now, let's get practical...
Since the "Base" and the "Default" outlines are pretty much the same thing, the best thing you can do (and you should do) is to make them behave as ONE!
What you should do is to set EVERYTHING in your "Default" outline to inherit from the "Base" outline. Everything under the "Styles" tab, the "Page Settings" tab and the "Layout" tab in the "Default" outline should inherit from the "Base" outline (by default, all new outlines that you create will inherit all the settings from the "Base" outline - the "Base" outline holds the global defaults for the template). And no, you should not assign the "Default" outline to any pages because it will be loaded on all pages that do not have another outline assigned!
Once you have made the "Base" and the "Default" outlines to behave as one, you will do all your changes in the "Base" outline. As simple as that!
And here I want to add one important tip - the outline that is actually loaded by Joomla is the "Default" outline. But since the "Default" outline inherits everything from the "Base", then the "Base" settings will be applied to your front-end.
Imagine the following scenario - you load an Atom in your "Base" outline, you refresh the page in the browser but nothing happens. The result you have expected is not there, the script you wanted to load has not been loaded. This is a clear sign that your "Default" outline is not inheriting the "Atoms" section. Just go under the "Page Settings" tab in the "Defaut" outline and make sure that the "Atoms" section is not overriding the one from the "Base" outline (make sure it is greyed out).
I wanted to include couple more things in this blog post but it got quite long already. So I will leave those for a future post :)
As you might have noticed, most of the things in this post are related to Joomla, there are only couple of paragraphs about WordPress. The reasons is that using the Gantry 5 framework on WordPress is a much more straight-forward process compared to Joomla. And it is not that WordPress is better than Joomla, not at all... WordPress is just a simpler CMS, with less options and features by default!
So, what about the Grav CMS? Well, I do not currently have much experience with Gantry 5 on Grav. Therefore I cannot recommend any workflow or best practices. But as soon as we get into it, I will update this blog post :)
Guys, the sole purpose of this blog post is to explain some basic things that might cause a confusion and to make you realize that Gantry 5 is indeed one of the best and most powerful frameworks available on the Web!
Yes, I've seen people saying that Gantry 5 is not intuitive and that Gantry 4 was better. But you do need to realize that Gantry 5 is ages ahead of Gantry 4 (and any other framework). Regarding not being intuitive - well, everything that's new to you will not be intuitive in the beginning. Just take your time, read the official Gantry 5 documentation carefully, install and play with the framework and in less than a week you will master it! And once you master it... once you master it you will never ever look back and you will never ever want to use any other framework!
That's it guys. I hope this article will be helpful and please do not hesitate to post your comments below :)