Author Topic: The Sidebar  (Read 1057 times)

0 Members and 1 Guest are viewing this topic.

« on: March 29, 2011, 12:15:24 AM »

It's not a new idea... well, maybe to SMF, which is stagnating even further as everyone else gets better.

Enter the sidebar. With so many features, it seems amazing that it's still not bulging! Yes, such features begin with integration with portals, those SMF mods that can provide blocks and layouts.

Well, how do I get a block in the sidebar?

  • Dream Portal

    • Create a layout with whatever name you want
    • The action is the trigger. Use [sidebar] for the home page and [sidebar-$current_action], where $current_action is the action being used, eg. forum, post, etc.

    • Make two edits to Dream Portal. More on that later.
  • Simple Portal

    • Add a new block to the top column, whatever type
    • Under Show this block on: input the same things as you would for an action in DP's layout as prescribed above

Now, in your templates, if you have something which you want in the sidebar, all you have to do is put the content inside a new function with the keyword widgets in the name. Everything else is done like magic! Multiple functions like that are allowed too.

Examples are already in the templates. The info center in the board index is in that format; the topic moderation buttons in the message index and display templates use the format.

Last thing I should mention is the menu. When the menu is set to display on the side, it is then transformed as blocks for the sidebar.