Been struggling with this for a while... I know there is probably a fairly easy way to accomplish it but I haven't been able to figure it out.
The goal: When a user creates a new page for the site, I would like them to be able to choose from several different headers using a drop-down list. I know I can set up blocks for the different headers and use the built-in functionality to have them appear on different content types or pages, but for various reasons I would like to have the header as a custom field within the page content type.
I have created a "Header Content" content type and used the Entity Reference module to populate a select list field in the page content type. I can display the selected option or the rendered entity it refers to in the body of my page without any trouble.
What I can't figure out is how to display the rendered entity in the header section instead of the main content.
Put another way: When creating a new page or editing an existing one, the user should be able to select existing nodes from a drop-down list (this part is done). The selected node should show up in the header region (this part is giving me trouble).
I think it could be accomplished in one of two ways:
1) Using Views: I tried creating a views block to read either the reference or rendered content from the parent page and display it in the header (or wherever I place the block) but I can't seem to get the relationship right.
2) Using a custom module This seems pretty straightforward but I'm not sure how to reference the value of "field_header" (the name of my custom field using hooks. I'm also not sure if the data will be available if I configure field_header not to display in the configuration.
This seems like a problem that's likely to be solved already. Maybe I'm not phrasing it correctly when I search because I haven't been able to find any examples to help me solve it.