www.flickr.com
    raschnet's items Go to raschnet's photostream

    September 24, 2007

    Gallery 2.2–Multisite and Multiroot

    Tags: , , , , , ,
    — drasch @ 9:48 pm

    Recently I tried to use the Gallery Multiroot module/plugin to setup a new site based upon an existing Album in our gallery. Since we started sorting albums chronologically, we wanted to sort out the Dachshund photos separately. To do this, I used the Multiroot feature. Unfortunately, I couldn’t get this to work as I’m already using the Multisite plugin to host several Galleries off of my web server. The magic touch was to use the following file, the first line is key and had to be added to make things work in the Multisite configuration.

    
    define('GALLERY_CONFIG_DIR', "/var/virtualwww/gallery.raschnet.com");  //I had to add this line
    
    require('/usr/local/share/gallery2/embed.php');
    $ret = GalleryEmbed::init(
        array('embedUri' => '/',
              'g2Uri' => 'http://gallery.raschnet.com/',
              'apiVersion' => array(1, 2)
        ));
    
    if ($ret) {
        print '<body>' . $ret->getAsHtml() . '</body>';
        return;
    }
    
    $gallery->setConfig('login', true);
    $gallery->setConfig('defaultAlbumId', 28426);
    $gallery->setConfig('breadcrumbRootId', 28426);
    
    GalleryMain();
    

    Now live: DRNA Gallery

    Related posts

    5 Comments »

    1. Thanks for posting this. I was having such grief getting multisite & multiroot to play nice.

      Comment by elliot — October 19, 2007 @ 11:36 pm

    2. Any chance you could put this tip into the discussion area at gallery.menalto.com for this module? It’s really important. Thanks

      Comment by Ann Sera — January 30, 2008 @ 3:09 pm

    3. I got it to work but only to display the main page. Any links I click on the display page generates a 404. Not sure if it’s because of the URL rewrite module in use.

      Comment by George — July 8, 2008 @ 12:16 am

    4. If you’re getting a 404 error, then the problem would be in either Apache, the Rewrites, or the URL’s that Gallery’s generating. If you’re using a .htaccess file on your main site, make sure to copy it over and modify it for the new site. If not, make sure the URL’s that are being generated match the pattern of the main URL.

      Comment by drasch — July 8, 2008 @ 6:20 am

    5. OK, now I’ve got it all working except that when the user is at the item level and clicks on the root breadcrumb that would take them to the thumbnail view, I get a 404.

      Comment by George — July 8, 2008 @ 10:39 pm

    RSS feed for comments on this post. TrackBack URI

    Leave a comment