Fork me on GitHub
Current release is 2.1.6 (21 Nov 2014).

Users who have not yet upgraded to 2.1 should get security release 2.0.18.14 (1 Nov 2014). We will stop providing these security releases to 2.0 at the end of this year.

Adding links to footer

SheilaSheila ✭✭
edited July 2012 in Vanilla 2.0 Help

Hi!

I'm trying to add some top menu links like Discussions, Activity, Sign out etc. to footer (div #Foot) also.

I guess the solution is mentioned here, http://vanillawiki.homebrewforums.net/index.php/Using_Smarty_with_Vanilla. Could somebody walk me thru with how to use the asset foot? I can't much handle any other method than copypaste when it comes to coding...

Comments

  • UnderDogUnderDog Moderator
    edited July 2012

    What you're looking for is these types of smarty 'tags' :

    {dashboard_link}
          {discussions_link}
          {activity_link}
          {inbox_link}
          {profile_link}
          {custom_menu}
          {signinout_link}

    so you can use them in your footer:

    < div id="Foot" >{dashboard_link}
          {discussions_link}
          {activity_link}
          {inbox_link}
          {profile_link}
          {custom_menu}
          {signinout_link}< /div >

    Unfortunately, that part of asset name = 'Foot' is for items that want to be generated in the footer, like debugging information (a stage you've luckily passed already). So figure out which types of links you want in your footer, let it know in this thread and you can either use a smarty 'tag' or just simple plain HTML, which is easier.

    Sheila
  • SheilaSheila ✭✭

    Thank you! I think that one or two examples are enough, and then i'm hopefully able to figure out the rest. Going to add all other links than dashboard and activity link.

  • SheilaSheila ✭✭

    Hi!

    Would loooove some help with this. All I'm able to get is 'unexpected string on line this and that' with my experiments... :)

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

    @Sheila

    Can you post up what you have added to the default.master?

    Is it .tpl or .php?

    Sheila
  • SheilaSheila ✭✭

    Hi!

    It's default.master.php which I'm trying to edit and there's the part

    echo "<div class='footLink'>Powered by $VanillaAnchor</div>"; 
    

    within I'm trying to add links and back to top -javascript with absolutely no success yet.

  • peregrineperegrine ☯ hasta luego :) In-Flight MVP

    Post the lines that caused you the error.

    you either left out a semi-colon or munged up your quotes.

    Monetary Donations will be appreciated if you use my plugins. Thanks in Advance.
    As a waiter gets a tip for a good meal, tips for successful solutions appreciated as well. click here for Peregrine | click here for FAQ

  • SheilaSheila ✭✭

    Tried to add this

    <a title="Back to top" href="javascript:window.scrollTo(0,0);">Back to top</a></div>
    

    within the div and with getting the menu links to footer haven't gotten even that far.

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

    @Sheila

    I just tried this and it works (after a fashion...)

    add

    if ($this->Menu) {
                            $this->Menu->AddLink('TEST', T('TEST'), 'http://www.bbc.co.uk');
                            }
                            echo $this->Menu->ToString();

    After

    <pre>$this->RenderAsset('Foot');<\pre>
    
    Sheila
  • 422422 Developer MVP
    edited July 2012

    Deleted I cannot post code here it does my head in ( emailed you instead -s- )

    422 Real Estate Australia , now open Check it out

    Sheila
  • SheilaSheila ✭✭
    edited July 2012

    whu606 said: add

       if ($this->Menu) {
     $this->Menu->AddLink('TEST', T('TEST'), 'http://www.bbc.co.uk');
     }
     echo $this->Menu->ToString();
    

    Thanks again @whu606 ! Almost there. It added menu links of custom pages, plugin link 'Mark all Read' (which I'd like not to have in footer) and sign out so the result is Mark all Read / Faq / Contact / Sign Out.

    What I'm trying to get to the footer is Discussions / Activity / Inbox / Profile / Faq / Contact / Sign out / Back to top.

    BUT I think that this

    $this->Menu->AddLink('TEST', T('TEST'), 'http://www.bbc.co.uk'); 
    

    might be a good solution, if I only would get that to work solo, since I don't necessarily need Profile and Sign Out links that are unique, and could use that in order to add other links hardcoded.

    422 said: Deleted I cannot post code here it does my head in ( emailed you instead -s- )

    :) Appreciated! Will look in to that. And understand totally. It would have taken about two years of your life to post that code with Markdown.

  • peregrineperegrine ☯ hasta luego :) In-Flight MVP
    edited July 2012
      $this->RenderAsset('Foot');
                if ($this->Menu) {
                   $Session = Gdn::Session();
                  $Authenticator = Gdn::Authenticator();
                  $this->Menu->ClearGroups();
    
                     $this->Menu->AddLink('A', T('Back'), '#');
    
                    $this->Menu->AddLink('A', T('Sign Out'), $Authenticator->SignOutUrl(), FALSE, array('class' => 'SignOut'));
    
                     $this->Menu->AddLink('A', T('Contact'), '/contact');
                     $this->Menu->AddLink('A', T('Faq'), '/faq');
                    $this->Menu->AddLink('A', $Name, '/profile/{UserID}/{Username}', array('Garden.SignIn.Allow'), array('class' => ''));
                    $this->Menu->AddLink('A', T('Inbox'), '/messages/all');
                    $this->Menu->AddLink('A', T('Discussions'), '/discussions');
                    $this->Menu->AddLink('A', T('All Activity'), '/activity');
    
    
                 echo $this->Menu->ToString();
                }
    

    ?>

    you will need to change the third parameter for contact and faq obviously.

    If they are all in the same group A - the order of adding links seems to be a prepending.

    Monetary Donations will be appreciated if you use my plugins. Thanks in Advance.
    As a waiter gets a tip for a good meal, tips for successful solutions appreciated as well. click here for Peregrine | click here for FAQ

    Sheila
  • SheilaSheila ✭✭
    edited July 2012

    Thanks! Everything else is there, except with Profile link I get:

    Fatal error: Call to a member function SignOutUrl() on a non-object in ... /test/themes/default/views/default.master.php on line 105

    Not to mention, I now have a very inpractical, but thankfully cute dropdown list in my footer, haha. Thanks to Categories2Menu -plugin. Will be very interesting to override everything it does with custom css rules. Will let you know, when or if I find a best solution to that.

    To be honest, I love Vanilla 2. But adding few links to a footer really should not be this big issue.

    Is it worth of trying to use just basic include <?php include('inc_links.php'); ?> and call somewhat more hardcoded links from outside file?

  • peregrineperegrine ☯ hasta luego :) In-Flight MVP

    $Session = Gdn::Session();
    $Authenticator = Gdn::Authenticator();

    do you have this in there.

    I often re-edit my messages to the bitter end.

    Monetary Donations will be appreciated if you use my plugins. Thanks in Advance.
    As a waiter gets a tip for a good meal, tips for successful solutions appreciated as well. click here for Peregrine | click here for FAQ

  • peregrineperegrine ☯ hasta luego :) In-Flight MVP

    $Session = Gdn::Session();
    $Authenticator = Gdn::Authenticator();

    do you have this in there.

    I often re-edit my messages to the bitter end.

    To be honest, I love Vanilla 2. But adding few links to a footer really should not be this big issue.>

    that's why they recommend the .tpl instead of the .php for the

    default.master

    Monetary Donations will be appreciated if you use my plugins. Thanks in Advance.
    As a waiter gets a tip for a good meal, tips for successful solutions appreciated as well. click here for Peregrine | click here for FAQ

    Sheila
  • SheilaSheila ✭✭
    edited July 2012

    peregrine said: that's why they recommend the .tpl instead of the .php for the

    Then why even the default theme (correct me If I'm wrong) comes with default.master.php and not with .tpl? Confusing :D

    I'll restart my experiments tomorrow.

  • peregrineperegrine ☯ hasta luego :) In-Flight MVP
    edited July 2012

    not in vanilla 2.1 - I was corrected by Todd.

    The Smarty theme template is easy to add a link and just about impossible to do anything else with inside the vanilla paradigm without a "Smarty Advanced user certification". And there may only be one or two people worlwide with that cert. :)

    I should also place credit, where credit is due. I learned most of the above from @mcu_hq's Traditional Chocolate theme (the guy is a wizard with vanilla methods).

    Monetary Donations will be appreciated if you use my plugins. Thanks in Advance.
    As a waiter gets a tip for a good meal, tips for successful solutions appreciated as well. click here for Peregrine | click here for FAQ

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

    @Sheila

    It is much easier with the tpl.

    I tried both while I was replying to you.

    I've just started working with 2.1 - if you are going to make changes to your forum, it might be best to make them in 2.1, rather than end up doing it twice.

    Sheila
  • UnderDogUnderDog Moderator

    whu606 said: I've just started working with 2.1 - if you are going to make changes to your forum, it might be best to make them in 2.1, rather than end up doing it twice.

    Ahum... I agree a bit, but, it's making changes to your forum's theme and not to your forum itself.
    You shouldn't make changes to your forum itself, (that goes without saying), that's what plugins and applications are for.

    Sheila said: To be honest, I love Vanilla 2. But adding few links to a footer really should not be this big issue.

    Sheila, you are absolutely right. You just happen to mix up 2 types of the template : the .php way and the .tpl way. As peregrine said, just stick with the .tpl way for now (and restart the experiment, as you already said).
    The .php way you will quite easily miss a ; ' ` etc. With the .tpl way you will most likely not find any strubblings for a while...

    Sheila
  • SheilaSheila ✭✭
    edited July 2012

    whu606 said: @Sheila I've just started working with 2.1 - if you are going to make changes to your forum, it might be best to make them in 2.1, rather than end up doing it twice.

    Too late! :D Minus the footer, contact form and few other small css tweaks, my new theme is ready. And not like I started it from scratch, it's based on @422 's excellent Air.

    If extremely stable 2.1 comes out next monday, in that case I might have done things in vain. But most likely it will take some more time? Not to mention the plugins.

    With Invision I was actively involved since alpha releases of 2.xxx, I don't have time nor hunger to be that much of a tester anymore. Naturally I contribute bug reports if needed, but am more of a finished release kinda girl now adays and prefer waiting thru few version numbers before upgrading. And have to think my users too, they've had their fair share of parse errors and wsods during those years, thanks to me.

    Sheila, you are absolutely right. You just happen to mix up 2 types of the template : the .php way and the .tpl way.

    @UnderDog So the smarty tags are only for .tpl -files, I guess? I'm not totally stranger to .php since all cms, blog and forum softwares I've worked and played with have been based to that. (Minus few years with Movable Type which was in perl). Guess I still see some things too much of a IPB way, since addons there were often practically instructions to modify the core: go to the file y, find a line x and remove that. Then go to the file z, and starting from line v copypaste this code. And that way I made my modifications successfully. And with local folder containing all the files I've tampered with, it wasn't that hard to keep up with upgrades, even with some duplicate work involved.

    So there's definitely still things here to get used to, and not in a bad way at all! Still amazed that same kind of results can be achieved with just uploading and activating a addon. But then again, restrictions might come up when there isn't a addon.

    Did I just hijack my own thread? Well, back to the footer-thingie. Hope that is with .tpl files one of the things easier in 2.1.

    I so much prefer Vanilla's lightness and non table approach compared to legacy forums but there's excessive scrolling and usage of back-button involved with 'out of the box'-version. Breadcrumbs, top and bottom paging and footer links make the layout more cluttered but they improve usability significantly.

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

    @Underdog

    Yes, I meant changes to the theme.

    In my case, my current theme has a.php default.master, and 2.1 seems to prefer to use.tpl, so I need to make changes based on that.

  • UnderDogUnderDog Moderator

    Sheila said: If extremely stable 2.1 comes out next monday, in that case I might have done things in vain. But most likely it will take some more time? Not to mention the plugins.

    I understand what you mean, but no, 2.1 doesn't come out monday in an extremely stable state, as far as I know...

    With Invision I was actively involved since alpha releases of 2.xxx, I don't have time nor hunger to be that much of a tester anymore. Naturally I contribute bug reports if needed, but am more of a finished release kinda girl now adays and prefer waiting thru few version numbers before upgrading.

    Oooh, we could so use your help, just a little peek at the alpha version of 2.1 when it comes out...

    And have to think my users too, they've had their fair share of parse errors and wsods during those years, thanks to me.

    LOL, If you can tell me the equivalent of a wsod with Vanilla, I'll give you an extra 'like' for that post.

    @UnderDog So the smarty tags are only for .tpl -files, I guess?

    Yes, Smarty tags to in the .tpl files.

    Guess I still see some things too much of a IPB way, since addons there were often practically instructions to modify the core: go to the file y, find a line x and remove that. Then go to the file z, and starting from line v copypaste this code. And that way I made my modifications successfully.

    The only way you need to do those actions again is when you need specific debugging information from a function inside Vanilla (as far as I know)

    So there's definitely still things here to get used to, and not in a bad way at all! Still amazed that same kind of results can be achieved with just uploading and activating a addon. But then again, restrictions might come up when there isn't a addon.

    That's the fun part of a community. When you need an addon, you can ask for it. Maybe more people need it and the addon can be created.

    ...but there's excessive scrolling and usage of back-button involved with 'out of the box'-version.

    That's the exact type of feedback we need, in my opinion. Maybe a 'feature request' for 2.1 could be 'add pagination and breadcrumbs for ui-improvement' with a nice explanation of what, where and how of course :-)

    Sheila
  • SheilaSheila ✭✭

    UnderDog said:

    With Invision I was actively involved since alpha releases of 2.xxx, I don't have time nor hunger to be that much of a tester anymore. Naturally I contribute bug reports if needed, but am more of a finished release kinda girl now adays and prefer waiting thru few version numbers before upgrading.

    Oooh, we could so use your help, just a little peek at the alpha version of 2.1 when it comes out...

    It's not like I was in any team, but in a way when ever there was an upgrade or patch available, within few hours I had it up and running on my board and was reporting possible bugs.

    And have to think my users too, they've had their fair share of parse errors and wsods during those years, thanks to me.

    LOL, If you can tell me the equivalent of a wsod with Vanilla, I'll give you an extra 'like' for that post.

    I was able to produce one only few days ago, unfortunately I don't have that file left anymore :D

    ...but there's excessive scrolling and usage of back-button involved with 'out of the box'-version.

    That's the exact type of feedback we need, in my opinion. Maybe a 'feature request' for 2.1 could be 'add pagination and breadcrumbs for ui-improvement' with a nice explanation of what, where and how of course :-)

    Thanks! I'm willing to help with 2.1 alpha, since usability is my passion and being involved with open source projects on my free time improves me professionally. I firmly believe every ui/ux/concept/content/usability whatever designer should get their hands dirty with real stuff occasionally and that's one of the reasons why I'm back with playing with my own forum.

    But can't promise I'll do actual testing excessively on own board (It's a miracle it is still running quite smoothly after 15 and more IPB upgrades, 3 server and database changes and a change of software two times) so if there's a 2.1 somewhere I can test as a user, just invite me.

  • UnderDogUnderDog Moderator

    Sheila said: But can't promise I'll do actual testing excessively on own board (It's a miracle it is still running quite smoothly after 15 and more IPB upgrades, 3 server and database changes and a change of software two times) so if there's a 2.1 somewhere I can test as a user, just invite me.

    I can help you set up a local server (called WAMP) and then you can test on your local PC. There probably won't be a live test version of Vanilla, as far as I can see, just lots of local versions :-)

  • SheilaSheila ✭✭
    edited July 2012

    Thanks! That is a good way of testing with no doubt! I just never really got familiar with WAMP so I've always done my test installations on live server and protected them with .htaccess

    From especially usability point of view, I personally value the approach that means real users in real, non simulated situations. This is just imo, but I feel you can't beat live testing with for example posting test posts under different user accounts compared to 'seeing' how actual users behave, which elements they seem to click, how they really understand how the selected formatting tool for posts works etc.

    I naturally can't be that genuine tester as a person working for web but I do try to behave like one and tend to keep in mind and obey for example Don’t Make Me Think -rules in even every day surfing and which are still fundamental.

    And THAT is what makes things interesting to me and provides a constant learning curve. For example on my board I replaced language string for 'Forgot?' with just question mark, since I thought that is so obvious, I was quickly proven to be wrong.

    UnderDog
  • 422422 Developer MVP

    I never work locally, i always work on live servers.

    422 Real Estate Australia , now open Check it out

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

    @Sheila

    I do my planning and testing on a local server, then I upload it to my backup forum folder, which uses the same DB as the live one, so you get the best of both worlds - live interactions that don't affect the smooth running of the forum.

    You can always invite some of your users to test the new version and get responses that way.

Sign In or Register to comment.