[ic] User-based Alternate Page Set?

Thomas J.M. Burton tom at globalfocusdm.com
Fri Feb 27 18:35:11 UTC 2009


Mike Heins wrote:
> 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';
>     }
>     EOS
>     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.

Awesome! I'll give that a try later today. Thanks, Mike! :)

Best,
Tom

-- 
_______________________________
Global Focus Digital Media, LLC
www.globalfocusdm.com



!DSPAM:49a8325f225841717665379!





More information about the interchange-users mailing list