You are viewing this forum as a guest. Login to an existing account, or create a new account, to reply to topics and to create new topics.
Pages: 1
I already have some text at the top of my category pages that can be added through the interface. I'd like to create a new table that stores additional text that can go below the products found in a category. Basically just a bunch of sentences or a few paragraphs related to the topic of the category.
I'm sure I can find the place to put the code (that calls the products to be displayed) but I don't want it to display if there are too many products for one page and there's another page. I'm guessing I would need an if statement that checks if it's the 1st page...or, just not the 2nd+ page? Anyone have an idea how to do that? Maybe it's easier to add a new column to the category table...I did it for the product table as a user defined section, but I don't know if it can be done for categories. It's also been a long time, don't remember what I did
James...
Offline
Give this a shot.
Make a new column in category table.... mine is called "descriptionalt"
In skin.php add this to where you would like it to appear
<?php if ($ns_id == 'catshow') { echo '<div id="skin_contenttext">'; $catshow = $this->globals('ecom.cat_catshow'); print $catshow['descriptionalt']; echo '</div>'; } //End of if statement. else {} //End of if statement. ?>
I actually use this at the bottom of the page so as to spread some of the text out towards the bottom for SEO purposes.
Not sure how to limit this to just the first page of a category however.
Anyone know how to do that?
Offline
Thanks man...is $ns_id your own variable or system one? I've seen $ns before but not $ns_id?
I was thinking it put it in the center column below the product pics, but I guess I can do it in the footer as well since it'll only show for category pages...will have to play with it to see what looks more natural
Offline
That is a system variable..
Go to the top link in my sig. You'll see how all the text at the bottom of the page works. It actually changes for all the pages....
The code I gave you was only a portion of the code I'm using to do that.
Yahoo loves text all over the page.... bottom area too.
Last edited by theblade24 (07-27-2008 08:15:19)
Offline
theblade24 wrote:
Give this a shot.
Not sure how to limit this to just the first page of a category however.
Anyone know how to do that?
Im assuming that if there is nothing entered in the 'descriptionalt' field then it wont print anything as it has nothing to print?
In which case you would only have a description for those categories that you choose to enter an alt description for? (i.e just the first page of a category and none of it's child categories)
Great little mod by the way
Last edited by ZipSkins (07-27-2008 08:29:35)
Offline
can you give me all of the code then?
Offline
on a side note, i'm top of page for primary keywords on google, but 2nd page on yahoo...what else would yahoo like?
Offline
<?php if ($ns_id == 'catshow') { echo '<div id="skin_contenttext">'; $catshow = $this->globals('ecom.cat_catshow'); print $catshow['descriptionalt']; echo '</div>'; } //End of if statement. elseif ($ns_id == 'prodbest') { echo '<div id="skin_contenttext">'; print $metadesc; echo '</div>'; } //End of if statement. elseif ($ns_id == 'prodnew') { echo '<div id="skin_contenttext">'; print $metadesc; echo '</div>'; } //End of if statement. elseif ($ns_id == 'prodspec') { echo '<div id="skin_contenttext">'; print $metadesc; echo '</div>'; } //End of if statement. elseif ($ns_id == 'prodall') { echo '<div id="skin_contenttext">'; print $metadesc; echo '</div>'; } //End of if statement. elseif ($ns_id == 'prodidx') { echo '<div id="skin_contenttext">'; print $metadesc; echo '</div>'; } //End of if statement. else {} //End of if statement. ?>
Offline
ok, i thought i could find out where to put the text but i can't. I can place it in the skin, but i'm trying to put it below the product thumbnails. In the 'manage catalog product display = category view, it would place the text below every single product, not after all products are displayed. If it's in the skin, it's too far down at the bottom, i want it in the center column area just below the products. couldn't find it either in the xhtml includes.
anyone know where to find this?
James...
Offline
Sorry to open an old thread, but is there a way to add a category/product reference to this hack for example If namespace is catshow and category reference = "refname"?
Or: if namespace=prodshow" and reference="product id"
Any help appreciated
Offline
Pages: 1