Skip to content

Adding a sidebar region to Kalatheme #202

Open
@UTANdev

Description

@UTANdev

I love how Kalatheme easily brought me into the Panopoly+Bootstrap world!

Scenario

My current project, however, requires a traditional sidebar on most inner pages.

Approach 1

In the IPE, I can place sidebar content inside one of the layouts which feature a right column.

Problems

This approach greatly limits the number and usefulness of layouts available to content editors:

  • Layouts without a full-height right column cannot be used
  • By monopolizing a region, the sidebar prevents content editors from accessing important features like a trifold (3-region) row; not a single layout includes both a trifold and right sidebar.

I could create custom layouts as needed, but isn't the point of Panopoly to give users a plethora of available layouts without paying a developer?

Approach 2

Add a sidebar region to my Kalatheme subtheme.

(The region will simply contain the block generated by a standard_sidebar mini-panel, giving users Panels-powered control over the sidebar, even though it lies outside Kalatheme's One Region.
But that's beside the point — my problem deals with adding the region, not what's inside it.)

This is the approach I would like to follow, as every single Panopoly layout would remain available to users — Kalatheme would still control the $page['content'] region, as it does now.

Problems

I want the layout to be responsive, and I'm fairly inexperienced in that respect.

I would essentially code page.tpl.php as:

[skipping past header, tabs, etc.]
Bootstrap .container
  Bootstrap .row
    if page has a sidebar
      <div class="col-sm-8">$page['content']</div>
      <div class="col-sm-4">$page['sidebar']</div>
    else
      <div class="col-sm-12">$page['content']</div>
    endif
[closing elements, footer]

At first, I was going to post for guidance because that would require nesting my .container with existing .containers inside Kalatheme/Panopoly templates — but I see that even without my handiwork, Kalatheme pages already include containers within containers, yet Bootstrap doesn't explode.

So would this work? (Perhaps with some minor CSS tweaks) Do you see any red flags with my approach? Thanks for any insight.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions