Re: Multiple Descriptions
Ok, I have to try and clear a couple of things up here.
You want to change the layout by adding fields.
Would just using paragraphs, seperated with white space and a divider line not do the same thing without adding fields? Or do you want this on seperate pages?
Why so much duplication? It seems confusing to me, and I think the search engines will consider all the dupliction as keyword spamming, but hopefully someone else will pipe in about that.
Can you layout an expample in a html editor?
Re: Multiple Descriptions
You can achieve this using HTML class tags in your description, and stylesheet declarations that allow different parts to display in different locations.
First you need to allow HTML to function on the product listing page. Edit /includes/modules/your_template/product_listing.php to comment out zen_clean_html in two places around lines 98 & 100, as explained in this thread. From what you are describing, I think you would also need to do a similar thing in products_all_listing.php (not sure of the filename) to allow HTML on the all products page.
Write all of your descriptions in the product editing textbox, and tag the all text with <span class="allOnlyDesc"> text text text </span>.
Then tag the listing text with <span class="listingOnlyDesc"> text text text </span>, and the info text with <span class="infoOnlyDesc"> text text text </span>.
Now add the following to your stylesheet:
Code:
#allProductsDefault .listingOnlyDesc {
display: none;
}
#allProductsDefault .infoOnlyDesc {
display: none;
}
#indexProductList .allOnlyDesc {
display: none;
}
#indexProductList .infoOnlyDesc {
display: none;
}
#productGeneral .listingOnlyDesc {
display: none;
}
#productGeneral .allOnlyDesc {
display: none;
}
This will suppress the other sections in each area and allow only the desired text to display.
I haven't tested this exact configuration, so some names may need to be changed to function properly. The general principle is tested and proven to work.
Re: Multiple Descriptions
It is probably also necessary to set the product listing description to allow a larger number of characters than you are ever likely to use (Configuration > Product Listing), so HTML tags don't get truncated. That would be bad. I set mine to 2000.
The all products listing doesn't currently have a switch for this. There was a recent discussion about it, and Ajeh provided instructions for setting the length desired, and said a switch would be available in the next version.
Re: Multiple Descriptions
Actually, no, I've done it using the stylesheet before, It requires a lot of absolute positioning and it's a headache to edit in different browsers ::coughIEcough::
And no, it's not *duplicate* content - it's *different* content.
Basically, the problem is like so (and I'll set it out as best I can here) - I've done it this way before, and as I said, it's a total headache to do.
We want 3 *different* descriptions for each product. The products listing page would have a tiny, short description:
[image here]
Title of Product
snippet of "cute" description
Then on the product detail page:
Title here
[image here]
Specific details, such as weight of product, sizes available, color, etc.
products price
add to cart box
more descriptive and "flourishy" description here
Now, I *know* I could use CSS and HTML to lay it out something like so in the "description" area of the products:
<p class="specifics">
Specific details, such as weight of product, sizes available, color, etc.
</p>
<p class="descriptive">
more descriptive and "flourishy" description here
</p>
And then use CSS to set margins and positioning so that the classes are separated with the price and quantity in the middle of the two sections. but I don't want to do that. Like I said, I've done it before, and successfully - but it's a lot of extra work that's really not necessary. This also seems to be something my clients want *a lot* - I haven't had one yet who didn't want a setup similar to this, so using the CSS trick is just way too time-consuming. (Yes, I've also done hiding, display:none, and stuff like that for other variations on the same theme)
If I had 3 (or more/less, but this site needs 3 - the last site I did could have just used 2) different fields for descriptive text, then I could place them quite easily, as needed, without any need to use absolute positioning and fudging with margins, floats and the like. It would be *much* quicker if I had this ability to add (or not to add) extra descriptive text to the product, and just call it in as I need it.
Again, this isn't spammy. It's text that describes the product an a couple of different ways. I could do this exact thing on a static site, and it wouldn't be considered "spammy" content. It's just a method of making the content text flow a little differently, and allowing it to be broken up. That's all.
So if there's a better way than hacking to get a couple of extra description fields, that would be great to know :)
Re: Multiple Descriptions
Ok, I didn't get from your OP exactly what it was that you wanted. The two sections of description on the product info page separated by other stuff would be best done with two different fields. The capsule description on the listing page could easily be handled by the method above. And you didn't actually want the all products page at all.
Re: Multiple Descriptions
Right - I agree that the "capsule description" (on the product listing page) could be handled by the "display:none;" method - that's definitely doable. But I still need the separation on the product detail page - which (like you said ;) ) would be great if I could have the additional field.
I've actually been playing with this, and I've gotten a bit of it to work - I can get the fields to show up in the admin panel, but I'm having an issue getting the information intered into the new form fields to pass to the new database fields I made for them.
Basically, I went into my database and went into the "zen_products_description" table. I added two new fields, and set them up exactly like the original "products_description" field (products_description2 and products_description3). I've gotten the fields - like I said - to show up in the admin panel, no problem. But I'm having an issue getting any input placed in the two new form fields to pass to the database fields. I'm working on admin/functions/general.php, and trying to get this section to get coded properly to do 3 fields at once:
Code:
function zen_get_products_description($product_id, $language_id) {
global $db;
$product = $db->Execute("select products_description
from " . TABLE_PRODUCTS_DESCRIPTION . "
where products_id = '" . (int)$product_id . "'
and language_id = '" . (int)$language_id . "'");
return $product->fields['products_description'];
}
This is on a localhost server, by the way, and I'm just "playing" - so if I screw anything up majorly, it won't be a big deal ;) I'm not that great at MySQL stuff, so what I've tried is all "trial and error" - but if there's any clue how to get the 3 form fields to pass the information to the proper database fields, that would rock. I htink I could figure out the rest from there - I just need to get the info into the database.
Re: Multiple Descriptions
Just wanted to update - I did it! (Call me a nerd, but I'm so proud of myself!) I found this tutorial and used it as a base for what I was doing. So I was thinking correctly, but I was taking it a little too far. (By the way, the above code was correct - but it's what *gets* the value from the new database field - not *posts* it - my bad!)
Anyway, I'm so excited about this thing that I plan on working out the kinks and posting it on my site. I may be able to make a contribution out of it, but I don't think I'm that good. But thanks for the assistance, all :)
Re: Multiple Descriptions
Glad you made this work. If you can package it into a contribution, I'm sure a lot of people would thank you. Someone else just asked today about doing this.
For those who don't want to get into building new database tables and files, there is a way to use the CSS method above for separate description blocks on one page without the hassle of trying to use absolute positioning on dynamic elements.
Enter all the different parts you want to display, with <span id=productDescList>text text text</span><span id=productDesc1>text text text</span><span id=productDesc2>text text text</span> tags around each section.
Put the short description for listing pages in productDescList, and blocks for the info page in 1, 2, etc.
Copy the product description block in tpl_product_info_display to all the locations where you want to display a section of text, and give each block (including the original) a separate id.
PHP Code:
<!--bof Product description -->
<?php if ($products_description != '') { ?>
<div id="productDescription1" class="biggerText productGeneral"><?php echo stripslashes($products_description); ?></div>
<?php } ?>
<!--eof Product description -->
<br class="clearBoth" />
Give any desired styling to each description block.
In your stylesheet, find #productDescription and change it to #productDescription1. Below that declaration, add
#productDescription2 {your desired styling} etc.
Next, turn off all display of productDesc1 and productDesc2 etc., and #productDescList in the product info page, and turn them on again selectively.
Code:
#productGeneral #productDescList, #productDesc1, #productDesc2 { display: none }
#productDescription1 #productDesc1 { display: block; } //or inline;
#productDescription2 #productDesc2 { display: block; }
The desired parts of the description will display in their respective locations.
Disclaimer: I haven't tested this implementation yet, so if anything doesn't work as expected, ask and we'll sort it out.
Re: Multiple Descriptions
PS - Remember, you will also need to enable HTML in product listing pages (& all, featured & new pages) as mentioned in posts #3 & 4 above.