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.
Options

how do i remove Activity from header

jeongweejeongwee Vanilla version 2.6 ✭✭

and change Discussions to Categories . and rename the title (Categories) to Forum.

2.png 228.2K

Best Answer

Answers

  • Options
    R_JR_J Ex-Fanboy Munich Admin
    Answer ✓

    You can hide anything by finding out it's css id or class and style it with a display:none.
    For v2.0.18.8 it would be ul#Menu > li.Activity {display: none;}

    For renaming discussions, there are quite a few discussions already: https://www.google.be/?gws_rd=cr#bav=on.2,or.r_cp.r_qf.&fp=892391153152ab87&q=site:vanillaforums.org+rename+discussions&safe=off

  • Options
    jeongweejeongwee Vanilla version 2.6 ✭✭

    forgot to use display:none to hide it,but the 2nd question still havnt solved .....

  • Options
    AdrianAdrian Wandering Spirit Montreal MVP
    edited August 2013

    Personally, I still like to see activity, so what I do is in my template, I will set to only those with moderation ability being able to see it, like so:

    $this->Menu->AddLink('Activity', T('Activity'), '/activity', array('Garden.Moderation.Manage'));

  • Options
    jeongweejeongwee Vanilla version 2.6 ✭✭

    @adriansonline
    thx but which specific file shud i add this code,i donno know where shud i add it.

  • Options
    ShadowdareShadowdare r_j MVP
    edited October 2013

    You would add the code in a file called class.mythemethemehooks.php in your theme like this:

    class.mythemethemehooks.php

    <?php if (!defined('APPLICATION')) exit();
    
    class mythemeThemeHooks implements Gdn_IPlugin {
       public function Base_Render_Before($Sender) {
          if($Sender->Menu && $Sender->MasterView != 'admin') {
             $Sender->Menu->AddLink('Activity', T('Activity'), '/activity', array('Garden.Moderation.Manage'));
          }
       }
    }
    
    

    Make sure you clear your cache files after creating the file.

    Add Pages to Vanilla with the Basic Pages app

  • Options
    jeongweejeongwee Vanilla version 2.6 ✭✭
    edited August 2013

    @Shadowdare
    =.= ...im noob ,still not found where the class.mythemethemehoooks.php file located.... is it under /themes/mytheme/? i don have it under themes/mytheme/ . i created one txt file and changed name to class.mythemethemehooks.php and added the code, seems doent working. may i know how do i just hide the Activity for all role..... i really don wanna see it,coz i can open it at left side panel also. i tryed use css to hide,but failed .coz i had other options on the menu by created by basic pages app on my localtest. so i wanna hide it via php code. and how do i change the Discussions to Categories ?here is my site http://15min.cc/ 所有话题=discussions 动态=

  • Options
    jeongweejeongwee Vanilla version 2.6 ✭✭

    @vrijvlinder
    how do u hide a 2nd element vis css?is it possible? i know theres a :first-child,but theres no second-child......

  • Options
    vrijvlindervrijvlinder Papillon-Sauvage MVP
    edited August 2013

    you can use this to add css to any number of children, except stepchildren lol

    li:nth-child(2) > a
    li:nth-child(3) > a
    li:nth-child(4) > a
    

    etc

  • Options
    jeongweejeongwee Vanilla version 2.6 ✭✭

    @vrijvlinder its too useful for me thx

  • Options
    vrijvlindervrijvlinder Papillon-Sauvage MVP
    edited August 2013

    you know you should add a translate this button to your site so those of us who can't read chinese very good can see it in english? look nice though

    http://translateth.is

  • Options
    jeongweejeongwee Vanilla version 2.6 ✭✭
    edited August 2013

    @vrijvlinder where shud i add the code to show it?the site didnt tell me=.=

  • Options
    vrijvlindervrijvlinder Papillon-Sauvage MVP

    Not sure what you want to change but this would be css but you can also use js.

    I would first try it with css assuming it is the menu :

    #Menu ul li:nth-child(2) > a{
    display:none;
    }
    
  • Options
    jeongweejeongwee Vanilla version 2.6 ✭✭

    @vrijvlinder i mean the translate code....

  • Options
    vrijvlindervrijvlinder Papillon-Sauvage MVP

    oh you mean the button ?

    You would put it in the default.master.php or tpl . I put mine on the panel before the search div.

    If you use a tpl type master for your theme, then add the script in between {literal} <script></script>{/literal} tags

  • Options
    jeongweejeongwee Vanilla version 2.6 ✭✭

    @vrijvlinder im on default theme ,and rewrite is it a tpl type master?

  • Options
    jeongweejeongwee Vanilla version 2.6 ✭✭

    @vrijvlinder i searched but i cant find default.master.php .normaly where the file located?

  • Options
    vrijvlindervrijvlinder Papillon-Sauvage MVP

    the default theme does not have one ?

    It is in the views folder of the theme. It should be anyway .... That is why you do not edit the default theme , you make a new theme...

  • Options
    jeongweejeongwee Vanilla version 2.6 ✭✭
    edited August 2013

    @vrijvlinder

    i had my theme alrdy, i copyed default theme and rename it to mytheme and put my custom.css and views file into it

    .

    theres no default.master.php under default or mytheme file...

    .

    image

    image

  • Options
    ShadowdareShadowdare r_j MVP
    edited August 2013

    You have to copy /applications/dashboard/views/default.master.tpl to /themes/mytheme/views/ folder.

    Add Pages to Vanilla with the Basic Pages app

  • Options
    jeongweejeongwee Vanilla version 2.6 ✭✭

    @Shadowdare thx
    @vrijvlinder i put translte button it to my site alrdy.

Sign In or Register to comment.