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

Header File

Vanilla Version: 2.0.18.1

So I'm trying to take some things out of Vanilla and move them to a header on my site, basically I am doing a huge change to make an even smoother integration of Vanilla with my setup. I am having trouble finding where the #Header is generated though. I can't find the file that calls for it. I need to copy how it displays the Nav options available to users so that it works from another spot, so that admins can access dashboard, but users cannot still, etc.

Comments

  • Options

    If you have Vanilla 2.0.18.1 then consider upgrading to 2.0.18.4 and then to 2.0.18.8

    There was an error rendering this rich post.

  • Options
    gabessdspgabessdsp New
    edited October 2013

    @UnderDog said:
    If you have Vanilla 2.0.18.1 then consider upgrading to 2.0.18.4 and then to 2.0.18.8

    That is completely my fault, I do have 2.0.18.8

  • Options
    hgtonighthgtonight ∞ · New MVP

    Are you running another software that you want to merge with Vanilla?

    The actual markup for the header and footer will be in your themes default.master.tpl file (or default.master.php).

    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

    @hgtonight said:
    Are you running another software that you want to merge with Vanilla?

    The actual markup for the header and footer will be in your themes default.master.tpl file (or default.master.php).

    I'm just trying to make it integrate better with my website. MY Final Goal in the end:

    • Sitewide users integrated with the vanilla session
    • latest forum posts on the site home page and not just in the forums
    • users can edit site/forum settings in the same place
    • the forum navigation will integrate with my site navigation
    • the footers will be combined
    • the sidebar will be sitewide and not just forum wide

    essentially it is a complete customization/makeover and I need help with little bits along the way. In the end you won't be able to tell what parts are vanillaforums and whcih parts are the website(at least on the users end)

  • Options

    After copying the code to my site header I get this error:

    Fatal error: Class 'Gdn' not found in /home/content/94/10870394/html/000hosting/testcrimson/header.php on line 73
    

    I looked up fixes and all I find is clearing my cache, so I deleted everything in my cache folder several times to no avail

  • Options
    hgtonighthgtonight ∞ · New MVP

    What code did you copy?

    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

    @hgtonight said:
    What code did you copy?

    The code that generates the menu. So all of this:

    $Session = Gdn::Session();
                        if ($this->Menu) {
                            $this->Menu->AddLink('Dashboard', T('Dashboard'), '/dashboard/settings', array('Garden.Settings.Manage'), array('class' => 'Dashboard'));
                            // $this->Menu->AddLink('Dashboard', T('Users'), '/user/browse', array('Garden.Users.Add', 'Garden.Users.Edit', 'Garden.Users.Delete'),  array('class' => 'Users'));
                            $this->Menu->AddLink('Activity', T('Activity'), '/activity', FALSE, array('class' => 'Activity'));
                            if ($Session->IsValid()) {
                                $Name = $Session->User->Name;
                                $CountNotifications = $Session->User->CountNotifications;
                                if (is_numeric($CountNotifications) && $CountNotifications > 0)
                                    $Name .= ' <span class="Alert">'.$CountNotifications.'</span>';
    
                         if (urlencode($Session->User->Name) == $Session->User->Name)
                            $ProfileSlug = $Session->User->Name;
                         else
                            $ProfileSlug = $Session->UserID.'/'.urlencode($Session->User->Name);
                                $this->Menu->AddLink('User', $Name, '/profile/'.$ProfileSlug, array('Garden.SignIn.Allow'), array('class' => 'UserNotifications'));
                                $this->Menu->AddLink('SignOut', T('Sign Out'), SignOutUrl(), FALSE, array('class' => 'NonTab SignOut'));
                            } else {
                                $Attribs = array();
                                if (SignInPopup() && strpos(Gdn::Request()->Url(), 'entry') === FALSE)
                                    $Attribs['class'] = 'SignInPopup';
    
                                $this->Menu->AddLink('Entry', T('Sign In'), SignInUrl($this->SelfUrl), FALSE, array('class' => 'NonTab SignIn'), $Attribs);
                            }
                            echo $this->Menu->ToString();
                        }
                echo "<div class=\"Search\">";
                        $Form = Gdn::Factory('Form');
                        $Form->InputPrefix = '';
                        echo 
                            $Form->Open(array('action' => Url('/search'), 'method' => 'get')),
                            $Form->TextBox('Search'),
                            $Form->Button('Go', array('Name' => '')),
                            $Form->Close();
                    echo "</div>";
    
  • Options
    hgtonighthgtonight ∞ · New MVP

    You will have to load the actual framework for the Gdn class to be available.

    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

    @hgtonight said:
    You will have to load the actual framework for the Gdn class to be available.

    How would I go about doing that?

  • Options
    hgtonighthgtonight ∞ · New MVP

    Are you just looking to copy the markup over? Just view the page source it the page and copy pasta.

    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
    gabessdspgabessdsp New
    edited October 2013

    @hgtonight said:
    Are you just looking to copy the markup over? Just view the page source it the page and copy pasta.

    Just this stuff? I mean I just need to not get the GDN error...

    code won't show for some reason
    

    http://pastie.org/8425859

  • Options

    @hgtonight said:
    Are you just looking to copy the markup over? Just view the page source it the page and copy pasta.

    I don't know why I pasted that stuff. IT has nothing to do with the framework. I'm not looking to copy the look, I just PHP not be throwing errors so that it works

  • Options

    Force loading one framework over another is a bad idea, performance wise,

    Frameowrk don't just meld together despite what people think.

    SEO wise best option is to replicate the functionality/look in the framework it is in. it takes time but it will be the most satisfying.

    If you are not worried about SEO embed it the best option.

    Another option is to use fine grained caching and pulling that. This is an advanced topic, that I wouldn't be talking you through.

    Note you can't simply cut an paste a section of site a put it out of context given that it need it own resources.Your styling could conflict with it without some sand boxing, again an advanced topic.

    grep is your friend.

  • Options

    @x00 said:
    Force loading one framework over another is a bad idea, performance wise,

    Frameowrk don't just meld together despite what people think.

    SEO wise best option is to replicate the functionality/look in the framework it is in. it takes time but it will be the most satisfying.

    If you are not worried about SEO embed it the best option.

    Another option is to use fine grained caching and pulling that. This is an advanced topic, that I wouldn't be talking you through.

    Note you can't simply cut an paste a section of site a put it out of context given that it need it own resources.Your styling could conflict with it without some sand boxing, again an advanced topic.

    Well considering I don't have any other framework on my server I should be fine.

  • Options

    @gabessdsp said:
    Well considering I don't have any other framework on my server I should be fine.

    I wouldn't count on it you are loading your files (whether it is framework or not), you have both overheads to consider. You have to handle output buffering or use curl to fetch the views. Then you have to consider how you will sort out the conflict between the two.

    Like I said it is an advanced topic. I'm not saying is never possible, but it isn't always worth it.

    You would probably better spend your time replicating the functionality you want or better still use the Vanilla/Garden framework to build your site in its entirety.

    grep is your friend.

  • Options
    hgtonighthgtonight ∞ · New MVP

    @gabessdsp said:
    Well considering I don't have any other framework on my server I should be fine.

    Is your site currently just some static files?

    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

    From experience it's almost always best to simply replicate your header, navigation and other page furniture in your secondary framework/CMS. Cosmetic surgery is less risky. Do it right and your users will get a seamless experience and you'll save yourself a lot of time and money.

  • Options

    @x00 said:
    You would probably better spend your time replicating the functionality you want or better still use the Vanilla/Garden framework to build your site in its entirety.

    @hgtonight
    @50sQuiff

    Well I included the garden framework, and my whole site exists already without users, which is why I am trying to go vanilla-into my site rather than my site-into vanilla. But in the basic sense, I am still going mysite-into vanilla it's just mildly more complicated.

  • Options
    hgtonighthgtonight ∞ · New MVP

    What features do you want on your site?

    If it is just a few static pages, I would look into the Basic Pages application or the Custom Pages plugin.

    If you want a blog or news site, you can use something like NillaBlog or help sponsor the Articles application for a more fully featured experience.

    If you are looking to do something else, the Garden framework (which is what Vanilla is built on) is pretty easy to get started with developing your own application.

    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.