Created
August 31, 2011 14:37
-
-
Save charleshimmer/1183691 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// When doing smart SEO advanced you will check for the existence of a URL parameter named bvrrp. | |
// If that parameter exists, you will check to make sure that file exists on disk, and then include it. | |
// For example, if the product id was 6789 and page 2 was being requested, the parameter bvrrp would be 1230-en_us/reviews/product/2/6789.htm. | |
// If that parameter doesn't exist, you will default to including page 1. | |
// Here is an example function you might write to handle this logic. | |
function getRRSmartSEOFile() { | |
$SEOParam = getURLParameter('bvrrp'); | |
$SEOFile = '/path/to/smartseo/' + $SEOParam; | |
$defaultSEOFile = '/path/to/smartseo/1230-en_us/reviews/product/1/' + productID + '.htm'; | |
if ( hasValue($SEOParam) && fileExists($SEOFile) ) { | |
return $SEOFile; | |
} else if ( fileExists($defaultSEOFile) ){ | |
return $defaultSEOFile; | |
} else { | |
return null; | |
} | |
} | |
// then on the actual product detail page you would do something like this | |
<div id="BVRRContainer"> | |
{ if getRRSmartSEOFile() != null then insert stringReplaceURLs(getRRSmartSEOFile()) } | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment