• Resolved KeyFocusMedia

    (@keyfocusmedia)


    Okay I have a problem that has me completely stumped, particularly because it appeared to work when I initially set it up but now nothing is working. I hope someone might be able to help.

    Here is what I am trying to accomplish; I have a standard album which displays groups of galleries using the default extended template. No problem there. For a few of the galleries I have additional information that I want to put on the gallery page. So, I used “Add Page” to create a custom page for the album and modified the page with the additional information. Still no problem, I can call up the page and it displays as expected with the new information and gallery photos. Now the problem, even though the gallery has the “Page link to” set to my custom page, it will not display that page when I click on the gallery within the album page. It always displays the page using the default “gallery.php” template.

    Here is what I have verified…

    • The custom gallery page is coded correctly and displays the correct information when called directly.
    • The gallery has the “Page link to” set to the custom page (I’ve done this several times just to be sure).
    • The database “ngg_gallery” table has the correct “pageid” set for the custom page
    • There are no stray templates or filters installed

    And here is what is special about my site…

    • I have a couple of custom NextGen templates stored in my theme directory under “<theme>/nggallery” but nothing for the “album-extended.php” template.
    • I use non-default locations for my content and plugin directories (and have for years) but have never had issues with that before.
    • I have a “wp_reset_query()” in my “header.php” because something is corrupting my “$post” variable (probably a plugin somewhere).
    • I have the “NextGen”, “Event Calendar”, and “TubePress” plugins installed and active.
    • Everything in the template is pretty standard and I did a fresh install of 3.0.1 before starting this project

    I am at a loss as to what the problem may be and could use some advise. I tried stepping through the code with debugger but since I am using NetBeans with its infamous debug crash problems I haven’t been able to get very far. I am still developing this site and it is running locally so I can’t provide a link to the code.

    Ron

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter KeyFocusMedia

    (@keyfocusmedia)

    FOLLOWUP INFORMATION…

    I did have a thought, since I have a custom “gallery.php” template stored in “<theme>/nggallery” I thought that could be causing my problem. So I removed the custom template directory completely but it didn’t make any difference. I am still looking for suggestions!!

    Thanks

    Joseph

    (@jpe24524)

    Make sure Deactivate gallery page link is unchecked under Gallery > Options > Gallery.

    Thread Starter KeyFocusMedia

    (@keyfocusmedia)

    That was it, I should have caught that!!

    Thanks Joseph!!

    Joseph

    (@jpe24524)

    You’re welcome ??

    Thread Starter KeyFocusMedia

    (@keyfocusmedia)

    Final followup…

    Although turning off the deactivate page link solved the problem with linking to custom pages, it created the problem that the default gallery.php template did not display for those galleries that did not have custom pages. What I need is to display a custom page for galleries that have one and display the default page for galleries with no page link defined.

    I got the results I need by turning ON the deactivate page link which asks nggallery to generate a default page link url for every gallery. The generated url triggers the normal nggallery display template. I then added the following filter (in my functions.php) which checks whether there is a link page defined for the particular gallery and overrides the default link url if one is defined. Works like a champ…

    // Modify nggallery page link url
    function gallery_page_url( $gallery ) {
    	if ( $gallery->pageid )
    		$gallery->pagelink = get_permalink( $gallery->pageid );
    
    	return $gallery;
    }
    
    add_filter('ngg_album_galleryobject', gallery_page_url );
Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘[Plugin: NextGEN Gallery] PAGE LINK TO… not working from album page’ is closed to new replies.