Datafeedr Support Forums  

Go Back   Datafeedr Support Forums > Current Version (V3) Forum > Questions
Home Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Important - The support forums are now in "read-only" mode as we transition to an alternative help desk solution. Feel free to contact us here with any of your questions or search the forums for an existing solution.
 
 
Thread Tools Search this Thread Display Modes
  #1  
Old January 28th, 2011, 01:36 PM
cashnow cashnow is offline
 
Join Date: Sep 2009
Posts: 362
Default How do I make unique title tags for price filter widget pages?

(I am using the filter by price widget in this question.)

I see that once I click on a filter by price link, the same category title is used in the price filter. I am wondering if there is a way to create a unique title based on the price as well as the current category.

This is a good example. They use the category name but also get under $50 into the title.



Store ID 6719
www.forbabygifts.com
  #2  
Old January 28th, 2011, 01:55 PM
Eric's Avatar
Eric Eric is offline
Datafeedr Team
 
Join Date: Feb 2008
Posts: 16,902
Default

This works for me in the <head> elements:

PHP Code:
<?php
function 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['price']) { ?> Price is <?php echo format_price($_GET['price']); ?> | <?php ?> </title>
  #3  
Old January 28th, 2011, 03:03 PM
cashnow cashnow is offline
 
Join Date: Sep 2009
Posts: 362
Default

In the filter by price widget head elements? I tried it there and do not see changes.

Any ideas?
  #4  
Old January 28th, 2011, 03:04 PM
Eric's Avatar
Eric Eric is offline
Datafeedr Team
 
Join Date: Feb 2008
Posts: 16,902
Default

No, in the CATEGORY PAGE > Default > View menu > View <head> Elements section.
  #5  
Old January 28th, 2011, 03:26 PM
cashnow cashnow is offline
 
Join Date: Sep 2009
Posts: 362
Default

I have views created for my category pages. (I did try it in default but no dice).

I did it in one of my views, but when I added the price widget, my left navigation disappeared. You can see it here

This is what I added to the <head> elements of that view

<?php
function 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>Christening Rosaries | Christening Rosary Gift Ideas | [store.if page="on"] | page [store.page] | [/store.if]<?php if (@$_GET['price']) { ?> Price is <?php echo format_price($_GET['price']); ?> | <?php } ?> </title>
  #6  
Old January 28th, 2011, 03:40 PM
Eric's Avatar
Eric Eric is offline
Datafeedr Team
 
Join Date: Feb 2008
Posts: 16,902
Default

I inserted your exact code into my test site and it worked fine.

You can see that it does work here where you have added the code to the <head> element.

Regarding your sidebar disappearing, are you sure it's related to the <head> code? Could it be something in your widget settings?

Eric
  #7  
Old January 28th, 2011, 04:01 PM
cashnow cashnow is offline
 
Join Date: Sep 2009
Posts: 362
Default

I think it is due to my widget settings. And your example looks great! That is exactly what I wanted.
  #8  
Old January 28th, 2011, 04:05 PM
cashnow cashnow is offline
 
Join Date: Sep 2009
Posts: 362
Default

But this is weird. If I use the tag cloud setting, my left nav stays with the tag cloud. When I switch it to price filter, my left navigation disappears.
  #9  
Old January 28th, 2011, 04:09 PM
Eric's Avatar
Eric Eric is offline
Datafeedr Team
 
Join Date: Feb 2008
Posts: 16,902
Default

Are you clicking "Save" when you make an edit to the widgets on the WP widgets page?
  #10  
Old January 28th, 2011, 04:37 PM
cashnow cashnow is offline
 
Join Date: Sep 2009
Posts: 362
Default

Yes, and after I refresh the page, it vanishes.
  #11  
Old January 28th, 2011, 04:43 PM
Eric's Avatar
Eric Eric is offline
Datafeedr Team
 
Join Date: Feb 2008
Posts: 16,902
Default

Are you using some type of widget context filter plugin?
  #12  
Old January 28th, 2011, 04:53 PM
cashnow cashnow is offline
 
Join Date: Sep 2009
Posts: 362
Default

I am using the Widget Context plugin. And I have it set to Show on Selected and store/category* assigned to it.
  #13  
Old January 28th, 2011, 05:40 PM
Eric's Avatar
Eric Eric is offline
Datafeedr Team
 
Join Date: Feb 2008
Posts: 16,902
Default

What happens if you remove the extra <title> stuff that we did? Does the widget come back?
  #14  
Old January 28th, 2011, 05:52 PM
cashnow cashnow is offline
 
Join Date: Sep 2009
Posts: 362
Default

Yes, it does.
  #15  
Old January 28th, 2011, 06:04 PM
Eric's Avatar
Eric Eric is offline
Datafeedr Team
 
Join Date: Feb 2008
Posts: 16,902
Default

Maybe try renaming the function call from format_price to forbabygifts_format_price. Maybe it's conflicting with another function.

PHP Code:
<?php
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>Christening Rosaries | Christening Rosary Gift Ideas | [store.if page="on"] | page [store.page] | [/store.if]<?php if (@$_GET['price']) { ?> Price is <?php echo forbabygifts_format_price($_GET['price']); ?> | <?php ?> </title>
  #16  
Old January 28th, 2011, 06:11 PM
cashnow cashnow is offline
 
Join Date: Sep 2009
Posts: 362
Default

Tah-Da!!!!! .....and Thank you!!

Now, one last question, if I also want to do this with filter by merchant widget, is there a code for that as well?
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Add filter for sale price in the Merchant Discovery Tool ayorofrance Feature Requests 1 March 31st, 2012 11:16 AM
How to "SEO" Handle Tags, Merchant, Price Searches pages? cashnow Questions 14 January 26th, 2011 08:58 PM


All times are GMT -5. The time now is 12:29 PM.


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