You are here:  » 1.html


1.html

Submitted by john100 on Wed, 2013-01-23 11:44 in

Hi David,
In order to avoid duplicate content due to navigation.html, I did a modification to transfert to the root of a search instead of creating a 1.html page in the navigation menu each time someone press page 1 (or previous=1). To take into consideration all variation (due to translation for example), I used the URL of the page instead of the regular brand/product... page.

Well there is probably a better/simpliest/cleaner way to do it but it is how i fixed it.

======
after

       $prevHREF = $prevPage.".html";

add
if(strstr($prevHREF,"1.html")) {
$urldemandee=$_SERVER['REQUEST_URI'];
         $urldemandee = str_replace("/2.html","/",$urldemandee);
$prevHREF = $urldemandee;
}

====
after
        $pageOneHREF = "1.html";

add
if(strstr($pageOneHREF,"1.html")) {
$urldemandee=$_SERVER['REQUEST_URI'];
         $pos_url = strripos($urldemandee, "/");
$pos_url=$pos_url+1;
$urldemandee = substr($urldemandee, 0, $pos_url);
$pageOneHREF = $urldemandee;
}

====
after
        $pageHREF = $i.".html";

add
if(strstr($pageHREF,"1.html")) {
$urldemandee=$_SERVER['REQUEST_URI'];
         $pos_url = strripos($urldemandee, "/");
$pos_url=$pos_url+1;
$urldemandee = substr($urldemandee, 0, $pos_url);
$pageHREF = $urldemandee;
}

====

Submitted by support on Wed, 2013-01-23 12:02

Looks good, John!

Cheers,
David.
--
PriceTapestry.com

Submitted by DVDAFFAIRES on Sat, 2013-01-26 17:18

Hi David and John100,

The change does not work properly.
This does not work beyond 10, 20, 30, etc ...
The link works fine on 10, but for 11, the url is empty.
Same for the 21, 31, 41, 51, etc. ...

Cheers,
Raoul

Submitted by support on Sun, 2013-01-27 10:25

Hello Raoul / John,

Have a go with the following modification since it is safe to use "./" to link to the root of the current level. In html/navigation.php, look for the following code at line 12:

  $prevHREF = $prevPage.".html";

...and REPLACE with:

  $prevHREF = ($prevPage==1?"./":$prevPage.".html");

Then look for the following code at line 71:

  $pageHREF = $i.".html";

...and REPLACE with:

  $pageHREF = ($i==1?"./":$i.".html");

...and finally the following code at line 95:

  $nextHREF = $nextPage.".html";

...and REPLACE with:

  $nextHREF = ($nextPage==1?"./":$nextPage.".html");

Cheers,
David.
--
PriceTapestry.com

Submitted by DVDAFFAIRES on Sun, 2013-01-27 17:56

Hi David.

It works perfectly.
Thank you for your intervention (as you work on Sundays??).
: o)

Cheers,
Raoul