XTE Support  :: 
Elusive WHERE_IS_PERSO
 Top

  • I'm running .750 in a multisite configuration and everything is working beautifully. Single logins, shortURLs, everything. I'm now working on splitting the themes for each site and I ran into a problem that I cannot find in any documentation at docs.postnuke.com, forums.postnuke.com, or even on Google. Seems simple enough though.

    How do I access the WHERE_IS_PERSO variable in a template?

    All of the documentation refers to the variable from a PHP file like theme.php but none shows how to pull it into a HTML template.

    comes out null when rendered.
  • Xanthia and pnRender aren't really setup for multisites as yet since we've not really deciced on the best way to approach multistes under .8x. Both Xanthia and pnRender are developed under .8x and backported to .7x so this will lead to problems. My personal opinion is that the current multisite setup is a complete hack job and something that needs a revisit to be workable.

    -Mark
  • I have never actually implemented Multisites before, but I was thinking to soon; do you think it is more trouble than it's worth to do this, Mark?

    Kindest regards
    Lobos

    --
    -Lobos
    Professional PHP Framework Services: Concept, Development and Deployment
  • Lobos,

    I'll be honest with you - i'd never even looked at multisites until a fornight ago. This module is one of the major outstanding tasks for .8x so I need to get a handle on how it worked.

    Summary is it's a complete hack..... For .7x it'll work ok. For .8x I need to review how best to implement multisites without having to hack the code at each point a multisite decision is needed.

    -Mark
  • FYI -

    I'm using multisites. I needed custom templates for each site. pnRender can handle this with a couple small fixes:

    1) Add WHERE_IS_PERSO in get_template_path so it knows to look in the right theme dir; e.g.:

    Code

    $themehookpath = WHERE_IS_PERSO."themes/$theme/templates/modules/$module/$pnmodgetname";
    .
    .
    .
                    $themepath = WHERE_IS_PERSO. "themes/$theme/templates/modules/$module";


    2) Add the following function to the bottom of pnRender.class.php:

    Code

    function _fetch_resource_info(&$params) {
        $this->template_dir = $this->get_template_path($params['resource_name']);
        return parent::_fetch_resource_info($params);
        }


    The above is a little harder to explain, and is actually a bug that's independent of multisites. It may, in fact, be fixed in the latest source base, I don't know. Here's the problem:

    pnRender is smart enough to look in the theme templates before looking in the module templates. This is great if you want custom templates for each theme. However, if one of your theme templates includes another theme template (via the 'include' Smarty tag), the Smarty compiler will overwrite the template_dir variable before calling back into the pnRender class. The above code just sets it back to the right value again.

    So maybe this is just a but in my version of Smarty... in any case, if your version of pnRender/Smarty works, the above code won't change anything.

    Hope this helps somebody. It was a bear for me!
  • a fortnight ago? lol ya just aged 20 years saying that icon_wink
This list is based on the users active over the last 60 minutes.