Datafeedr Support Forums

Datafeedr Support Forums (http://www.datafeedr.com/forums/index.php)
-   Tips, Tricks & Tutorials (http://www.datafeedr.com/forums/forumdisplay.php?f=66)
-   -   Unique content on ALL product pages (http://www.datafeedr.com/forums/showthread.php?t=6102)

digitalcow January 17th, 2012 04:29 AM

Unique content on ALL product pages
 
Eric,

Thanks for your help in getting the unique content to work on product pages and categories, it's helping the seo a lot.

Have another related question though. I wish to add a unique article to each one of the product pages on my store - about 96,000. I have unlimited unique content so that's not a problem, however if I were to do it the same way as before, using the php to pull a .txt file from a folder, I would end up with at least 275,000 lines on the file which may be a little large!

Is a work around I could use where I could upload tons of articles to a folder and php include a random article?

Eric January 17th, 2012 07:51 AM

Hi

Sure, you could use PHP to grab a random article from a directory. Here's a snippet of code I found after a quick search: http://www.jonasjohn.de/snippets/php/random-file.htm

Eric

digitalcow January 17th, 2012 07:57 AM

thanks, will try.

digitalcow January 31st, 2012 10:39 AM

Eric, Sorry to ask another question on this and dig out an old thread....

Would it be possible to have the random unique content working on each product page but pulling from specific folders depending on which category a product is in?

Lets say I a category ID 1 for dresses, could I use a random code to pull content from a folder called 1. If I had category ID 2 for jeans, i would want to pull random articles from folder 2 to display on products in category 2.

Does that make sense?

Eric January 31st, 2012 10:58 AM

Hi

Sure, you would just need to pass the RandomFile() function the folder name based on the category ID or category slug.

print RandomFile($category->id.'/','.*');

Eric

jguinn1 April 19th, 2012 04:55 PM

Quote:

Originally Posted by digitalcow (Post 27913)
Eric,

Thanks for your help in getting the unique content to work on product pages and categories, it's helping the seo a lot.

Any chance I could get a link to this? Getting unique content would be something I would be interested in too.

Thanks

Eric April 19th, 2012 05:29 PM

Hi
Quote:

Originally Posted by jguinn1 (Post 31150)
Any chance I could get a link to this? Getting unique content would be something I would be interested in too.

The link is posted in post #2 (above).

Eric

raj2006 August 11th, 2013 12:49 PM

Quote:

Originally Posted by Eric (Post 28399)
Hi

Sure, you would just need to pass the RandomFile() function the folder name based on the category ID or category slug.

print RandomFile($category->id.'/','.*');

Eric

Hi Eric,

One small doubt. If I want to use the category slug, then what should come in place of "id" in the above php code?

Also, how to find out the Category IDs for the store categories?

Eric August 11th, 2013 05:02 PM

Hi,

$category->slug will give you the slug.

You can see the category IDs in the Factory on every category page. Example:



Eric

raj2006 August 11th, 2013 06:57 PM

Hi Eric,

Thanks a lot.

Raj

raj2006 August 11th, 2013 08:31 PM

Hi Eric,

I tried this function. It works fine but it assumes that I will have the folders equivalent to category slugs in the root (public_html).

When I have several categories, then the root becomes extremely cluttered with so many folders for the unique content.

I would like to put all these unique content related folders under "unique-content/top/category slug" and "unique-content/bottom/category slug" corresponding to content for top and bottom of the product detail page.

How to add this extra sub-folders specs in this function so that the random file is acquired from inside this sub-folder structure?

Sorry. I don't know php, so I would really appreciate if you would help me with this change.

Thanks

Eric August 12th, 2013 08:59 AM

Hi,

Actually a better method would be to use what was mentioned in post # 13 of this thread: http://www.datafeedr.com/forums/showthread.php?t=5952

I wouldn't put any of the articles in the root folder. I would make a sub-folder and put them there.

Eric

raj2006 August 19th, 2013 06:34 AM

Hi Eric,

I have implemented it successfully. It is working fine now.

Thanks for your help.

Raj


All times are GMT -5. The time now is 11:57 PM.

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