Home of the crazy man's experiments!


Aisis – Update – Aisis Core API

Written by: Adam on: April 4, 2012

One thing I haven’t talked about in these blog posts regarding this new theme framework is the idea of the API. How will one use the framework to their advantage?

Child Themes

The idea is to activate the framework site wide and use child themes to create various sites. This stops the user from having to have 4-5 or more of the same theme installed and activated across various sites in order to change a few things about said theme. This is no new concept to WordPress – but it seems with some of the people I work with that it is a very new thought. With Aisis the idea is to be simple – dynamic and clean.

We want the user to be able to use our functions and our calls to create beautiful sites that sit on top of WordPress. One way we are doing this is through the use of custom functions that get right into the core of WordPress to allow you to hook in and stretch, change, manipulate the framework to build amazing sites.

So how does this all get done?

Aisis Core or: AisisCore which is a set of folders and files containing core functions important to the theme.  One important aspect in a child theme is to override methods and functions that are inside function_exists() calls. And trust me there are a lot of them. I allow you to manipulate about 90% of the theme in a child theme across the framework.

One of the major advantages about making child themes for this framework is that all the work is done for you, all you have to do is change what you don’t like or change what you don’t need about the site in order to make it your own.

Don’t edit the core files – custom all the way

In the event that you want to manipulate the core theme of the framework we provide you with a series of custom-tpye.extensition files that are loaded through the CustomLoader.php file these custom-type.extension files are anything from JS, CSS and PHP.

I even advice against this and state that you should use child themes to create themes based off the framework. However for single sites this works well.

What about templates?

These are over ridden in the child theme. However if you like they are also loaded into your child theme from my understanding of the codex. Essentially, if you make a template called index.php it will override the index.php of Aisis allowing you to design your own index.

How is core affected?

Well assuming you don’t over ride anything – like templates- you’ll be fine, but because everything in core is loaded in Aisis’s functions.php file you can still override the templates and call upon the templates stored in core

Modularization of Aisis Core?

One idea is to have it so that Aisis can be pulled off the theme that it comes with and plugged in to other themes through a series of functions in the utils file. But because Aisis relies on everything in the lib folder this would make it difficult to do this – I am looking at making it so that you can essentially state:

– If Aisis core is loaded use these functions, else do this.

It essentially allows for a user to pull the whole core out of the theme and use it elsewhere. Why you would do this I have no idea – but it was an idea. A lot of frame works out there are coupled to their themes and to WordPress and in software development you never or at least attempt to never introduce coupling.

Plugging right into WordPress by overriding or changing core code?

There is a spot where this is done, the comment form box – and it’s used through and Aisis function called aisis_comment_form which essentially over ride and stylizes the current default WordPress comment_forum to my own liking.

There may be other instances where this is done to change the way the theme interacts with WordPress. Most of the time we just add an action or a filter or add_something(‘somethin’, ‘aisis_some_function’); to WordPress. However we are always doing if function_exists() first.

How will I change things?

As stated before you can see from the following example of a function that the function is created if that function does not exist. the function we define here is of our standards and will be fully documented in Aisis’s Documentation

if ( ! function_exists( 'aisis_some_function' ) ) :
function aisis_some_function(){}
endif;

What we can do in the new child themes functions.php is state that:

function asisis_somefunction(){}

which then states ok, this function exists we now use this one instead of what’s already in use. This will be EXCEPTIONALLY handy when you design your child themes because this allows you to plug right into the core of Aisis and get right into the guts with out physically going into the core files and changing something.

Conclusion

The whole purpose of Aisis is to not be a beautiful and magnificent project that makes people drool – but to be a functional, responsive, developer happy and designer friendly framework that sits on top of WordPress and allows you, the developer, the designer and whatever design to your heart’s content – over riding everything or nothing about the frame work.

Categories: Aisis Products, Tags: Aisis Core, Aisis Metro, Aisis Products, Aisis SQL, AisisCore, API, Beta, Child Theme, Class, Database, Development, Documentation, Features, Github, Google+ Articles, Labs, Labs Community, News, Observer, Options, Ouath, Package, Pattern, Project Management, Project Monkey, Rails, Responsive, RGSS3, Script, Silent Update, Social, SubSections, Theme Framework, Update, Utility, View, Wiki,

Whats on your mind?