Event that fires after all blocks have been added to a page
Permalink
Is there an event that fires after all blocks have been added to a page. I want to be able to call View->addHeaderItem(...) in that event right before page gets sent to client. I have tried "on_start" (too early), "on_before_render" (too early) and "on_render_complete" (too late). I have also tried "on_block_load", but that fires way too many times and I haven't quite figured out if it will work or not.
Thanks,
Warren Bell
Thanks,
Warren Bell
Once all blocks have been rendered to a page, all headers have necessarily already been added.
I need to add open graph meta tags that in certain cases when a particular block is on the page get their data from that block. When the block is not on the page, they get their data elsewhere. I have an open graph add-on that fires off in the "on_start" event. The problem is that that is before I have the open graph data. The open graph data is retrieved within a certain block. Is there a different mechanism to add these tags to every page after all blocks have been added ?
You can look ahead from the on_start to list the blocks on a page and get their block types. That is fairly straight forward unless they are in stacks or global areas.