Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / How to Add Content Below category listings?

How to Add Content Below category listings?

Views: 1,576

Results 1 to 10 of 10
19 Oct 2011, 1:36 PM
#1
cheapstairparts avatar

cheapstairparts

Zen Follower

Join Date:
Oct 2007
Posts:
149
Plugin Contributions:
0

How to Add Content Below category listings?

Looking to do something that is mainly for on-page SEO. I want to be able to put text content below everything, on any page.

Example. This is my main "iron baluster" category. http://cheapstairparts.com/iron-balusters

Under all of the sub-category buttons I want to have 2-3 paragraphs of text that I can write about Iron Balusters, just to increase my text to HTML ratio and do some SEO stuff there.

Is there a mod like this out there or could somebody create one? Where do I post for paid work?

19 Oct 2011, 1:58 PM
#2
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: How to Add Content Below category listings?

Swguy's boilerplate file tips could be adapted to your desires. My Extra Boilerplate extension of that (not yet released) may actually be best suited to what you want to do; I will attach it here if you want to test it. It probably needs a bit of cleanup before releasing into the wild. I think it could be dropped into the category page (only one function call required) and work on a trigger in the category description as well as in the product description.

19 Oct 2011, 2:08 PM
#3
dgent avatar

dgent

Totally Zenned

Join Date:
Nov 2009
Location:
UK
Posts:
1,117
Plugin Contributions:
0

Re: How to Add Content Below category listings?

Why not just add the lines below your header picture for the category, would be much simpler, or instead of that jpeg image you have with text on it, make it spiderable text instead.

I would also add the words 'Iron Balusters' to the end of every subcategory title, so 'Twist & Basket' becomes 'Twist & Basket Iron Balusters'

Would help SEO a lot.

19 Oct 2011, 5:56 PM
#4
cheapstairparts avatar

cheapstairparts

Zen Follower

Join Date:
Oct 2007
Posts:
149
Plugin Contributions:
0

Re: How to Add Content Below category listings?

Adding that banner has upped my conversion rate 3-4%. I don't want to push the categories / products down any further than I have. That is why I want the SEO text content below everything.

email me anything you want me to test. sales (at) cheapstairparts (dot) com

19 Oct 2011, 8:56 PM
#5
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: How to Add Content Below category listings?

Actually it was a different mod that needs cleanup before others try to use it. The Extra Boilerplate code is so small I can just post it here.

