@vrijvlinder said:
I gave you the wrong location for this categories module, I tested this theory and it worked. The simplest is to change the target to Content and they show right before the content
Wrapping your modifications in a theme or plugin right now will save you a lot of headache later. Modifying core files prevents you from updating without breaking things.
Plugin Method
Create a plugin
Override the Categories module to return 'Content' for AssetTarget()
Change the module sort order via config
Theme Method
Create theme
Override the default.master.tpl file and insert {module name="CategoriesModule"} where you want the categories to show up
Hide the original module via CSS.
Similar amount of work. I prefer the plugin route myself.
@hgtonight said:
Wrapping your modifications in a theme or plugin right now will save you a lot of headache later. Modifying core files prevents you from updating without breaking things.
Plugin Method
Create a plugin
Override the Categories module to return 'Content' for AssetTarget()
Change the module sort order via config
Theme Method
Create theme
Override the default.master.tpl file and insert {module name="CategoriesModule"} where you want the categories to show up
Hide the original module via CSS.
Similar amount of work. I prefer the plugin route myself.
Is it not possible to have the files I modified in side of my own theme folder?
If not, I guess I'll look at going the plugin route, is there any documentation on making a plugin as described?
Alright, what you need to do is add the categories module to the sort order of the content asset for the Vanilla application. Put $Configuration['Modules']['Vanilla']['Content'] = array('MessageModule', 'MeModule', 'UserBoxModule', 'NewDiscussionModule', 'ProfileOptionsModule', 'Notices', 'NewConversationModule', 'NewDiscussionModule', 'DiscussionFilterModule', 'CategoryModeratorsModule', 'CategoriesModule', 'Content', 'Ads'); in your /conf/config.php file. You will notice that this is just an array of module names. The order of the items determines the display order of each of those modules. I added 'CategoriesModule' right before 'Content' which is not to be confused with the asset but a special content module that holds the rendered view of the controller.
Then you need to copy the modules folder from the attached zip in your custom theme. You will have to disable/re-enable the theme to refresh the cache, IIRC. All that is in this folder is a copy of the class.categoriesmodule.php with the AssetTarget() method returning 'Content' instead of 'Panel'.
Now, whenever an application wants to add the categories module to a controller, the autoloader sees this modified version and will load it instead of the original core. It will put itself in the Content asset and your sorting config puts it above the pages content.
If you don't want to make it theme dependent, the attached zip is actually a plugin that can be used instead. You will still have to copy to configuration over manually for some technical reasons.
Comments
Thanks, I want to try and stay away from plugins at the moment. I've got it working with
public function AssetTarget() {
return 'listCategories';
}
in forum/applications/vanilla/modules/class.categoriesmodule.php
and then
in /applications/dashboard/views/default.master.tpl
Seems to do the trick
Wrapping your modifications in a theme or plugin right now will save you a lot of headache later. Modifying core files prevents you from updating without breaking things.
Plugin Method
Theme Method
{module name="CategoriesModule"}
where you want the categories to show upSimilar amount of work. I prefer the plugin route myself.
Search first
Check out the Documentation! We are always looking for new content and pull requests.
Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.
Is it not possible to have the files I modified in side of my own theme folder?
If not, I guess I'll look at going the plugin route, is there any documentation on making a plugin as described?
Thanks
If you place your current modifications in a theme, you are doing fine.
It just seems like a complicated approach when you could just change the asset target to content and the sort order via a config.
I can post some specific examples/steps when I wake up more.
Search first
Check out the Documentation! We are always looking for new content and pull requests.
Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.
Ideally I want to keep it separate to other themes etc so when it comes to uploading or editing later I can just change files in my theme folder.
Yes please, if you can upload any examples you think will help. It's the 1st that time I'm working with Vanilla so the more the merrier
Alright, what you need to do is add the categories module to the sort order of the content asset for the Vanilla application. Put
$Configuration['Modules']['Vanilla']['Content'] = array('MessageModule', 'MeModule', 'UserBoxModule', 'NewDiscussionModule', 'ProfileOptionsModule', 'Notices', 'NewConversationModule', 'NewDiscussionModule', 'DiscussionFilterModule', 'CategoryModeratorsModule', 'CategoriesModule', 'Content', 'Ads');
in your/conf/config.php
file. You will notice that this is just an array of module names. The order of the items determines the display order of each of those modules. I added 'CategoriesModule' right before 'Content' which is not to be confused with the asset but a special content module that holds the rendered view of the controller.Then you need to copy the modules folder from the attached zip in your custom theme. You will have to disable/re-enable the theme to refresh the cache, IIRC. All that is in this folder is a copy of the class.categoriesmodule.php with the AssetTarget() method returning 'Content' instead of 'Panel'.
Now, whenever an application wants to add the categories module to a controller, the autoloader sees this modified version and will load it instead of the original core. It will put itself in the Content asset and your sorting config puts it above the pages content.
If you don't want to make it theme dependent, the attached zip is actually a plugin that can be used instead. You will still have to copy to configuration over manually for some technical reasons.
Search first
Check out the Documentation! We are always looking for new content and pull requests.
Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.