Re: [SMARTY-DEV] Running two different Smarties on a single page
| From: | boots | Date: | Fri, 09 Sep 2005 17:01:37 +0000 |
| Subject: | Re: [SMARTY-DEV] Running two different Smarties on a single page | ||
| References: | 1 | Groups: | php.smarty.dev |
| Request: | Send a blank email to php-smarty-dev+get-2779@lists.php.net to get a copy of this message | ||
--- Ivo Jansch <ivo@ibuildings.nl> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hi all,
>
> we've been trying to integrate the Serendipity (s9y)weblog into one
> of
> our CMS systems. This went quite smooth, as s9y has an 'embed'
> feature
> for embedding it into applications.
>
> There was one particularly annoying thing though, that made us hack
> the
> software quite a bit. It was related to Smarty, so I'm posting it
> here
> to see if there is a nice solution.
>
> Our CMS system uses Smarty. The latest release uses 2.6.something,
> but
> the release where s9y needed to be integrated in used a slightly
> older
> version (2.4.something I believe). s9y itself uses 2.6 though. 2.6
> and
> 2.4 are not compatible, so in fact for rendering a page in the CMS,
> both
> 2.4 and 2.6 are used.
>
> I had to tweak a bit: first I had to rename the Smarty class to
> Smarty2
> to avoid class name conflicts. This was easypeasy.
>
> But then we got into major troubles due to the paths. The
> SMARTY_CORE_DIR and SMARTY_DIR defines were not correct, because
> there
> can only be one define. I ended up replacing every SMARTY_DIR and
> SMARTY_CORE_DIR occurance with a different define.
>
> Is there a cleaner way around this? Maybe if just member variables
> would
> be used instead of global defines, it would be easier to instantiate
> multiple different smarties.
Its still not that easy. The plugins, for example are generally global
functions so only one version of a plugin can be loaded at any time.
> Any ideas?
Upgrade the version of Smarty that the CMS uses? It may be easier than
trying to get true side-by-side working. I wonder if you can spawn a
separate process by separating the two and accessing S9y from a http
include? Even if you could, it sounds like a bad solution. Another idea
like this is to fake it, err, I mean simulate it -- use an emdedded
iframe in your document that does a separate request for the S9y
content.
> Greetings,
> Ivo
______________________________________________________
Click here to donate to the Hurricane Katrina relief effort.
http://store.yahoo.com/redcross-donate3/