Datafeedr Support Forums

Datafeedr Support Forums (http://www.datafeedr.com/forums/index.php)
-   Questions (http://www.datafeedr.com/forums/forumdisplay.php?f=67)
-   -   How do I make unique title tags for merchant filter widget pages? (http://www.datafeedr.com/forums/showthread.php?t=3812)

cashnow January 28th, 2011 10:18 PM

How do I make unique title tags for merchant filter widget pages?
 
This one is almost the same question as this post, but now only using I want to do the same thing with the merchant filter.

Thank you!

Eric January 29th, 2011 10:38 AM

It's pretty much the same way as the price, except simpler:

HTML Code:

<?php
function merchant_title($merchant) {
    $merchant = strip_tags($merchant);
    return $merchant;
}
?>


<title>[category.name] | <?php if (@$_GET['merchant']) { ?> Provided by <?php echo merchant_title($_GET['merchant']); ?> | <?php } ?> </title>


cashnow January 29th, 2011 05:18 PM

How would I combine the two?

Eric January 29th, 2011 06:29 PM

Hi

Just add the 2 functions to the top of the <head> area and then insert the PHP code where you want the information to appear.

Something like this should get you started:

PHP Code:

<?php
function merchant_title($merchant) {
    
$merchant strip_tags($merchant);
    return 
$merchant;
}
function 
forbabygifts_format_price($price) {
    
$price strip_tags($price);
    
$price explode("-"$price);
    if (
trim($price[0]) == '')
        
$html 'less than $'.$price[1];
    elseif (
trim($price[1]) == '')
        
$html 'more than $'.$price[0];
    else
        
$html '$'.$price[0] . ' - ''$'.$price[1];
    return 
$html;
}
?>

<title>[category.name] | <?php if (@$_GET['merchant']) { ?> Provided by <?php echo merchant_title($_GET['merchant']); ?> | <?php ?> <?php if (@$_GET['price']) { ?> Price is <?php echo forbabygifts_format_price($_GET['price']); ?> | <?php ?> </title>

Eric


All times are GMT -5. The time now is 10:09 AM.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.