Here is what I have done, I finally figured out how to get a list of categories, I kind of like this method but I hate having to pass an array, but it is what it is.
var theme = {};
var catLength = [1,2,3,4,5,6,7];
var Categories = module.parent.require("./Categories");
theme.init = function(params, callback) {
Categories.getCategoriesData(catLength, function(err, data) {
data.forEach(function(something, index) {
if(something) {
console.log(data[index].name);
}
});
});
callback();
};
module.exports = theme;
Cool now I have all the categories and the next step is to create a dynamic header based on the categories, the problem is I am so confused on how to do that, I think I am missing something very obvious!
I am inside a theme and I want to pass this into the precompiled template!