We build. You grow.

Get best community software here

Start a social network, a fan-site, an education project with oxwall - free opensource community software

Header and footer removal | Forum

Mario Carriere
Mario Carriere Mar 24 '13
Hi,

I have created 2 page with the php files in /controllers/ and their corresponding html files in the view/controllers/

On the first page, a link open the second page as a popup (by a javascript).

Everything work fine, but I would like to remove header, footer and everything else except the content of my html file in the popup. Is there a command to add to my php file to do this?

I did some testing with functions in the ''ow_core/master_page.php'' with no luck...

/**
 * Master page is a common markup "border" for controller's output.
 * It includes menus, sidebar, header, etc.

Someone could give me a hint about using those functions?

Thanks!

Mario
The Forum post is edited by Mario Carriere Mar 24 '13
Mario Carriere
Mario Carriere Mar 25 '13
Testing this

OW::getDocument()->setTemplate(OW::getThemeManager()->getMasterPageTemplate(self::TEMPLATE_BLANK));

return

Fatal error: Undefined class constant 'TEMPLATE_BLANK'


Mario Carriere
Mario Carriere Mar 26 '13
Hi,

Intensive research have given nothing... I don't wan't the complete receipe, I only wish to be set in the rigth path...

Is it possible to do this in the contoller/ and view/controller ? or do I have to create a component in the component/ and view/component and use the render fonction?

Thanks!

Mario


Michael I.
Michael I. Mar 27 '13

You should create a controller and load its content in the popup. Don't load controller view file in your popup as it includes master page markup by default. Hope that helps.



Mario Carriere
Mario Carriere Mar 30 '13
Hi Michael,

Thanks for the reply. It did help a lot. It's easier when you know that the path you're in is the right one... Then, the only thing left is to find your way home! I'm learning a lot and i'm having fun doing it! ;)

I'm now able to load my content into my popup and interact with it with Javascript through my controller.

There is still a question in my mind... Doing so, does it still respect the MVC pattern? In my mind it does... Sorry if it my question sound stupid but I'm pretty new to the MVC pattern.  I did a lot of reading about it on the net... and I want my plugin to comply to it.

So thanks again!

Mario
Michael I.
Michael I. Apr 3 '13
Yes, this method complies with the MVC pattern.