• I have 2 galleries linked to their own page. I have another page acting as the parent of the 2 gallery pages. I then have the 2 galleries inside an album which I have inside a top (Photo Gallery) page & album. Page heirarchy is:

    Photo Gallery (main album)
    – gallery (with a page)
    – another gallery (with a page)
    – subalbum
    — gallery 1
    — gallery 2

    When I’m in the main album (Photo Gallery) and go into “gallery” or “another gallery” my breadcrumb is as expected, ie:

    Home >> Photo Gallery >> gallery
    or
    Home >> Photo Gallery >> another gallery

    However, when I go into subalbum, Nextgen doesn’t open up the subalbum page but instead opens up gallery 1 and gallery 2 in the main album page acting as if “Deactivate gallery page link:” were checked. Breadcrumb shows:

    Home >> Photo Gallery

    When I then open up either gallery 1 or gallery 2, my breadcrumb shows, as how I expect it:

    Home >> Photo Gallery >> subalbum >> gallery 1

    or

    Home >> Photo Gallery >> subalbum >> gallery 2

    Nextgen seems to ignore the parent page of the galleries inside an album. I hope this is a known issue and a fix is in the works? Thanks.

    George

Viewing 9 replies - 1 through 9 (of 9 total)
  • Thread Starter grtwordpress

    (@grtwordpress)

    Replying to myself. I created a solution that gives me what I want. In the nggCreateAlbum function in nggfunctions.php, look for the line:

    if ( !$subalbum = $nggdb->find_album(substr( $key, 1)) )
    continue;

    and insert the following:

    // george stuff
    //
    $gt_gal = $wpdb->get_results(‘SELECT * FROM ‘.$wpdb->nggallery.
    ‘ WHERE gid IN (\”.implode(‘\’,\”, $subalbum->gallery_ids).’\’)’, OBJECT_K);

    $gt_id = $gt_gal[$subalbum->gallery_ids[0]]->pageid;
    $gt_parent = get_post_ancestors($gt_id);
    $galleries[$key]->pagelink = get_permalink( $gt_parent[0]);
    $galleries[$key]->galdesc = html_entity_decode ( nggGallery::i18n($subalbum->albumdesc) ) .

    This sub-album contains ” . count($subalbum->gallery_ids) . ” albums.
    “;

    // $galleries[$key]->counter = count($subalbum->gallery_ids);

    // Make sure to comment out the lines below
    //
    // $galleries[$key]->pagelink = …
    // $galleries[$key]->galdesc = …

    // end of george stuff

    that’s it. You can see this at work at https://photoblog.torralba.us/photo-gallery

    Hello George, and thanks for the code.

    I made your change to the code but nothing happened ??

    I have a page called gallery whic this code
    [album=x,compact]

    Then I created a main album called Calendars and more 3 albums (calendar 2007, calendar 2008, calendar 2010)

    Then I created a gallery for each album (calendar 2007, calendar 2008, calendar 2010) and I associated them to the relative album.
    At least I put all the 3 albums under the main one: Calendars

    The page jsut display the 3 galleries alendar 2007, calendar 2008, calendar 2010… and not only the main album ??

    What can i do? Is there any way to do what i need?

    Thanks for your helps!

    Hi, George..
    thnx for code… but can u help me, I don’t understand this part

    // Make sure to comment out the lines below
    //
    // $galleries[$key]->pagelink = ...
    // $galleries[$key]->galdesc = ...

    do i have to remove // and what should I write instead of dots?

    I did same like kreatyve, but i got only name of album and list of subalbums on main page.. I’d like to have exactly like on your page, it looks great!

    Thread Starter grtwordpress

    (@grtwordpress)

    I had changed the code somewhat because get_post_ancestors() is flaky or I don’t really understand that function. Anyway, here’s the whole part of subalbum logic that has my change -> https://photoblog.torralba.us/subalbum.txt. Hope that helps.

    @grtwordpress, this is impressive. would you happen to know how you got the slidepress to load the xml dynamically?

    Thread Starter grtwordpress

    (@grtwordpress)

    I hacked the slidepress shortcode to add an xmlsource attribute.

    Hi, i’m kind of new to wordpress, only been using it for the past five months or so, and just stumbled upon NGG. I’m having this exact same problem, and i’ve tried patching the php file in question with the code given above, but I still can’t seem to get it. Any help provided would be greatly appreciated

    – grtwordpress

    What breadcrumb do you use? I am looking all over the web to have the exact same breadcrumb functionality you have. I tried your PHP code but i have the feeling that my lack of PHP knowledge fails on me to tell me what i need to implement where. I added your PHP code in nggFunctions just like you say and tried to create a new album, new subalbum and new child galleries to see if anything changed, but it didn’t show up in my breadcrumb. I currently use Breadcrumb NavXT.

    Any help would be extremely appreciated.

    Thanks in advance,

    g.

    I found the answer to my problem: Having a breadcrumb work with NextGEN Gallery

    You can find my response in this thread.

    Cheers,

    g.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘[Plugin: NextGEN Gallery] Subalbum does not open in assigned page’ is closed to new replies.