[ic] User-based Alternate Page Set?

Mike Heins mike at perusion.com
Fri Feb 27 18:28:31 UTC 2009

Quoting Thomas J.M. Burton (tom at globalfocusdm.com):
> Hello IC Users,
> I'm wondering if there's a simple way to have a catalog use a set of
> pages from a different directory on a per-user basis? Something like
> having pages from an alt_pages directory served based on IP or username,
> rather than pages from the default pages directory.
> I need to be able to test new pages for a site upgrade and with this
> particular catalog, I'd rather not set up a clone staging copy (for
> reasons I won't go into right now). The catalog is running on IC version
> 5.4.2.
> Any suggestions?

Just set $Config->{PreviewDir} in an autoload routine. In catalog.cfg:

    Sub set_preview <<EOS
    sub {
	    $Session->{preview} ||= $CGI->{tmp_preview};
	    return unless $Session->{preview};
	    $Config->{PreviewDir} = 'newpages';
    Autoload set_preview

Now the first time you access the site with a CGI parameter of
tmp_preview=1, the "newpages" directory will be looked at first
for any pages.

Mike Heins
Perusion -- Expert Interchange Consulting    http://www.perusion.com/
phone +1.765.328.4479  tollfree 800-949-1889 <mike at perusion.com>

Fast, reliable, cheap.  Pick two and we'll talk.  -- unknown

More information about the interchange-users mailing list