Custom Pages in Foreign Language

Report issues with Enuuk Auction Platform or Mods here - remember to raise a ticket with phpauction.net as well
Post Reply
RWAP
Site Admin
Posts: 748
Joined: Fri Jan 08, 2010 2:23 am
Location: Stoke-on-Trent
Contact:

Custom Pages in Foreign Language

Post by RWAP » Fri Mar 15, 2013 12:59 pm

When you set up several custom pages under one section (thematic), you see a list of the pages when you click on that section name (in the header/footer or wherever you placed it).

However, if you are viewing the site in a foreign language, the English titles of the pages appear when you click on the section name.

To overcome this, edit class\Action\CustomPage.php

Find:

Code: Select all

        $pages      = array_slice($pages, $bottomCut, $maxListed);
Change this to:

Code: Select all

        $pages      = array_slice($pages, $bottomCut, $maxListed);
        foreach ($pages as &$cPage){
        	$customPage=CustomPage::getInstanceFromDB($this->db,$cPage['id']);
        	$title = $customPage->getTitle($this->context->language);
            $cPage['title'] = strip_tags($title) ? $title : $customPage->getTitle($this->context->siteOptions['defaultLanguage']);
        }
Last edited by RWAP on Thu May 09, 2013 2:15 pm, edited 1 time in total.
Reason: Corrected an error in the code

RWAP
Site Admin
Posts: 748
Joined: Fri Jan 08, 2010 2:23 am
Location: Stoke-on-Trent
Contact:

Re: Custom Pages in Foreign Language

Post by RWAP » Fri Mar 15, 2013 1:04 pm

I have also had a couple of issues when creating a new custom page - the date can be set to 00/00/0000 (!)

The issue looks to be in class\Action\Admin\CustomPages.php, where appears the line:

Code: Select all

                $data['date']  = $par['displayedDate'];
This should surely be:

Code: Select all

                $data['date']  = $par['date'];

RWAP
Site Admin
Posts: 748
Joined: Fri Jan 08, 2010 2:23 am
Location: Stoke-on-Trent
Contact:

Re: Custom Pages in Foreign Language

Post by RWAP » Thu May 09, 2013 2:14 pm

The page title will also always appear in the default language for the site, rather than the user's default.

To overcome this in class\Action\CustomPage.php, find:

Code: Select all

        $title = strip_tags($title) ? $thematic->getName($this->context->siteOptions['defaultLanguage']) : $title;
Change this to:

Code: Select all

        $title = strip_tags($title) ? $title : $thematic->getName($this->context->siteOptions['defaultLanguage']);
I have also changed the code in the first post to correct an issue

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest