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.
How to add conent under Category panel, which temple file to edit?
Im running a hosted 2.0.18.10 version.
With Default theme by Mark O'Sullivan.
I have found which css files to edit in order to make minor theme tweaks, but i now would like to add some content under the Category panel and cant figure out which template files to edit.
I have read the Theme Guide but the file structure is not same on latest firmware or the default theme.
http://vanillaforums.org/docs/themeguide/function
Is there any guide i have failed to find or can anyone explain how to add custom content, thank.
Tagged:
0
Comments
@vanillauzer
Welcome to the community.
Any css or html/php changes should be made in a custom theme.
Editing core files is self-defeating in the long-term.
See the community wiki entry here: http://vanillawiki.homebrewforums.net/index.php/A_Quick-Start_Guide_to_Creating_Themes
for how to set up a custom theme.
@whu606
Thank you.
I have followed the quick guide and created, edited and enabled the custom theme.
After reading both documentation pages i still cant figure out which file i should edit to get what i want.
I understand i need to find the right view file, copy it to the new custom theme and edit it, but i cant figure out which of them would allow me to add a small banner under the category panel.
I would appreciate very much if anyone could point me in the right direction, thanks.
well there are several ways this way is the easiest in my opinion. You need to either create a small plugin or add this to your theme default.master.php
If you look at the MyTabs plugin , you will see a js file with some jquery inside to add links from my tabs to the panel used the append or prepend technique .
You can use this jquery to send something before or after anything once you have it's class or id name. This is for the categories box in the panel
❌ ✊ ♥. ¸. ••. ¸♥¸. ••. ¸♥ ✊ ❌
the easiest way in my opinion is to just add a message from the dashboard.
and sort the MessageModule it via
http://vanillaforums.org/discussion/20698/move-bookmarked-discussions-to-bottom-of-sidebar
http://vanillaforums.org/discussion/comment/204116/#Comment_204116
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
below the Category panel in a new panel or within the panel but at the bottom of the category panel.
aside fro v's sugestion and the messages option ...
you could use the forum donate plugin and add what you want inside. It's basically a blank slate for adding a new panel.
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
In general, JS shouldn't be used to add static content to the DOM. This goes double for "necessary" content. Plenty of people browse with JS disabled by default. Other than that, it decreases the ability for other plugins to interact with that DOM element since it is no longer guaranteed to be there when the document.ready event fires.
If you want to insert static content before or after the entire sidepanel, you would modify the default.master template. If you want to insert content between modules, you would add in a theme hook. If you want to add something that is only after a specific module, override that module's view (if possible).
I am happy to help you pick the best way and guide you through it.
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.
@peregrine
Thanks for both suggestions.
The MessageModule looks fairly easy and does what i want.
A follow up question, as the MessageModule has a Appearance option and adds a border around the content:
Would it be difficult to create a 4th Appearance option with no border as i plan to use images / banner and would be great to have no borders.
I will also look into the Donate plugin.
@hgtonight
Here is what i had in mind to add after the Category panel, Banner 1 and Banner 2.
And here is how it looks now:
http://www.smartqwatch.com/forum/discussion/5342/zwatch-custom-roms-feel-free-to-post-your-opinions-and-reviews-on-custom-roms/p1
Are these banners static?
Should they always be shown at the bottom of the panel (regardless of page)?
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 would like to use image banners, or if possible also HTML for banner ad code.
Yes, banners should show under the panel and on both Discussions and Comment pages.
What you are really looking for is an ad serving plugin. Check out Apt Ads by @x00 for an excellent plugin.
http://vanillaforums.org/addon/aptads-plugin
If that doesn't work, or you really aren't going to change the ads out very often, you can just insert these banners into your theme's default.master.tpl file. You should be able to find it at
/themes/smartq/views/default.master.tpl
. It may be a PHP file. It also may not currently exist there.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 do not have the default.master.tpl in smartq theme as i used the default one to create a custom theme.
I understand i have to copy the default file from /applications/dashboard/views/ but there is no default.master.tpl but:
default.master.php
and
empty.master.tpl
Should i use the .php or .tpl version?
Thanks for all your help.
default.master.php is the default default.master template. Copy that over into your theme's views folder. Then add your content on line 53 like below:
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.
@hgtonight
Thank you, exactly what i wanted.