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

RenderAsset('Panel') returning NULL

sddpsddp New
edited June 2013 in Vanilla 2.0 - 2.8

Under my customized theme, in themes/mytheme/views/admin.master.php when it calls RenderAsset('Panel') it returns nothing. I did check it with var_dump() as well, and it is returning NULL.

In the other hand it works when using the default theme 'Vanila'...

What am I missing?

<?php $this->RenderAsset('Panel'); ?>
«1

Answers

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

    @sddp

    Your custom theme would normally be taking the html/php side of things from views/default.master.php (or.tpl).

    Do you have a default.master as well, or just the admin.master?

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

    @sddp

    Did you specifically want a customised admin page?

    If not, try deleting that admin.master from your theme views folder.

  • Options

    Hey whu606 thank you. I do have both files, the admin.master and default.master as well.

    They are not customized (I do not want them to be), they are just a copy from the default theme.
    I will try to delete them from my custom theme's folder and see what happens.

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

    @sddp

    Hope it works.

    For theming, as you probably know now, you only need design/custom.css if all you want to change is some css declarations.

    The custom.css file doesn't need to be a copy of the Vanilla css file. It can contain a single declaration, if that is all you want to change.

    You only need to copy over the default.master file if you want to make some php/html changes.

  • Options

    Thank you for your help whu606, for some reason it does not work.
    The files have been removed from that folder so it vanilla has to load them from the default, and it is still not returning the Panel.

    The customization is 100% on the style sheets, so I think it should work fine.
    I will try to see if I can make vanilla report errors, and hopefully find the little thing it's not making it work

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

    @sddp

    Make sure there is not a declaration in the custom.css

    .Panel {display:none}

    or something similar.

  • Options
    hgtonighthgtonight ∞ · New Moderator
    edited June 2013

    @sddp Are you on 2.0.18.8 or 2.1? You will want to clear out the template cache files, or turn on debugassets on 2.1.

    Welcome to the community!

    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

    @whu606 Thanks, no CSS has been declared to hide the .Panel I still don't know what is causing this.

    @hgtonight It is the 18.8 version what I am using, I have clear out the template cache files, still not getting that Panel to show up.

  • Options
    vrijvlindervrijvlinder Papillon-Sauvage MVP
    edited June 2013

    try out the AdminThemeSwitcher plugin and see if it is theme problem. I made the themes and I know there is a panel .

    If you see the panel div in the source , it means it is there but under visibility hidden since the space it occupies is still there .

    to enable the plugin access the plugin page /dashboard/settings/plugins

  • Options

    @vrijvlinder thank you, the div it's empty because the $this->RenderAsset('Panel') function is returning NULL. It is fully visible, but it's contents is empty.

    I am trying to figure out what's going on, it doesn't seem to happen to anyone else.

  • Options
    hgtonighthgtonight ∞ · New Moderator

    @sddp Would you mind posting the contents of your default.master.php file?

    If you do, enclose it in a code block:

     ~~~
    File Contents
     ~~~
    

    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
    edited June 2013

    I think it has more to do with maybe $this->AddModule($SideMenu, 'Panel');

    /applications/dashboard/controllers/class.dashboardcontroller.php

  • Options
    vrijvlindervrijvlinder Papillon-Sauvage MVP
    edited June 2013

    @hgtonight

    the default.master.php does not affect the dashboard view is controlled by and uses

    admin.css for the style.

    class.dashboardcontroller.php

    applications/dashboard/views/admin.master.php

  • Options
    hgtonighthgtonight ∞ · New Moderator

    @vrijvlinder said:
    hgtonight

    the default.master.php does not affect the dashboard view is controlled by and uses

    admin.css for the style.

    class.dashboardcontroller.php

    admin.master.php

    You are completely right. I have just typed default.master so many types I didn't even think about it. :D

    @sddp Could you post your admin.master.php 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

    Sorry for the delay.
    Thank you so much @vrijvlinder I have not touch the css, and for what I see the Panel is no visible.

    @hgtonight This is the content of admin.master.php

    <?php echo '<?xml version="1.0" encoding="utf-8"?>'; ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-ca">
    <head>
       <?php $this->RenderAsset('Head'); ?>
    </head>
    <!-- r66 -->
    <body id="<?php echo $BodyIdentifier; ?>" class="<?php echo $this->CssClass; ?>">
       <div id="Frame">
          <div id="Head">
                <h1><?php echo Anchor(C('Garden.Title').' '.Wrap(T('Visit Site')), '/'); ?></h1>
             <div class="User">
                <?php
                      $Session = Gdn::Session();
                        if ($Session->IsValid()) {
                            $this->FireEvent('BeforeUserOptionsMenu');
    
                            $Name = $Session->User->Name;
                            $CountNotifications = $Session->User->CountNotifications;
                            if (is_numeric($CountNotifications) && $CountNotifications > 0)
                                $Name .= Wrap($CountNotifications);
    
                            echo Anchor($Name, '/profile/'.$Session->User->UserID.'/'.$Session->User->Name, 'Profile');
                            echo Anchor(T('Sign Out'), SignOutUrl(), 'Leave');
                        }
                    ?>
             </div>
          </div>
          <div id="Body">
             <div id="Panel"><?php  $this->RenderAsset('Panel');  ?></div>
         <div id="Content"><?php $this->RenderAsset('Content'); ?></div>    
          </div>
          <div id="Foot">
                <?php
                    $this->RenderAsset('Foot');
                    echo '<div class="Version">Version ', APPLICATION_VERSION, '</div>';
                    echo Wrap(Anchor(Img('/applications/dashboard/design/images/logo_footer.png', array('alt' => 'Vanilla Forums')), C('Garden.VanillaUrl')), 'div');
                ?>
            </div>
       </div>
        <?php $this->FireEvent('AfterBody'); ?>
    </body>
    </html>
    

    Line #32 is the one that returns NULL.

  • Options
    vrijvlindervrijvlinder Papillon-Sauvage MVP
    edited June 2013

    Ok I see the problem @sddp

    add this instead of the line you have< ?php $this->RenderAsset('Panel'); ? > but remove the spaces I added between the < > so they could show here.

     <  div id="Panel" >
                <?php
                $this->RenderAsset('Panel');
                ?>
             <  /div >
    
  • Options
    vrijvlindervrijvlinder Papillon-Sauvage MVP
    edited June 2013

    this is my admin.php so you can compare the two, maybe you could just download the app again and only substitute the dashboard folder.

    
    < head >
       <?php $this->RenderAsset('Head'); ?>
    
    < body id="<?php echo $BodyIdentifier; ?>" class="<?php echo $this->CssClass; ?>"     >
       < div id="Frame" >
          < div id="Head" >
                < h1 ><?php echo Anchor(C('Garden.Title').' '.Wrap(T('Visit Site')), '/'); ?>< /h1 >
             < div class="User" >
                <?php
                      $Session = Gdn::Session();
                        if ($Session->IsValid()) {
                            $this->FireEvent('BeforeUserOptionsMenu');
                            
                            $Name = $Session->User->Name;
                            $CountNotifications = $Session->User->CountNotifications;
                            if (is_numeric($CountNotifications) && $CountNotifications > 0)
                                $Name .= Wrap($CountNotifications);
                                
                            echo Anchor($Name, '/profile/'.$Session->User->UserID.'/'.$Session->User->Name, 'Profile');
                            echo Anchor(T('Sign Out'), SignOutUrl(), 'Leave');
                        }
                    ?>
             < /div >
          < /div >
          < div id="Body" >
             < div id="Panel" >
                <?php
                $this->RenderAsset('Panel');
                ?>
             < /div >
             < div id="Content" ><?php $this->RenderAsset('Content'); ?>< /div >
          < /div >
          < div id="Foot" >
                <?php
                    $this->RenderAsset('Foot');
                    echo '< div class="Version">Version ', APPLICATION_VERSION, '< /div >';
                    echo Wrap(Anchor(Img('/applications/dashboard/design/images/logo_footer.png', array('alt' => 'Vanilla Forums')), C('Garden.VanillaUrl')), 'div');
                ?>
            < /div >
       < /div >
        <?php $this->FireEvent('AfterBody'); ?>
    
    
  • Options

    It's very estrange that it is not showing the complete code after I did copy and paste it here.
    Here is what I got, which is exactly what you have @vrijvlinder

  • Options
    vrijvlindervrijvlinder Papillon-Sauvage MVP

    Yes I see, the only other option I can give is to replace the entire dashboard folder with a fresh one. Just ftp the dashboard folder into the applications folder and it will overwrite the old one.

  • Options

    @vrijvlinder thank you, I tried that still doesn't work.
    I am very close to give up hahahaha. I tried a theme made by a friend of mine, same error. I have vanilla now installed in a different server.... Oh well. I will let you guys know.

    Thank you very much for all the time and help.

Sign In or Register to comment.