News:

Looking for documentation? Take a look on our wiki

Main Menu

[SOLVED] Category view - Change formatting on short description

Started by Ihateit, September 21, 2012, 12:03:51 PM

Previous topic - Next topic

Ihateit

Hey Forum,

the short description in the category view is having its formatting removed, except <strong>. The description in the category view right looks like this
"This is paragraph 1. This is
Paragraph 2. This is parahraph
3. This is paragraph 4."

And i would like it to look like this:
"This is paragraph 1.
This is paragraph 2.
This is paragraph 3.
This is paragraph 4."

I've tried adding <br /> in the backend in the short description, but its like its being removed when its being shown in the category view (it is being shown in the Product Details view though. So Product Details is being shown the right way). It is still adding <strong> as it should, but removing <br /> as it shouldnt. Any help would be appreciated :-)

I would guess that it is this line i have to edit, but i dont know:
<?php echo shopFunctionsF::limitStringByWord($product->product_s_desc200'...'?>

Any help is appreciated.

Yours sincerely
Anders Jytzler

Ihateit

I really need help with this issue. Are there no one with any solutions at all??

bytelord

Hello,

I think short description cannot parse html, but if you try to parse html (or limit description) and use limitStringByWord may be causes html "breaks" on the site. Short description is just text with no styling.

Someone else has any ideas about that?

Regards
Production: Joomla 2.5.8 | VM 2.0.14 | PHP 5.3.13
Testing     : Joomla 2.5.8 | VM 2.0.16 | PHP 5.3.8
Testing     : Joomla 2.5.8 |    VM 2.1   | PHP 5.3.8

- Don't Forget to mark thread as solved when it is solved!
- Please do not PM with support questions, use the forum!

bytelord

#3
Hello,

Sorry for that, i was speaking for limitStringByWord and forgot to give you an answer on your question.
You could use simple html tags inside short description, in your example you could use the p tag (paragraph).

From the backend edit the short description of your product and made it like:

<p>This is paragraph 1.</p>
<p>This is paragraph 2.</p>
<p>This is paragraph 3.</p>
<p>This is paragraph 4."</p>

or use ui for bullets.

btw, using limitStringByWord will limit to 200chars by default, so you should be careful not to produce html breaks ... to understand what i am saying take a look on your example if you use limitStringByWord with 10 chars:
the html output on the FE will be "<p>This is"  ... so, there is no a </p> to close the paragraph, that could break the layout on the FE.


Hope helps you out

Regards

Production: Joomla 2.5.8 | VM 2.0.14 | PHP 5.3.13
Testing     : Joomla 2.5.8 | VM 2.0.16 | PHP 5.3.8
Testing     : Joomla 2.5.8 |    VM 2.1   | PHP 5.3.8

- Don't Forget to mark thread as solved when it is solved!
- Please do not PM with support questions, use the forum!

Ihateit

Quote from: bytelord on September 24, 2012, 15:45:29 PM
Hello,

Sorry for that, i was speaking for limitStringByWord and forgot to give you an answer on your question.
You could use simple html tags inside short description, in your example you could use the p tag (paragraph).

From the backend edit the short description of your product and made it like:

<p>This is paragraph 1.</p>
<p>This is paragraph 2.</p>
<p>This is paragraph 3.</p>
<p>This is paragraph 4."</p>

or use ui for bullets.

btw, using limitStringByWord will limit to 200chars by default, so you should be careful not to produce html breaks ... to understand what i am saying take a look on your example if you use limitStringByWord with 10 chars:
the html output on the FE will be "<p>This is"  ... so, there is no a </p> to close the paragraph, that could break the layout on the FE.


Hope helps you out

Regards

You are just awesome. But i now realize that i actually am able to add <br/> and it breaks the row. But my friend consistently said i didnt work, so i had to come here to ask.

Regarding the ending of <p> and eg. <strong> (as we use in our case). I have just added a </strong> in the php file, so it will allways end the tag even though it isnt present.

Thank you so much for your help. Have a nice day :-)

//Anders J.

bytelord

Hello,

Nice you solved. Yes if you implemented inside your template override will always run, but add both <strong> and </strong>.

Regards
Production: Joomla 2.5.8 | VM 2.0.14 | PHP 5.3.13
Testing     : Joomla 2.5.8 | VM 2.0.16 | PHP 5.3.8
Testing     : Joomla 2.5.8 |    VM 2.1   | PHP 5.3.8

- Don't Forget to mark thread as solved when it is solved!
- Please do not PM with support questions, use the forum!