Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / How do I add a text area on the catagory pages?

How do I add a text area on the catagory pages?

Views: 3,708

Results 21 to 33 of 33
6 Aug 2009, 11:12 PM
#21
niccol avatar

niccol

Totally Zenned

Join Date:
Apr 2009
Posts:
2,138
Plugin Contributions:
1

How do I add a text area on the catagory pages?

@dw08gm Well there should be no problem in any position but as long as you have a solution that works for you that is the main thing.

@drunkguy
Well that is a bit bizarre. Have a look at your version of the tpl_ file. You are looking for a line that looks like this:

<div id="categoryDescription_bottom" class="catDescContent"><?php echo $description_bottom;  ?></div>

Which is the line that writes the bottom description to the page. It should only appear once. I am wondering if the file has been a bit scrambled on its route to you.
If that doesn't make any sense then attach the file to a post. You need to zip it first and then you'll be able to attach it. I'll have a look at it.

To warn you I am on holiday for a week starting tomorrow morning UK time so if you don't get a prompt answer after that there is a reason:smile:

6 Aug 2009, 11:22 PM
#22
niccol avatar

niccol

Totally Zenned

Join Date:
Apr 2009
Posts:
2,138
Plugin Contributions:
1

Re: How do I add a text area on the catagory pages?

@dw08gm The other thing to bear in mind is that it is worth noting down exactly what it is that you have done - it will save you a lot of pain if you upgrade in the future, particularly as you have split up this code between pages so each individual lump will make less sense by itself!

6 Aug 2009, 11:24 PM
#23
niccol avatar

niccol

Totally Zenned

Join Date:
Apr 2009
Posts:
2,138
Plugin Contributions:
1

Re: How do I add a text area on the catagory pages?

@drunkguy the only part of the tpl_index_categories.php file that I changed should look like this(in my version)

<?php

