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.

Adding own stuff above header

edited May 2015 in Vanilla 2.0 - 2.8

So after I got to know that Vanilla may will never work with nice urls in embedded mode I started searching for options to insert my main menu manually and came along this:

  1. Master Views - these represent everything that wraps the main content of the
    page. If all you want to do is add a menu or banner above Vanilla, this is
    all you need to alter. To do so, copy the default master view from
    /applications/dashboard/views/default.master.php to
    /themes/yourtheme/views/default.master.php and edit it there.

Source: vanilla/themes/default/README.txt

So there is no such file in my forum - even in a fresh installation it's not there. How can I insert code then and why is the file missing?

My goal is to add my main menu (wrapping around the forum). Therefore I need to load some PHP and display the results with my template engine. Then the forum should load and finally again some of my own footer stuff.

Comments

  • R_JR_J Admin

    It is not a php file anymore, but Smarty is used. So look for default.master.tpl

    That said, you will not be able to insert custom code there. You would have to create a smarty function (or maybe it is enough to simply use html?)

  • @R_J

    Can't you add custom code with [literal] tags?

  • R_JR_J Admin

    You have to add Javascript in literal tags, but enclosing php inside the tpl is not allowed. I'm not 100% sure about that, but 99.9% ;-)

  • @R_J said:
    It is not a php file anymore

    That may be the case with the default default.master.tpl but any php theme works fine too.

    This all depends on what theme the OP is using. If they are using the default theme, they should not be encouraged to edit it.

    Please use a custom theme or create a new theme but DO NOT EDIT the DEFAULT THEME...

  • edited May 2015

    I gave up on Vanilla for now. I will revisit the project when a newer version comes out and see if important functions are working again or much more easier. At the moment it seems like a waste of time with broken documentation links, no fully working file upload system and outdated readmes.

    Thanks guys!

  • x00x00 MVP
    edited May 2015

    @Guido Richter

    You use smarty functions/asset/modules, loaded through themehooks to include code.

    In modern frameworks, views are not meant to be logic heavy.

    If you are giving up becuase of this, then is a wake up call for you, becuase this how things are done, it is called "separation of concerns" and it makes for better structured, more organised code.

    Nothing is without learning curve. You are trying to do something that technically not a beginner level in the first place. Don't begrudge the tools you have, because in many other system they don't exist or you are to told to do inadvisable things.

    Melding two frameworks, I would strongly advise against. The performance will be poor. It is an advanced topic anyway. Quite often people are told to force load another framework. This increases your overhead.

    Don't think this is a simple topic for anyone in any framework. It isn't. It takes skill and experience to come up with the right solution for the application. I have done this with clients and picked different solutions depending.

    Generally I would advise, simply replicating the header/footer. Some people want somethign that instantly updates the menus as they are added to. This difficult becuase although you can include the markup, they often rely resources like styles and script to make them work. You can't assume they won't clash, becuase it comes from another framework. It takes skills to sandbox if it is is even possible.

    People don't want to be inconvenienced in the slightest. But is it really that taxing to update a header when you need to? Even if you are already doing it elsewhere? You can't have you cake an eat it too. If you want to simplest solution with the least learning curve, replication is it.

    I have done it before with simple menu where in the other framework I made a cached version of it on save. Like a fragment of the markup. This means I’m not loading the framework or using an API, I'm simply including a static file, which doesn’t have the overhead. They I include the related resources. It just happens not to clash, mainly becuase it was simple anyway.

    This is beyond knowledge of just vanilla.

    grep is your friend.

  • Came back to Vanilla now with Beta 2.2.. File upload is awesome, working like a charm.

  • Managed to quit embedded mode and do it with themes/plugins. Very helpful: http://robotgrrl.com/blog/tag/vanilla/ Forum is now fully wrapped by my own website navigation and anchors work as well. I will stay with Vanilla now since 2.2 is a big milestone for me (native, comfortable file upload and so on).

  • rbrahmsonrbrahmson ✭✭✭

    I am far from an expert but from looking at your blog you mentioned above and then at the referred forum I get the sense that the graphics and menus at the top and bottom (those that wrap the Vanilla forum) are simple buttons, not drop down menu. So if my perception is correct, then I wonder whether the use of the Pockets plugin would work for you as a simple solution.

  • No because my header is created dynamically. But as I mentioned it works now with a quite nice smarty-injection and some lines of php (theme hooks).

  • rbrahmsonrbrahmson ✭✭✭

    I was referring to @x00 suggestion to take it simple and copy the code. But I see your point.

    What I wonder is what does it all say about the "Embed Forum" option on the Admin panel as well those templates that claim to be "Embed-Friendly":
    1. Does this discussion mean that neither of these methods work?
    2. Will it work once Vanilla 2.2 is official?
    3. We we considering embedding Vanilla in a Joomla-created web site (but not concerned about shared menu as you are). Will is work or will @x00 warning about framework spell the doom of galaxies;-)

  • whu606whu606 MVP
    edited July 2015

    @rbrahmson

    From my reading, Vanilla makes it possible to embed without really recommending it.

    Better, I would say, to simply style the forum to match your main site, and use SSO where needed.

  • I tried embedding the forum but it never worked 100%. Main problem was with the wrong anchors in url so I stopped messing around with it and wrapped my stuff around with some lines of code. Once you learn the basics of writing plugins and creating themes it's easy. Maybe I'll make a tutorial some day.

  • rbrahmsonrbrahmson ✭✭✭
    edited July 2015

    Our main Joomla site uses it's own signons (we can't use social media/google/etc. signons because some users are corporate users where access to these is restricted). Haven't yet researched or figured out how to integrate with Vanilla's signon... It's one of the things on the task list...

  • SSO is straight forward. You can do it with the jsConnect-library. Don't know how Joomla handles active logins, maybe you have to write some lines of own code.

  • rbrahmsonrbrahmson ✭✭✭

    Thanks, I'll look into it.

Sign In or Register to comment.