1

I have a plugin where I'd like my CP tab to output two columns just like the entry page. On the left, would be the body and then there would be a nice dividing gap and then on the right there would be a aside column.

I've tried to copy the way that the Entry Edit page works but I must be missing something.

Extending _layouts/cp wraps everything on the page with the following three divs which don't seem to get output at all on the Entry Edit page:

<div class="grid">
    <div class="item">
        <div class="pane">
             ...
        </div>
    </div>
</div>

How does the entry page get rid of these divs? I'm not seeing anything obvious in the templates.

EDIT To be clear, I can create the layout that I want, except for the fact that the layout I want gets wrapped in the above code and makes the gutter disappear and messes up the padding around the two columns on the page. If I extend the {% extends '_layouts/cp' %} and remove those three divs above, just like the Edit and Entry page seems to do somehow, the page displays just as I want it to.

What I can't figure out is how the Entry page is getting rid of those three divs. It uses {% extends '_layouts/cp' %} and those divs do not appear on the Edit an Entry page.

1

templates/layouts/_cp.html has

<div class="grid">
  <div class="item">
    <div class="pane">

nested inside the {% block main %} (line 207) and templates/entries/_edit.html is overriding that block main, so those grid,item,pane divs get overridden too.

| improve this answer | |
  • Bingo! Looked right past that. Using {% block main %} works as needed. – Ben Parizek Aug 29 '14 at 0:35
0

Hey Ben if you are using {% extends '_layouts/cp' %} how about something like this?

{% set sidebar %}
     <div class="buttons">
           <a href="{{ url('') }}"><div class="btn submit add icon">New Button</div></a>
     </div>
{% endset %}
| improve this answer | |
  • 1
    Thanks @Adam. In my tests {% set sidebar %} controlled the column to the left of the layout like on the Entries listing page, where I am hoping to have a column on the right of the layout, like on the Edit an Entry page. – Ben Parizek Aug 28 '14 at 16:16
  • Ah gotcha. Yes I'd be interested in this too. – Adam McCombs Aug 28 '14 at 20:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.