Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Creating a Template
keesha
✭
Hey and first of all i'd like to report back after many years of abstinence
So i'm about to create a theme and i need to change and rearange the whole structure of the recent discussions for example, therefore i need to alter the base files since to alter the css or the default.master template wouldn't be enough anymore for my special venture.
So what is the exact procedure? To copy & paste the original vanilla files i'd like to change into the themes/mytheme folder and go for it?
Thanks
0
Answers
@keesha
Without knowing exactly what you want, it's not easy to say, but you can customise views.
See here: http://docs.vanillaforums.com/theming/views/
Note that you need to keep the same folder structure within your theme.
Hi @whu606 ,
So just as i thought its just copy the main view structure into the view structure of my theme.
All i'm trying to do right now is to split up the single row column of each topic in the recent discussions section into three horizontal columns like:
from:
I______________________I
into:
I_______I_______I_______I
Baaam! Found it in helper_functions.php
Happy days
This doesn't require a view override.
CSS is very powerful and vastly preferred over overrides.
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.
Hi
I need do implement additional functions into those columns otherwise you would be right.
What kind of functions? Themes are not the way to add functionality. Plugins are best for that.
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.
I try to add excerpts under each discussion title since there doesn't seem to be a working plugin for vanilla for this job.
To code a plugin is beyond my abilities right now, i'm okay with pure frontend stuff as far as its basic HTML, PHP and CSS but that's it.
This makes no sense. How are you going to create an excerpt for each discussion if you don't know how to use the framework?
https://vanillaforums.org/addon/example-plugin
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.
It is far more simple than you think. If you know basic PHP, you will have no problems
If you are creating a theme, add a themehooks file:
Then activate the plugin "eventi". It will show you the name of the events that you need. Simply spoken: whenever an event is fired, you are able to insert code or change the output. If you are not quite sure how to get/change information, just ask. Here are some examples that change the way the discussions helper functions work.
If you look through the file, you'll find a line
$Sender->fireEvent('BetweenDiscussion');
and here is how you can insert code at this place:And there is also the event "BeforeDiscussionName" (I skip the php code around it). You'll find several similar looking lines like that before the call
$Sender->EventArguments['something'] = ...;
. Those variables are accessible in the plugin/themehooks file.You get the pattern? When there is a fireEvent, you can insert html or change the output. Just try it.
Changing core files is more work in the long run, because you have to update all changes when a new version of Vanilla is out.
The themehooks file must be in your theme folder as class.yourthemenamethemehooks.php (see mobile theme as an example)
Hi @R_J ,
Thank's for the help, i'm going to try your little tutorial ASAP.
Hi @keesha - I hope you were successful in your plugin writing to get excerpts. If not you may take a look at the source of DiscussionExtract plugin which extract content and displays it in discussion lists.