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 February 5th, 2011, 09:58 AM
lbuilta59 lbuilta59 is offline
 
Join Date: Jan 2011
Posts: 56
Default Custom text field for category also on sub pages?

Eric -
Is there any way to continue this so the same custom text shows on all sub category pages for the main category? I've got the main category page all set but would like the text on all sub category pages as well.

I've linked to the first thread here:
http://www.datafeedr.com/forums/showthread.php?t=3823
  #2  
Old February 5th, 2011, 10:00 AM
Eric's Avatar
Eric Eric is offline
Datafeedr Team
 
Join Date: Feb 2008
Posts: 16,902
Default

So do you want it to appear on all category pages or just all sub-category pages?

Also, is the custom text going to be the same or different depending on the category?
  #3  
Old February 5th, 2011, 12:53 PM
lbuilta59 lbuilta59 is offline
 
Join Date: Jan 2011
Posts: 56
Default

The custom text that appears on the category page (brand) would appear on all pages (pagination) of that category itself plus on all pages of any subcategories I create for that category (brand).

The main goal is to have a coupon code at the top of all pages where anybody who lands on that page can easily see it.
  #4  
Old February 5th, 2011, 01:00 PM
Eric's Avatar
Eric Eric is offline
Datafeedr Team
 
Join Date: Feb 2008
Posts: 16,902
Default

Probably the easiest way is to add a Text module to your Default Category page with an if () conditional in like this:

PHP Code:
<?php if ($category->id == 123456 || $category->parent == 123456) { ?>
Text to display for just this parent category and its sub-categories.
<?php ?>
  #5  
Old February 7th, 2011, 12:01 PM
lbuilta59 lbuilta59 is offline
 
Join Date: Jan 2011
Posts: 56
Default

<?php if ($category->id == 123456 || $category->parent == 123456) { ?>
Text to display for just this parent category and its sub-categories.
<?php } ?>

Is the first category ID (red) the sub category and the second (green) the parent? I tried this putting the parent category # in both fields but the text disappeared completely.

I am trying to insert text with a clickable (affiliate) link.
  #6  
Old February 7th, 2011, 12:05 PM
Eric's Avatar
Eric Eric is offline
Datafeedr Team
 
Join Date: Feb 2008
Posts: 16,902
Default

Hi

123456 is the category ID of the category you want your custom text to display in when a user is in that category (or one of that category's sub-categories). You would use the same ID in each part of the if() conditional.

Eric
  #7  
Old February 7th, 2011, 12:41 PM
lbuilta59 lbuilta59 is offline
 
Join Date: Jan 2011
Posts: 56
Default

Great, I got it work for the first level of sub categories but can we take it one level deeper?
Parent>sub category>sub category.
  #8  
Old February 7th, 2011, 12:57 PM
Eric's Avatar
Eric Eric is offline
Datafeedr Team
 
Join Date: Feb 2008
Posts: 16,902
Default

Three levels deep is not possible. That code will only work for 2 levels only. Doing it for 3 levels is not going to be possible.
  #9  
Old February 7th, 2011, 12:59 PM
lbuilta59 lbuilta59 is offline
 
Join Date: Jan 2011
Posts: 56
Default

Ok, thank you. Two levels works
 


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
Custom text box at top of specific category? lbuilta59 Questions 4 January 31st, 2011 06:10 PM


All times are GMT -5. The time now is 06:41 AM.


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