Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In with Facebook Sign In with Google Sign In with OpenID Sign In with Twitter
Support for Vanilla Forums Cloud product

In this Discussion

Follow Us


Custom sidebar on pages

RaizeRaize
edited August 2010 in Questions
This discussion is related to the Custom Pages addon.
How would I customize the sidebar on the pages instead of having the same sidebar apply to all of them?

Comments

  • 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?

    matt
  • 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

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

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

    @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... Moderator

    @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... Moderator
    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.

    Nonnisi
  • KasperKasper Front-end Wizard 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) | Web Designer @Vanilla | Hit me up: Google Mail or Vanilla Mail | Find me on GitHub

    Nonnisimedelsvenssonhgtonight
  • @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';

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

    look in plugins/CustomPages/default.php

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

  • if you get to the defaults.php

        // Use the default css if not viewing admin master
        if ($MasterView != 'admin') {
            $Sender->ClearCssFiles();
            $Sender->AddCssFile('style.css');
        } else {
            $Sender->AddSideMenu('plugin/page/default/admin');
        }
    switch ($Page) {
      case 'home':
        $Sender->MasterView = 'front';
        break;
    
      default:
        $Sender->MasterView = $MasterView;
        break;
    } 
    $Sender->Render($Path.$Page.'.php');
    

    You can just use a switch case to select your custom view. my page here is called home.php and the view front.master.tpl

Sign In or Register to comment.