Community @ The Turning Gate

Support community for TTG plugins and products.

NOTICE

The Turning Gate's Community has moved to a new home, at https://discourse.theturninggate.net.

This forum is now closed, and exists here as a read-only archive.

  • New user registrations are disabled.
  • Users cannot create new topics.
  • Users cannot reply to existing topics.

You are not logged in.

#1 2016-03-30 07:18:58

trummonte
Member
From: Buena Vista, Colorado
Registered: 2012-11-11
Posts: 178
Website

Search based galleries

I wasn't sure where to post this. I have created menu items that are shortcuts to a keyword search. I have a phplugin that removes the block on the search page so that the view looks like a standard gallery page. A couple of questions:

Would it be possible to create a dynamic title for the page based on the search term?

Would it be possible to still have a normal search show up with the block?

Here is a link: https://www.montetrumbull.com/. The galleries I am referring to are under Location, Season, and Aspect. Things are still under construction!

Thanks - Monte

Offline

#2 2016-03-30 08:24:06

trummonte
Member
From: Buena Vista, Colorado
Registered: 2012-11-11
Posts: 178
Website

Re: Search based galleries

I realized that I was removing the block on all pages after posting that. I thought the following would target just the Search page which uses the template named "search".

// Search page //
function ttg_block_top( $style, $path ) {
    if (G_TEMPLATE == 'search') {
        echo '
        BLOCK
        ';
        return false;
    }
}  //END

Monte

Offline

#3 2016-03-30 09:20:06

rod barbee
Moderator
From: Port Ludlow, WA USA
Registered: 2012-09-24
Posts: 17,830
Website

Re: Search based galleries

try adding return true; after the first closing curly brace.

// Search page //
function ttg_block_top( $style, $path ) {
    if (G_TEMPLATE == 'search') {
        echo '
        BLOCK
        ';
        return false;
    }
       return true;
}  //END

Rod 
Just a user with way too much time on his hands.
www.rodbarbee.com
ttg-tips.com, Backlight 2/3 test site

Offline

#4 2016-03-30 09:22:57

Daniel Leu
Moderator
Registered: 2012-10-11
Posts: 1,624
Website

Re: Search based galleries

Hey Monte, I like your approach and this is something I have been thinking of doing for a while.

On my site I currently use ''if (ALBUMTITLE == 'Search Results' )'' to detect the search page.

Another thought I had, but never really tried, is locating the search page somewhere else and make a 'gallery' of search pages. Something like this

stock/location     <- regular gallery page
stock/location/a   <- search page
stock/location/b   <- search page
stock/location/c   <- search page

With this scheme, it should be possible to create the page title from the ''CURRENTPAGEURL'' or ''G_PATH''.

Again, these hierarchical search galleries might be wishful thinking.... Search performance might be something else to consider as well.

Best
Daniel

Last edited by Daniel Leu (2016-03-30 09:24:17)


Daniel Leu | Photography   
DanielLeu.com
My digital playground (eg, Backlight tips&tricks): lab.DanielLeu.com

Offline

#5 2016-03-30 09:31:23

trummonte
Member
From: Buena Vista, Colorado
Registered: 2012-11-11
Posts: 178
Website

Re: Search based galleries

Thanks Rod, that worked perfectly.

Thanks for the ideas Daniel. I will look into that.

Monte

Offline

Board footer

Powered by FluxBB