News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

Must use <br> for line break in short description

Started by chrlar, April 09, 2013, 15:45:27 PM

Previous topic - Next topic

chrlar

#15
So, I did it! :)

In administrator/components/com_virtuemart/views/product/tmpl/product_edit_description.php  (line#21)
I changed:

<fieldset>
<legend><?php echo JText::_('COM_VIRTUEMART_PRODUCT_FORM_S_DESC'?></legend>
<textarea class="inputbox" name="product_s_desc" id="product_s_desc" cols="65" rows="3" >
<?php echo $this->product->product_s_desc?></textarea>
</fieldset>


to

<fieldset>
<legend><?php echo JText::_('COM_VIRTUEMART_PRODUCT_FORM_S_DESC'?></legend>
<?php echo $this->editor->display('product_s_desc'$this->product->product_s_desc,
  
'100%;''250''75''20', array('pagebreak''readmore') ) ; ?>

</fieldset>


I did nothing to the tables in the database.

And it seems to work! :)

Although I still can't use " in the text... so I use two ' instead.
(When I look at the html source of the text, it "translates a & to &amp; but not " to &quote;.)(Did that make sense?)

:)

[attachment cleanup by admin]

chrlar

Well, it works....

But...

If I make a change in the SHORT description field --- then save ---- everything is normal.

If I make a change in the LONG description field --- then save ---- I get this pop up message...

( I click on leave page, and it saves...)

Maybe my new text field code should be different somehow?

<?php echo $this->editor->display('product_s_desc', $this->product->product_s_desc,
  '100%;', '250', '75', '20', array('pagebreak', 'readmore') ) ; ?>

I'm not sure of all "content" in the tag... like array...pagebreak...readmore... what does that mean...? Can I remove it?

:)

[attachment cleanup by admin]

jjk

Hi, I just noticed this forum thread and made a quick test on one of my local Joomla 2.5.9/VM2.0.20b installations. I have no problem adding double quotes (") in the the short description and if the short description text is long, it automaticaly wraps to the next line. I didn't test if this is a problem with the TinyMCE editor, but using the JCE Editor it works. (Note, that every editor plugin has some advantages and disadvantages).
BTW - the length of the short description can be adjusted in ...\components\com_virtuemart\views\category\tmpl\default.php, approximately line 268, which is:
<?php echo shopFunctionsF::limitStringByWord ($product->product_s_desc40'...'?>
If you adjust this file, you can make a copy of this file, give it a different name and save it in the same folder. Afterwards VM offers it automatically as a selectable option in the category browse page dropdown list. This way it doesn't become overwritten when you update VM.

Category screenshot with " in the short descripton attached below.

If it doesn't work for you, maybe your Joomla template uses a different category browse page template.

[attachment cleanup by admin]
Non-English Shops: Are your language files up to date?
http://virtuemart.net/community/translations

chrlar

Hmmm... Do you think this has to do with the hosting server...? Linux or Windows? What is better?

We are currently on a Linux server with an old php version. So we have asked to be moved to a new server with the newest php version and Linux.

And privately we have a Windows server (with updated php version) for testing...

Does this have anything to say...?

jjk

No, I don't think your problem is related to an old php version. My live shop runs on Apache/2.2.9 (Debian) PHP/5.2.6-1+lenny16 with Suhosin-Patch... and for testing I still use an old version of http://www.apachefriends.org/de/xampp.html running on my old Windows XP PC. (Concerning the choice of Linux/Windows server, I personally would expect fewer problems using a linux server)

Did you ever test your site with one of the Joomla default templates or another simple template?
Non-English Shops: Are your language files up to date?
http://virtuemart.net/community/translations

chrlar

I didn't test my site with a Joomla standard template, someone else did...
See this link: http://www.flexiblewebdesign.com/index.php?option=com_kunena&view=topic&catid=5&id=888&Itemid=234

He tested on his server and had the same problem... :-/

I asked him, too, because we use his VM template. :)

jjk

I wonder if the template providers's own category browse template was still selected in VM configuration when he tested a different template...  ;)
Non-English Shops: Are your language files up to date?
http://virtuemart.net/community/translations

chrlar

See, now I'm really confused.... :-/

I have a Windows test server...
I set Beez 5 as default template.
And only VM own standard files (no external template)

And then, in CATEGORY view, the text is fine with double quotes (") and html (<br>).

I checked out the files
\components\com_virtuemart\views\category\tmpl\default.php
and
\templates\allrounder-j1.6\html\com_virtuemart\category\flexv2list.php

and  the code for product_s_desc is exactly the same in both files:

<?php // Product Short Description
if(!empty($product->product_s_desc)) { ?>
<p class="product_s_desc">
<?php echo shopFunctionsF::limitStringByWord($product->product_s_desc, 120, '...') ?>
</p>
<?php } ?>


So for my template provider's problem, now I noticed his error came up when in product detail view, not category view... Hmmmm..

So I guess we have to overlook this little bug of ours....

We'll keep writing <br> for linebreaks and using two single quotes for double quote.

But thanks for getting involved! :)


:-)