#1 June 1, 2017 3:06pm

tsamant
Member
From: Chicago
Registered: May 14, 2015
Posts: 52

Changing header markup from inside the page

My basic problem: I need to change a bit of markup high on the page--it's in templates/layouts/_header.php. It is to be dependent on the specific template being used for any given page.

I thought that simply setting a variable in the innermost template and reading it in the outermost would do the trick. But I don't think I have understood how Bigtree composes a page exactly.

Here is the concrete problem. We have this in templates/layouts/_header.php:

<meta property="og:image" content="<?=$page_image?>">

I want to set (or get the effect of setting) $page_image from inside templates/routed/calendar, and other such templates.

What's a good way to go about this?

Thanks,
Tushar

Offline

#2 June 1, 2017 3:12pm

timbuckingham
Administrator
From: Baltimore, MD
Registered: April 2, 2012
Posts: 974

Re: Changing header markup from inside the page

Your understanding of the rendering workflow is correct. Something you set inside of your calendar template should be available within your layout. Is $page_image possibly being overridden in the layout somewhere and blowing away what you set in your template?

Offline

#3 June 8, 2017 6:04pm

tsamant
Member
From: Chicago
Registered: May 14, 2015
Posts: 52

Re: Changing header markup from inside the page

Apologies for the late reply. You are right. There are some indirections, and variables being set from other variables, that were confusing me. Thanks! Tushar

Offline

Board footer

Powered by FluxBB

The Discussion Forum is not available on displays of this size.