Language flags only on homepage Language flags only on homepage
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

Language flags only on homepage

Started by scohen125, January 18, 2012, 02:06:17 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

scohen125

I have added the language flags token to my homepage using the curves theme and adding the token {LANGUAGE_SELECT_FLAGS} just above {MESSAGE_BLOCK} in the file template.html .

www.RetinaGallery.com

I'd like it to show only on the homepage and not on all subsequent album or category pages clicked.
It seems like the site visitor can choose his or her language once and then use the site without the flags appearing on each page.  This would save some space on the top of each page and make the website look cleaner.  I appreciate any help with this.  Thanks.

I've attached my template.html file.
Thank you and Happy New Year.

Αndré

Open include/functions.inc.php, find
    if ($gallery_pos) {
        $template    = str_replace('{LANGUAGE_SELECT_FLAGS}', languageSelect('flags'), $template);
    }

and replace with
    if ($gallery_pos) {
        global $CPG_PHP_SELF;
        $superCage = Inspekt::makeSuperCage();
        if ($CPG_PHP_SELF == 'index.php' && !$superCage->get->keyExists('cat')) {
            $template    = str_replace('{LANGUAGE_SELECT_FLAGS}', languageSelect('flags'), $template);
        }
    }

(not tested).

scohen125

I think this is close.
I upgraded coppermine to 1.5.18 (with some trepidation) and then did the revision you posted.

You can go the site www.RetinaGallery.com

On pages other than the homepage, instead of showing the actual language flags, the website shows the text with brackets:
{LANGUAGE_SELECT_FLAGS}


Αndré

Oops, use that code:
    if ($gallery_pos) {
        global $CPG_PHP_SELF;
        $superCage = Inspekt::makeSuperCage();
        if ($CPG_PHP_SELF == 'index.php' && !$superCage->get->keyExists('cat')) {
            $template    = str_replace('{LANGUAGE_SELECT_FLAGS}', languageSelect('flags'), $template);
        } else {
            $template    = str_replace('{LANGUAGE_SELECT_FLAGS}','', $template);
        }
    }

scohen125

Perfect - thanks.  I think my site looks much better now.  I appreciate your help.