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.
I need to add a custom link to the logo in the header - not hard-coded but from the config file.
TheBrad
New
I need to make the {link path="home"} to be a URL from the config.php file and have no idea how to do this in Vanilla
All the php code i put in the default.master.tpl gets ignored.
I want to do something link have it set in the config.php like this:
$Configuration['Routes']['CustomUrlLink'] = 'https://customurllink.com';
and then the url would be $CustomUrlLink
so... I guess like: {logo}
Any help would be greatly appreciated.
Thanks
0
Comments
This already works
grep is your friend.
Though I wouldn't do unless you are using a cdn like location for the file.
grep is your friend.
Okay so to use it in an href it should be like this?
$Configuration['Garden']['CustomUrlLink'] = 'http://customlinkurl.com';
Then in the default.master.tpl:
< a class="navbar-brand" href="{CustomUrlLink}" >{logo} < /a > - breaks and the page won't load.
Current code is: < a class="navbar-brand" href="{link path="home"}" >{logo}< /a >
I want to be able to set: {link path="home"}.
Is this possible?
You'll need a custom smarty function, see here for some ways to implement that: http://vanillaforums.org/discussion/27767/how-to-create-custom-smarty-functions
It could be as easy as that: https://github.com/vanilla/vanilla/blob/2.1/library/vendors/SmartyPlugins/function.vanillaurl.php
The T() function is also available in Smarty
http://docs.vanillaforums.com/theming/smarty/i18n/
So you can do
{t c="HomeLink"}
and create the file /conf/locale.php
My themes: pure | minusbaseline - My plugins: CSSedit | HTMLedit | InfiniteScroll | BirthdayModule | [all] - PM me about customizations
VanillaSkins.com - Plugins, Themes and Graphics for Vanillaforums OS
That worked like a charm Bleistivt. Thanks everyone for your help.
Das ist klug, @Bleistivt
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.