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.

Custom sidebar on pages

RaizeRaize vancouver ✭✭
edited August 2010 in Vanilla 2.0 - 2.8
How would I customize the sidebar on the pages instead of having the same sidebar apply to all of them?
«1

Comments

  • RaizeRaize vancouver ✭✭
    Or better yet, what is the code I could use to remove the sidebar from a specific page. The file for the page itself doesn't contain much other than a large image, so I guess I would be editing the default.php in some way?
  • Anyone find an answer for this?
  • edited October 2010
    Custom pages (and the pages application @NickE) is a little clunky with its need to hack a theme and/or define a route. Even when you define a route you have to display link(s) somewhere via a definition in a theme or somewhere.

    I feel a better and flexible method to display the links is to use a message (settings in Appearance section of dashboard) with link(s) to the page(s) either at the top of the discussions page or bottom of the sidebar
    (I'd like to be able have the option to place them at the top of the sidebar also, but that is probably best done as a core modification - @mark)

    This method makes display of the links to pages much more immune to theme switching and other screwups.
  • Now my custom pages have no sidebar at all, just a searchbox. Anyway I can add the full sidebar from the rest of the forum?
  • I can't quite figure out how to add anything to the sidebar for my custom homepage either. I would love to add the guestmodule and other things to the panel.
  • I'd like to remove the side panel since I'm using Custom pages for things like privacy policy and such. Couldn't figure out how to make the proper modification either.
  • Hi Guys,

    I have created 2 custom pages and want to add the same side bar as in forum. Right now only the message i put are coming there but there is not Category coming up. HTML also is there any ways i can add this in the top Navigation as well?
  • edited June 2011
    I cant see sidebar on my custom page, not even the default one. Can you plz figure out what would be the problem.

    Thanks in advance
  • I'm having a similar problem to this. I have two custom pages that I'd like to remove the sidebar form. I've played about with a bit of trial and error but have not come up with anything yet. Any advice?

    http://dl.dropbox.com/u/2190429/discussions.tiff

    http://dl.dropbox.com/u/2190429/calendar.tiff

    http://dl.dropbox.com/u/2190429/places.tiff
  • ChanuxChanux Admin of Geek.lk ✭✭

    i have the same problem.... plz give us, the solution. > how to add side pane like home page to custom pages

  • Has anyone found a solution to this yet?

  • mattmatt ✭✭
    edited June 2012

    OK, all I wanted was to add the Guest "Howdy Stranger!" to the side panel. Here is what I did:

    plugins/CustomPages/default.php contained:

        $Sender->MasterView = $MasterView;
        $Sender->Render($Path.$Page.'.php');
    

    edited to become:

        $Sender->AddModule('GuestModule');
        $Sender->MasterView = $MasterView;
        $Sender->Render($Path.$Page.'.php');
    

    Worked for me.

    You could likely add the other modules (Categories, etc.) individually, too? You may need to copy the relevant .php file from application/vanilla/views/modules to themes/YOURTHEME/views/modules

  • Has anyone been able to workout how to totally remove the sidebar?

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

    @Nonnisi

    In your custom.css file, set panel to display:none

  • Thanks, that does not seem to remove the search box though.

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

    @Nonnisi

    Do the same thing for the Search div.

    If you use Firebug in Firefox, or a simialr tool, you can inspect pretty much any elemnt in Vanilla to see what controls it.

  • The search box does not seem to have a display tag, except for the actual search button.

    Also just noticed that this is disabling parts of the sidebar across the entire site, I just want it gone on custom pages.

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

    @Nonnisi

    I just want it gone on custom pages.

    OK, but that wasn't clear from your initial question.

    You can append a page name to a css rule, so for example .discussion in front of a rule only affects elements on discussion pages, so I'm assuming you could do that for a custom page as well.

    If not, you could set the display:none, and then for individual pages call it back again

    e.g. .Discussion #Panel {display:block}

    AfaIk #Search is the element for the search box.

  • KasperKasper Scholar of the Bits Copenhagen Vanilla Staff
    edited September 2012

    You could also just create a different master view and use it with your custom page:

    $this->MasterView = 'your-view';
    

    The view would need to be named your-view.master.tpl for this to work. Then remove all the stuff you don't need from this view and voilá!

    Just an example: I used this to create a full-width home page for a project I'm working on.

    Kasper Kronborg Isager (kasperisager) | Freelance Developer @Vanilla | Hit me up: Google Mail or Vanilla Mail | Find me on GitHub

  • @Kasper said:
    You could also just create a different master view and use it with your custom page:

    $this->MasterView = 'your-view';
    

    The view would need to be named your-view.master.tpl for this to work. Then remove all the stuff you don't need from this view and voilá!

    Just an example: I used this to create a full-width home page for a project I'm working on.

    Where would I add that code? The: $this->MasterView = 'your-view';

Sign In or Register to comment.