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 December 20th, 2011, 03:53 PM
digitalcow digitalcow is offline
 
Join Date: Jun 2010
Posts: 494
Default Unique content on each category homepage

Eric,

Been playing in the factory but either have gone mad (very likely) or it's not there....is there an easy way to add unique content for different categories? I know we can set a view in the factory but that's for all the categories and so anything added there will appear on each category page. Am about to launch a new store with 4,000 categories (top level, sub and sub sub) and want unique content on the 60 or so top level category pages.
  #2  
Old December 20th, 2011, 04:26 PM
Eric's Avatar
Eric Eric is offline
Datafeedr Team
 
Join Date: Feb 2008
Posts: 16,902
Default

Hi

The easiest way to solve this issue is like this... You will have the Text module in your Default Category view. But in there you will add some PHP logic. You will just need to know your category IDs (which you can get on the category pages in the Factory). So in your text module you will have something like this:

PHP Code:
<?php if ($category->id == 688324) : ?>
    Unique content for category with ID 688324.
<?php endif; ?>

<?php if ($category->id == 688325) : ?>
    Unique content for category with ID 688325.
<?php endif; ?>

<?php if ($category->id == 688331) : ?>
    Unique content for category with ID 688331.
<?php endif; ?>
Then you will be able to display whatever you want for whatever category you desire.

Eric
  #3  
Old December 24th, 2011, 02:25 PM
digitalcow digitalcow is offline
 
Join Date: Jun 2010
Posts: 494
Default

Thanks, works well. Would it also work on product pages? I assume for that I would use the product ID in place of category
  #4  
Old December 24th, 2011, 06:03 PM
Eric's Avatar
Eric Eric is offline
Datafeedr Team
 
Join Date: Feb 2008
Posts: 16,902
Default

Yes, that's right:

PHP Code:
<?php if ($product->id == 1234567890) : ?> 
    Unique content for product with ID 1234567890. 
<?php endif; ?>
  #5  
Old January 5th, 2012, 07:33 PM
johnpo johnpo is offline
 
Join Date: May 2011
Posts: 48
Default

Is there a quicker way of gaining the category numbers so as to populate the file and is there a danger the php file will be too slow to load at some point? (140 categories)
  #6  
Old January 5th, 2012, 08:25 PM
Eric's Avatar
Eric Eric is offline
Datafeedr Team
 
Join Date: Feb 2008
Posts: 16,902
Default

Hi

I don't think there is any quicker way to get the category numbers other than accessing your DB directly using something like phpMyAdmin.

Personally, I would use your theme's functions.php or an included file to handle large conditional statements.

Eric
  #7  
Old January 7th, 2012, 05:22 AM
digitalcow digitalcow is offline
 
Join Date: Jun 2010
Posts: 494
Default

johnpo,

Lucky man only having 140 categories, I have 4700 on my site hehe

I found that after a while the file does indeed get too large and breaks the store. I found (via the input from Eric) the best way to do it was to have an individual text file for each section and load that via a php includes. Takes a little longer but works perfectly
  #8  
Old January 7th, 2012, 10:41 AM
Giftoly Giftoly is offline
 
Join Date: Dec 2011
Posts: 52
Default

Hi, I am just updating my site with the above which is great but as a non coder, this is a bit new to me.

Can you point me in the direction of how within the text / unique content section I can add paragraph spacing / return?

Many thanks for your help!
__________________
Many thanks

John
www.giftoly.co.uk
  #9  
Old January 7th, 2012, 11:17 AM
digitalcow digitalcow is offline
 
Join Date: Jun 2010
Posts: 494
Default

I added <br><br> to create the paragraphs. Use the html formatting and it should come out fine.
  #10  
Old January 7th, 2012, 11:50 AM
Giftoly Giftoly is offline
 
Join Date: Dec 2011
Posts: 52
Default

Thanks ! That's great
__________________
Many thanks

John
www.giftoly.co.uk
  #11  
Old November 18th, 2012, 11:04 AM
Steve243 Steve243 is offline
 
Join Date: Nov 2012
Location: West Midlands, UK.
Posts: 12
Default

Works great, what i have done to save having a mega long file with all additional content for the category pages, is to call in an external file for each category......

<?php if ($category->id == 1042158) : ?>
<?php include('includes/ipad3.txt'); ?>
<?php endif; ?>

<?php if ($category->id == 1042159) : ?>
<?php include('includes/ipad2.txt'); ?>
<?php endif; ?>

Regards, Steve
  #12  
Old November 18th, 2012, 01:08 PM
Eric's Avatar
Eric Eric is offline
Datafeedr Team
 
Join Date: Feb 2008
Posts: 16,902
Default

Hi Steve,

Good idea! That will be easier to update.

Eric
  #13  
Old December 2nd, 2012, 08:01 PM
dutch201 dutch201 is offline
 
Join Date: Nov 2012
Posts: 3
Default

If you don't want to keep adding category id's, you could do something like:

Code:
<?php 

$file = 'includes/' . $category->id . '.txt';
if ( file_exists( $file ) ) {
  include $file;
}

?>
This way you only have to add a new txt file for each category.
  #14  
Old December 3rd, 2012, 07:23 AM
Steve243 Steve243 is offline
 
Join Date: Nov 2012
Location: West Midlands, UK.
Posts: 12
Default

Oh Wow, Brilliant, I will give that a try.
  #15  
Old January 16th, 2014, 04:34 PM
lukasbrisman lukasbrisman is offline
 
Join Date: Dec 2013
Posts: 19
Default

Tried this for merchants with the same code (($merchant->id == XXX) : ?>) but didn't send anything back. Other code for creating content depending on merchant?
  #16  
Old January 16th, 2014, 04:46 PM
Eric's Avatar
Eric Eric is offline
Datafeedr Team
 
Join Date: Feb 2008
Posts: 16,902
Default

Hi,

Merchant IDs are not available on category pages.

Eric
 


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
Unique Content Vs No Content youngy Questions 13 September 23rd, 2011 09:23 AM
Creating unique but shortened Category meta tag descriptions redspan Questions 2 August 15th, 2011 12:25 PM


All times are GMT -5. The time now is 02:33 PM.


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