XF 1.2 Specify custom page_container for pagenode

Lee

Well-known member
Is it possible to specify a custom page_container template for a specific page node?

If so, does anybody have any examples of how to do so?

I'm thinking about making a new theme and using the "override theme choice" check box in the page_node settings, but it would be more ideal if I could just specify the new node container without having to "hack" it together.

Cheers,
Lee
 
I want to remove the default xF style from a specific page node and add my own header / footer and styling.

Ie, make it look like it isn't associated with the forum at all.
 
Untested but you can try using a conditional statement for the node ID in the template.

Alternatively you can use the node ID in EXTRA.css to specifically target that page, for example:
Code:
.node25 #logo {
display: none;
}
 
Another thing you could do....

Create a new style how you want the page to display, editing mainly page_container then force a new style for the page in the page node options:

page.webp
 
He already said he didn't want to do that so it's not "hacked together" o_O

I see absolutely nothing wrong with doing as @Russ suggested, especially as it seems you wish to change the entire look and feel of that page -- overriding the style seems to be most appropriate.

If it is, however, a few small cosmetical changes then @Brogan's suggestions are perfect.
 
He already said he didn't want to do that so it's not "hacked together" o_O

I see absolutely nothing wrong with doing as @Russ suggested, especially as it seems you wish to change the entire look and feel of that page -- overriding the style seems to be most appropriate.

If it is, however, a few small cosmetical changes then @Brogan's suggestions are perfect.


Whoops! Didn't see that part :), yep I've done it for clients in the past and they've always been happy with it. I just install a child style underneath your main style.
 
Just to clarify, I didn't want to create two styles if I could just use a function to over-ride the default container with my own and keep everything in the same place.

I know I can use two styles to achieve this, but it seems like a long winded approach that could be done easily by creating one new template and overriding the default container.

Thanks for the suggestion @Brogan. @Russ I think this is the way I am going to proceed. Thanks for the help everyone.
 
PHP:
<?php
class Test{


   public static function changePage(XenForo_ControllerPublic_Abstract $controller, XenForo_ControllerResponse_Abstract &$response){
     $response->containerParams = array('containerTemplate' => 'foo');
   }
}
worked for me
 
Top Bottom