Here is a first run at creating content types for the various standard page template variables. This allows us to use title, breadcrumb, status messages, help, and tabs as panels panes.

Currently, this patch just gets the ball rolling. The plugins are rather simple, and there are some issues. Specifically, many of the page variables are set very late in the request process, so they will not be compatible with other modules that set these variables later in the request stack than ctools.

Because of this issue, the page title plugin isn't currently working. I'm still including it here to see if any one has any good ideas.

Comments

zroger’s picture

After talking with merlinofchaos, we decided to go the route of using token replacement to solve the issue of title and other variables that can be modified late in the request stack.

We will use variables like <!-- ctools-page-title --> in the output of these content types and then in ctools_preprocess_page() replace these tokens with the actual values. We also want to use a global variable that signals if the token replacement needs to happen, this way we don't waste cycles on unnecessary token replacement.

I'll try to get a new patch rolled tonight.

zroger’s picture

Status: Needs work » Needs review

ok, here's the updated patch which does token replacement in ctools_preprocess_page(). a new function is created that allows plugins to notifiy ctools that a replacement should be made during preprocess_page().

zroger’s picture

StatusFileSize
new7.46 KB

and here's the patch.

doh!

merlinofchaos’s picture

Status: Needs review » Fixed

I adjusted the tokenzer to be able to accept a callback, as well, making it more genericly useful. I changed Page to Page elements, which I"m not 100% sure about, but Page felt too generic. Let's see how people like this. This is a big step toward Panels Everywhere and makes me happy.

robbiethegeek’s picture

Status: Fixed » Needs review
StatusFileSize
new2.57 KB

Adding the site slogan and the mission statement to the page elements.

May want to have the token piece verify whether it exists it seems to return an array if variable is empty.
I lied looked over this with Roger I called the slogan variable not the site_slogan will fix and resubmit.
Robbie

RobbieTheGeek :)

merlinofchaos’s picture

Status: Needs review » Fixed

Fixed. Though next time a fresh issue. Also the patch put the files in the wrong place so I had to move them (ctools-HEAD does not exist for me =)

robbiethegeek’s picture

Sorry sir. :)

Thanks

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.