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

Show panel on gallery page?

AaronWebsteyAaronWebstey Headband AfficionadoCole Harbour, NS ✭✭✭

I just want my gallery page to look like any other page on the site. The MeBox gets shown anyway, so I'd like to show the panel below it as well. Can anyone tell me how to do this? I'm a bit confused as to why MeBox is showing up, but not the panel.

Van 2.1.8, bittersweet theme.

Comments

  • Options
    hgtonighthgtonight ∞ · New Moderator

    The MeBox is part of the master template in Bittersweet.

    What do you want to add to the panel? The standard discussions list has the following modules:

    $Sender->AddModule('DiscussionFilterModule');
    $Sender->AddModule('NewDiscussionModule');
    $Sender->AddModule('CategoriesModule');
    $Sender->AddModule('BookmarkedModule');
    

    I would also suggest setting the breadcrumbs:

    $Sender->SetData('Breadcrumbs', array(array('Name' => T('Gallery'), 'Url' => '/plugin/gallery')));
    

    Add that to the public function PluginController_Gallery_Create($Sender) method in your gallery plugin file.

    Search first

    Check out the Documentation! We are always looking for new content and pull requests.

    Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.

  • Options
    AaronWebsteyAaronWebstey Headband Afficionado Cole Harbour, NS ✭✭✭

    You're the man, @hgtonight ! Actually I only needed to link to /gallery, not /plugin/gallery, since @hgtonight used SetRoute to make that the URL :)

    Great plugin! Styling right now!

  • Options
    vrijvlindervrijvlinder Papillon-Sauvage MVP
    edited February 2015

    For the panel to be seen in the Galleries page all you need to do is change the display none to display block in the css file for the galleries plugin around line 42
    I did not want the panel so I used css to hide it. No need to reload the modules, you are loading them twice...

    body.Dashboard.Plugin.gallery #Panel {
    display: none;
    }
    

    The route is set in the default.php

    Gdn::Router()->SetRoute('gallery','plugin/gallery','Internal');

    this makes the url be gallery and not plugin/gallery if this is added

     $matchroute = '^gallery(/.*)?$';
                 $target = 'plugin/Galleries$1';
    
                 if(!Gdn::Router()->MatchRoute($matchroute))
                      Gdn::Router()->SetRoute($matchroute,$target,'Internal'); 
    

    It already has a link that goes to the menu it may be commented out...

        $Session = Gdn::Session();
    
                    if ($Sender->Menu){
                        $Sender->Menu->AddLink('Gallery', T('Gallery'),'/gallery',array('Garden.SignIn.Allow'),array(), array('target' => '_blank'));
                    }
    
  • Options
    hgtonighthgtonight ∞ · New Moderator

    @vrijvlinder said:
    I did not want the panel so I used css to hide it. No need to reload the modules, you are loading them twice...

    Good to know that the panel is hidden. The Plugin controller (which extends the Dashboard controller) doesn't load any modules by default, so you will have to load them in your plugin to have anything there.

    Search first

    Check out the Documentation! We are always looking for new content and pull requests.

    Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.

  • Options
    vrijvlindervrijvlinder Papillon-Sauvage MVP

    Yes, it loads only what you have in the tpl panel. I have the search and UserInfo module and mebox in the master in the panel so they do get called in the plugin page. I suppose that is why I hid the panel with css.

    But look in the css for other hidden stuff. I do know that MeBox-SignIn is display-none in the main style.css not sure why maybe it is redundant. But it does show in the panel of the plugin page when I remove display none.... So there may be other things like that in the main style.css

    But make sure so you don't load two of something. It happened to me.

  • Options
    AaronWebsteyAaronWebstey Headband Afficionado Cole Harbour, NS ✭✭✭

    @hgtonight the panel is in the BS master template too, which is what confused me about why it wasn't showing up but the mebox was. @vrijvlinder in fact, the panel wasn't even showing up in the source - i.e. unhiding it didn't help. I had to add it as per HG's advice in the code.

    I've got it working now, just wanted to let you know what happened in my case.

  • Options
    hgtonighthgtonight ∞ · New Moderator

    @AaronWebstey said:
    hgtonight the panel is in the BS master template too, which is what confused me about why it wasn't showing up but the mebox was. vrijvlinder in fact, the panel wasn't even showing up in the source - i.e. unhiding it didn't help. I had to add it as per HG's advice in the code.

    I've got it working now, just wanted to let you know what happened in my case.

    Assets return an empty string if they have no associated modules. Since the plugin controller doesn't load any modules by default, the asset is blank.

    Search first

    Check out the Documentation! We are always looking for new content and pull requests.

    Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.

Sign In or Register to comment.