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.

Adding Link to Navigation Bar and Logo

edited April 2012 in Vanilla 2.0 - 2.8

Hi everyone I know this has been discussed countless times in here but I'm such a newbie I think they skip things that I just dont get.

All I want to do is and a link back from my vanilla forum to my website. I would like to be able to do this two ways. 1. By Clicking on the Logo 2. Also adding a link in the navigation bar.

I have read countless post and they do provide code but I have no idea where to add that code. I usually just fix the code in my Wordpress editor as I have very limited knowledge of FTP. So wondering if anyone can she some light?

If there is no other way to do it beside FTP can some be kind enough to give a set by step.

Really appreciate any help.

Best Answers

  • whu606whu606 I'm not a SuperHero; I just like wearing tights... MVP
    edited April 2012 Answer ✓

    To add a link to the menu:

    If you don't already have one, create a theme for your forum, using this guide:

    http://vanillaforums.org/docs/themequickstart

    Add a folder called views so that the structure is:

    /themes/yourthemename/views

    Go to applications/dashboard/views and copy the default.master.php file to your new views folder.

    You don't need to worry about the css file, as you only need to change the default.master.php file at this point.

    Open the default.master.php file you have copied over, and look for this:

        <?php
        $Session = Gdn::Session();
        if ($this->Menu) {

    and below it add:

    $this->Menu->AddLink('Linktitle', T('Linktitle'), 'http://www.linkaddress.com/');

    where, obviously, you replace 'Linktitle' with the name of your link; Home, MySite, etc.

    You're done.

    Not sure about changing the logo link, but I'm sure someone else will help with that.

  • whu606whu606 I'm not a SuperHero; I just like wearing tights... MVP
    Answer ✓

    The logo link question is answered here:

    http://vanillaforums.org/discussion/19225

  • whu606whu606 I'm not a SuperHero; I just like wearing tights... MVP
    Answer ✓

    The 'themes' folder should be part of the normal Vanilla folder structure, which contains folders such as 'applications', 'cache' etc.

    So wherever you have your Vanilla installation (e.g in a folder called 'Vanilla' 'forum' etc.) you should find the 'themes' folder.

    Inside that there should be a folder called 'default'.

    If, for any reason there isn't, then just create the folders and sub-folders so you have

    applications
    cache
    conf etc.
    ..
    ..
    themes/views/default.master.php

  • whu606whu606 I'm not a SuperHero; I just like wearing tights... MVP
    Answer ✓

    @mikeymccoy

    The suggestions assume you have access to manage and edit your files on your host's server, typically through something like cPanel, which allows you to view your site folders and files in an 'Explorer' type interface.

    Who are you hosted by?

  • whu606whu606 I'm not a SuperHero; I just like wearing tights... MVP
    Answer ✓

    @mikeymccoy

    As far as I can see, with the basic GoDaddy package you don't get CPanel, but there seems to be their own version.

    You should still be able to edit folders and files, without using FTP, just using the manager.

    Does this help?

    http://support.godaddy.com/help/3972/creating-directories-on-your-windows-hosting-account

    If you think you might, over time, want to make more changes, I would recommend setting up a local site on your PC.

    I'm on Windows (no, you lot, stop laughing, it works...) and use xampp, which is very straightforwards, and installs everything you need to get Vanilla working on your PC.

    Once you have it set up, you could then make any necessary changes on your local PC, and then just ftp the changed files to GoDaddy.

Answers

  • whu606whu606 I'm not a SuperHero; I just like wearing tights... MVP
    edited April 2012 Answer ✓

    To add a link to the menu:

    If you don't already have one, create a theme for your forum, using this guide:

    http://vanillaforums.org/docs/themequickstart

    Add a folder called views so that the structure is:

    /themes/yourthemename/views

    Go to applications/dashboard/views and copy the default.master.php file to your new views folder.

    You don't need to worry about the css file, as you only need to change the default.master.php file at this point.

    Open the default.master.php file you have copied over, and look for this:

        <?php
        $Session = Gdn::Session();
        if ($this->Menu) {

    and below it add:

    $this->Menu->AddLink('Linktitle', T('Linktitle'), 'http://www.linkaddress.com/');

    where, obviously, you replace 'Linktitle' with the name of your link; Home, MySite, etc.

    You're done.

    Not sure about changing the logo link, but I'm sure someone else will help with that.

  • whu606whu606 I'm not a SuperHero; I just like wearing tights... MVP
    Answer ✓

    The logo link question is answered here:

    http://vanillaforums.org/discussion/19225

  • whu606 I really appreciate you taking the time to help me so thank you. But its at the very first step that I was and still am having a problems with. I went to the quickstart guide but when it says "Copy the /themes/default folder and rename it to your theme name so it sits in the root theme folder like this: /themes/your_theme_name" what I want and need to know is where is the /themes/default folder. I have no idea where to find that so can't begin to do anything. If you are able to tell me where that is that would really help.

  • You might consider spending a few moments scanning things here first, if that doesn't solve it ask again.

    http://vanillawiki.homebrewforums.net/index.php/Folder_Structure

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • whu606whu606 I'm not a SuperHero; I just like wearing tights... MVP
    Answer ✓

    The 'themes' folder should be part of the normal Vanilla folder structure, which contains folders such as 'applications', 'cache' etc.

    So wherever you have your Vanilla installation (e.g in a folder called 'Vanilla' 'forum' etc.) you should find the 'themes' folder.

    Inside that there should be a folder called 'default'.

    If, for any reason there isn't, then just create the folders and sub-folders so you have

    applications
    cache
    conf etc.
    ..
    ..
    themes/views/default.master.php

  • Thanks for you help whu606 I was not able to figure it out but I think that has more to do with my limited knowledge. Anyway thanks for support advice. Cheers Michael

  • mikeymccoy
    Thanks for you help whu606 I was not able to figure it out but I think that has more to do with my limited knowledge. Anyway thanks for support advice. Cheers Michael

    GOOD!

  • whu606whu606 I'm not a SuperHero; I just like wearing tights... MVP
    Answer ✓

    @mikeymccoy

    The suggestions assume you have access to manage and edit your files on your host's server, typically through something like cPanel, which allows you to view your site folders and files in an 'Explorer' type interface.

    Who are you hosted by?

  • I have a very basic understanding of FTP as I have only been using it for two days so a real newbie. So attempted to followed your directions. I created a file on my computer desktop named "Rx" then opened that file and put another folder inside that called called "views." I then uploaded that through FileZilla to themes/

    I then went to applications/dashboard/views found the the default.master.php but I was not sure how to copy it. I tried to right click and then selected "copy URL(s) to clipboard" but that did not work. I'm not sure if I should drag and drop it into the file I created.

    Yes I do have access to edit my files. I am with GoDaddy.

  • whu606whu606 I'm not a SuperHero; I just like wearing tights... MVP
    Answer ✓

    @mikeymccoy

    As far as I can see, with the basic GoDaddy package you don't get CPanel, but there seems to be their own version.

    You should still be able to edit folders and files, without using FTP, just using the manager.

    Does this help?

    http://support.godaddy.com/help/3972/creating-directories-on-your-windows-hosting-account

    If you think you might, over time, want to make more changes, I would recommend setting up a local site on your PC.

    I'm on Windows (no, you lot, stop laughing, it works...) and use xampp, which is very straightforwards, and installs everything you need to get Vanilla working on your PC.

    Once you have it set up, you could then make any necessary changes on your local PC, and then just ftp the changed files to GoDaddy.

  • edited April 2012

    Ok I figured it out! So happy and excited :)

    The issue I was having was adding a new folder etc. So instead I just tried going straight into forums > applications > views > default.master.php then edited the line of code you provided above and boom! Done!

    Thanks so much for sticking with me @whu606. I had given up till you posted a few more directions yesterday so I thought I should go back and give it a try.

    Really cannot thank yourself and the community on here for being so helpful. I am very appreciative. Thank you thank you thank you!

    Cheers Michael

  • whu606whu606 I'm not a SuperHero; I just like wearing tights... MVP

    @mikeymccoy

    Glad you got it sorted!

    However, you have edited a core file.

    This is not a problem in itself, especially if it is the only change you make, but it will be over-written the next time your Vanilla is upgraded.

    This is why it is recommended that changes are made in a custom themes folder.

    When you have the time/energy, it would be worth working out how to add a custom theme folder.

    You're welcome for any help I've been.

    I've had loads of help from people on here, so it's nice to give a bit back.

Sign In or Register to comment.