Hi everyone, welcome to the start of a series of posts on development for the open source CMS Evolution Xtreme. This series is going to go through the basics of creating modules, starting at basic folder structure and going right through to user interaction and submissions.
While you will hopefully learn something from going through my code examples, where you will take off is trying to adapt the code to your own creations. Nothing works better than “just doing it.” If you have any questions at all, please, feel free to ask.
I’m going to be assuming you have a basic understanding of PHP and HTML, and Evolution Xtreme installed. I recommend that you use a server such as WampServer on your computer rather than online, as it will make editing much easier.
Throughout this series, we will be making a fairly basic “Inspirational Quotes” module. It will start as a basic page which will output a random quote specified in the module file, and will finish with an admin panel and database usage, catering for user submissions and permissions.
The plan is as follows:
- Post 2 – Module structure
- Post 3 – Using the database
- Post 4 – Creating an admin page
- Post 5 – Creating blocks
- Post 6 – User interaction
- Post 7 – Tidying up
Still interested? Let’s get started.
Before we dive into our module, I want to explain the most common aspects to starting any module. They are access validation and the header.php and footer.php files.
Access validation
These few lines check to see if the module file is being accessed directly rather than through modules.php. Since this is generally not desirable, and only possible if a hacker is looking through files, we simply end on an error message
header.php and footer.php
These files output the header and footer of the page in the theme that the site/user specify. Without these, modules will just appear on a blank background.
For the vast majority of modules, these files are used, and even for the rest, slightly adapted versions of these files are used. They are the fundamentals of creating modules, so get ready to include them in every one you make.
In the next post, I will go through the folder structure of the module, output, and basically just creating something that the user can see. Stay tuned.