Fork me on GitHub

Displaying blocks and header in external files?  Bottom

  • How can i display the left blocks and header in external files?

    basically i want to grab the left blocks, and my header and shove it into an ouside PN PHP script.

    would i need to initialize PN to access these? and if so, what is the bare minimum needed to access, say the blocks() function and be able to include header.php without bombing up with errors?

    But not too much that it goes and prints out all of PN!

    please note that the non-PN page isnt a module, and will never be one, so dont answer with "make it a module" or "use postwrap" or the like. that is not what i am trying to do, and wont work because of path issues.

    thanks in advance for any help!
    -N30
  • The basics of making a file that wraps PostNuke around it is, first of all it must reside in the PostNuke root (otherwise paths will break), and contain these calls:
    // initialise the pnAPI functions used throughout PN
    include_once ("includes/pnAPI.php");

    include_once ("includes/legacy.php");
    pnInit();

    // called before any output
    include_once("header.php"); // actual Header of PN, with all HEAD tags like Metatags etc, drawn from theme

    >>>Page here<<<

    // called after all other output
    include_once("footer.php"); // Footer and closes BODY/HTML tags.
  • 0 users

This list is based on users active over the last 60 minutes.