// categories_description
    if ($current_categories_description != '') {
?>

<!--NICCOL START-->

<?php $all_the_description = $current_categories_description;  ?>

<?php
$xxx_pos = strpos($all_the_description,'###');
if($xxx_pos === false) {
	$description_top = $all_the_description;
}

else {
	$description_top = substr($all_the_description,0,$xxx_pos);
	$bottom_length = strlen($all_the_description)-$xxx_pos-3;
	$xxx_pos = $xxx_pos + 3;
	$description_bottom = substr($all_the_description,$xxx_pos,$bottom_length);
}

?>

<div id="categoryDescription" class="catDescContent"><?php echo $description_top;  ?></div>

<!--NICCOL END-->

<?php } // categories_description ?>
<!-- BOF: Display grid of available sub-categories, if any -->
<?php
  if (PRODUCT_LIST_CATEGORY_ROW_STATUS == 0) {
    // do nothing
  } else {
    // display subcategories
/**
 * require the code to display the sub-categories-grid, if any exist
 */
   require($template->get_template_dir('tpl_modules_category_row.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_category_row.php');
  }
?>
<!-- EOF: Display grid of available sub-categories -->

<?php
$show_display_category = $db->Execute(SQL_SHOW_PRODUCT_INFO_CATEGORY);

while (!$show_display_category->EOF) {
  // //  echo 'I found ' . zen_get_module_directory(FILENAME_UPCOMING_PRODUCTS);

?>

<!--NICCOL START-->

<div id="categoryDescription_bottom" class="catDescContent"><?php echo $description_bottom;  ?></div>

<!--NICCOL END-->

<?php if ($show_display_category->fields['configuration_key'] == 'SHOW_PRODUCT_INFO_CATEGORY_FEATURED_PRODUCTS') { ?>
7 Aug 2009, 5:50 AM
#24
drunkguy avatar

drunkguy

New Zenner

Join Date:
May 2009
Location:
Longmont, CO
Posts:
91
Plugin Contributions:
0

Re: How do I add a text area on the catagory pages?

Playing around in admin the multiple lower text apperance changes if I turn off featured products, new products and specials.

With them all OFF there is NO lower text displayed. Turn on any 1 of them and it works fine. So as a work around I turned on specials (I think) with no products to display.

I think if I turn on 2 center boxes the lower text will display twice, so it seems to be affected by the number of center boxes.

Other than that it works fine and gets me what I need. It maybe simple to fix, if not I can live with this I think.

Thanks a million, your a life-saver.

btw do you know anything about "Common Tags"? I have no clue.

My SEO says to add them from admin but I don't see anything about "Common Tags"

What's worse is they say place them in the footer and they are different on each catagory page. Is that nuts?

Thanks again
Drunkguy
:smile:

7 Aug 2009, 5:57 AM
#25
drunkguy avatar

drunkguy

New Zenner

Join Date:
May 2009
Location:
Longmont, CO
Posts:
91
Plugin Contributions:
0

Re: How do I add a text area on the catagory pages?

Here is the file I received (see attached).

Enjoy your Holiday!

7 Aug 2009, 7:23 AM
#26
niccol avatar

niccol

Totally Zenned

Join Date:
Apr 2009
Posts:
2,138
Plugin Contributions:
1

Re: How do I add a text area on the catagory pages?

OOOOPS

My error. I don't know how it happened (looks like I just copied a code lump into the wrong place! Muppet!) but the file I uploaded is slightly wrong which makes sense of all your comments.

<!-- EOF: Display grid of available sub-categories -->
<!--NICCOL START-->
<div id="categoryDescription_bottom" class="catDescContent"><?php echo $description_bottom;  ?></div>
<!--NICCOL END-->

Is where that block of code should be. Just under the <!-- EOF: Display grid of available sub-categories --> I'll attach a complete version of the file.

Common Tags. Well I think what is being said is that on many web pages in general the display of 'common tags,' is used. For instance in blogs this is often used. Each post has 'tags' attached to it ( like this post might have the tags zen cart, product display, online shop, that kind of thing) It started off being a way of categorisation and ended up being a way that seo gets more keywords onto the page. Also, you see pages that right at the bottom there are a whole load of links that are off the bottom of the page. I haven't seen a way of adding these straight from the admin panel but I may be wrong. (Um there's an idea for an addon) There may be an add-on that I don't know about.

Practically, the code hack that you are using from this thread will get the results that you are wanting. Which basically is some text at the bottom of the page that you can edit with all the keywords that you think are appropriate for that category. It's getting better with seo, I think to have real english rather than just lists, and it makes it a better page and more future proof because this is definitely the way search engines are going.

7 Aug 2009, 7:25 AM
#27
niccol avatar

niccol

Totally Zenned

Join Date:
Apr 2009
Posts:
2,138
Plugin Contributions:
1

Re: How do I add a text area on the catagory pages?

Oh and here is the new version of tpl_index_categories.php

7 Aug 2009, 12:48 PM
#28
drunkguy avatar

drunkguy

New Zenner

Join Date:
May 2009
Location:
Longmont, CO
Posts:
91
Plugin Contributions:
0

Re: How do I add a text area on the catagory pages?

Thanks Nick.

I'll post back here with the results of the fixed file.

Now, go get that holiday started!

9 Aug 2009, 3:39 PM
#29
dw08gm avatar

dw08gm

Totally Zenned

Join Date:
Sep 2008
Location:
DownUnder, overlooking South Pole.
Posts:
1,016
Plugin Contributions:
2

Re: How do I add a text area on the catagory pages?

Thanks Nick

Wishing you have a happy holiday.

14 Aug 2009, 3:07 AM
#30
drunkguy avatar

drunkguy

New Zenner

Join Date:
May 2009
Location:
Longmont, CO
Posts:
91
Plugin Contributions:
0

Re: How do I add a text area on the catagory pages?

The new file fixed it. Thanks
:clap:

29 Jan 2011, 6:33 PM
#31
drunkguy avatar

drunkguy

New Zenner

Join Date:
May 2009
Location:
Longmont, CO
Posts:
91
Plugin Contributions:
0

Re: How do I add a text area on the catagory pages?

Hi Nick.
Are you around?

I want to use this same split text approach using Define Pages Editor on the Main Page so I can insert Featured and/or Specials wherever I want them to display. Can I insert the code you modified into tpl_main_page.php and it will work the same as the category pages?

That little code change you whipped up works great!

Thanks
Drunkguy
:smile:

29 Jan 2011, 7:12 PM
#32
niccol avatar

niccol

Totally Zenned

Join Date:
Apr 2009
Posts:
2,138
Plugin Contributions:
1

Re: How do I add a text area on the catagory pages?

Well, obviously, Zen has center boxes for specials and featured products and if you wanted to use those then getting them to appear where you want is fairly straight forward.

If you want a space on every page that you can make 'announcements' including sales and features and stuff like that probably the best way of doing it is to use the banner manager. You can enter html code as a banner. And the banner can be moved around main_page without too much difficulty.

If you want to do it with define pages then creating a new define page is not hard.

If you want the 'announcement' to be specific to that category then possibly what we have done could be extended but I'd look at using the specials and featured box system first :-)

30 Jan 2011, 6:49 PM
#33
drunkguy avatar

drunkguy

New Zenner

Join Date:
May 2009
Location:
Longmont, CO
Posts:
91
Plugin Contributions:
0

Re: How do I add a text area on the catagory pages?

Hi Nick.

Basicly I want the ability to have the main page display as follows;
My custom html
Featured and/or Specials (if turned on)
My custom html

Rather than the usual way zen does it:
My custom html
Featured and/or Specials (if turned on)

My thought was use the same ### as the divider and place the custom html above and below the divider using the define main page editor if that's possible.