/includes/functions/extra_functions/extra_boilerplate_functions.php```php

<?php /** * @copyright Copyright 2011 Glenn Herbert * @license http://www.gnu.org/licenses/ GNU Public License V3.0 * /includes/functions/extra_functions/extra_boilerplate_functions.php * Extra Boilerplate by Glenn Herbert (gjh42) 2011-03-18 * based on swguy's boilerplate file technique - can be used alongside it */ function html_include_cb($match) { $prefix = "HTML_INCLUDE_"; $match_filename = str_replace($prefix, '', $match[0]); $filename = DIR_WS_LANGUAGES . $_SESSION['language'] . '/boilerplate/' . $match_filename . ".html"; $buffer = ""; if (file_exists($filename)) { $handle = @fopen($filename, "r"); while (!feof($handle)) { $buffer .= fgets($handle, 4096); } fclose($handle); } return $buffer; } function extra_boilerplate($products_description, $output=true) {//proofing against empty description 20110417 $extra_text = array(); if ($products_description != '') { $pattern = "/HTML_X_INCLUDE_[a-zA-Z0-9]*/"; preg_match_all($pattern, $products_description, $match); $match[0] = str_replace('HTML_X_INCLUDE_','HTML_INCLUDE_',$match[0]); foreach($match[0] as $key => $value){ $bit = str_replace('HTML_INCLUDE_','',$key); $item[0] = $value; $extra_text[$bit] = html_include_cb($item); } }//echo blank or return empty array if no desc if ($output) {// output immediately or return array content echo implode('',$extra_text); }else{ return $extra_text; } } ?>

readme_eb1_0.txt

  • @copyright Copyright 2011 Glenn Herbert
  • @license http://www.gnu.org/licenses/ GNU Public License V3.0
  • Extra Boilerplate by Glenn Herbert (gjh42) 2011-04-17
  • based on swguy's boilerplate file technique.
  • can be used in conjunction with the original technique;
  • leave the function code out of tpl_product_info_display.php.

Files included:
/includes/functions/extra_functions/extra_boilerplate_functions.php
/includes/languages/english/boilerplate/bp1.html

FTP the /includes/ folder in this package to the root of your store.
The files will automatically be placed in the correct locations.

Add to your custom product info page file, in the location you want the new text:
(/includes/templates/your_template/templates/tpl_product_info_display.php)

<!-- bof html description --> <?php extra_boilerplate($products_description); ?> <!-- eof html description -->

Add to the product description (doesn't matter where) in admin:

<!-- HTML_X_INCLUDE_bp1 -->

Replace bp1 with the filename you want to use.
Save your boilerplate file as
/includes/languages/english/boilerplate/bp1.html

You can have as many versions of HTML_X_INCLUDE_whatever as you like
inside the comment tags; they will be output in the order they appear.

================================================================
Advanced usage:

To manipulate the text with PHP, call the function like

$extra_boilerplate = extra_boilerplate($products_description, false);

You can now do what you like with the content of $extra_boilerplate,
which will hold an array with each file's content as the value of its filename as key.

foreach($extra_boilerplate as $key=>$value){//output size chart(s) if any
if(strpos($key,'size_chart') !== false) echo $value;
}

You can adjust the function call to refer to $categories_description:


<!-- bof html description -->
<?php extra_boilerplate($categories_description); ?>
<!-- eof html description -->
20 Oct 2011, 9:08 AM
#6
dgent avatar

dgent

Totally Zenned

Join Date:
Nov 2009
Location:
UK
Posts:
1,117
Plugin Contributions:
0

Re: How to Add Content Below category listings?

CheapStairParts:

Adding that banner has upped my conversion rate 3-4%. I don't want to push the categories / products down any further than I have. That is why I want the SEO text content below everything.

email me anything you want me to test. sales (at) cheapstairparts (dot) com

Yes, it would do. I have similar things on every category on all of the sites I have. But you could make that banner proper content of images AND spiderable text, instead of being a full jpeg image.

26 Oct 2011, 1:22 PM
#7
cheapstairparts avatar

cheapstairparts

Zen Follower

Join Date:
Oct 2007
Posts:
149
Plugin Contributions:
0

Re: How to Add Content Below category listings?

Just wanted to update this for people looking for the same thing

I actually paid a freelancer $50 to create this for me.

http://cheapstairparts.com/iron-balusters

scroll to the bottom. It added a 2nd content block. You add the bottom content in the admin panel in the same place you edit the top area descriptions.

I'm pretty impressed. Now I can SEO All of my product category pages without having to push the category links farther down the page.

26 Oct 2011, 2:39 PM
#8
dgent avatar

dgent

Totally Zenned

Join Date:
Nov 2009
Location:
UK
Posts:
1,117
Plugin Contributions:
0

Re: How to Add Content Below category listings?

You could also use this code in the category description...

<script language="javascript"> function toggle() { var ele = document.getElementById("toggleText"); var text = document.getElementById("displayText"); if(ele.style.display == "block") { ele.style.display = "none"; text.innerHTML = "More Info..."; } else { ele.style.display = "block"; text.innerHTML = "Close"; } } </script>

<a id="displayText" href="javascript:toggle();">More Info...</a><div id="toggleText" style="display: none">CONTENT CONTENT CONTENT CONTENT CONTENT CONTENT CONTENT CONTENT CONTENT CONTENT CONTENT CONTENT CONTENT CONTENT CONTENT CONTENT CONTENT CONTENT CONTENT CONTENT CONTENT CONTENT CONTENT CONTENT CONTENT CONTENT CONTENT CONTENT CONTENT CONTENT CONTENT CONTENT </div>

This will make a 'More Info...' link which opens up a div with all your content in which will open ABOVE the categories. If you actually removed the More Info and put a decimal point for instance which a customer probably wouldnt even notice, this effectively would be like having hidden content which search engines will not penalise and will spider accordingly.

31 Oct 2011, 4:34 AM
#9
lindasdd avatar

lindasdd

Zen Follower

Join Date:
Jun 2007
Posts:
474
Plugin Contributions:
0

Re: How to Add Content Below category listings?

Hate to jump in after you've had a custom mod made, but I think this free one does the trick - or at least it did for me:

Short Description of Categories MOD

-lindasdd

31 Oct 2011, 10:43 AM
#10
dgent avatar

dgent

Totally Zenned

Join Date:
Nov 2009
Location:
UK
Posts:
1,117
Plugin Contributions:
0

Re: How to Add Content Below category listings?

lindasdd:

Hate to jump in after you've had a custom mod made, but I think this free one does the trick - or at least it did for me:

Short Description of Categories MOD

-lindasdd

Thats excellent, thanks for that.