News:

Looking for documentation? Take a look on our wiki

Main Menu

customfield.php - Some line breaks

Started by Ventsi Genchev, January 26, 2019, 09:25:05 AM

Previous topic - Next topic

Ventsi Genchev

I think there are 2 lines in the customfield.php that need to be changed.
(/components/com_virtuemart/sublayouts/customfield.php)

1.
$value .= '</span><br>';
Must be:
$value .= '</span><br />';

2.
And I think <br /> should be removed to the following line:
$html .= $otag.$tmp.'</span><br />';
This adds a blank line everywhere (in the cart, in the order letter...). For example, add this product to your cart and you will see the blank line after the last parameter:
https://demo.virtuemart.net/multi-variant-11-detail

However, I have not tested all possible options, and I ask other developers to look at whether I am right.
Audio Store:
https://vsystem.bg - Bulgarian language
https://vsystem.bg/en - English

Studio 42

I think that the render is nont nice and should never use any <br> but should use <div> so it's more logical to add CSS if you need customfield title inline or as block.
<span class="product-field-type-C">
<span> Product Width 46.0</span><br>
<span> Product Length 68.5</span><br>
<span> Weave Advanced </span><br>
</span>
Should be
<div class="product-field-type-C">
<div> Product Width 46.0</div>
<div> Product Length 68.5</div>
<div> Weave Advanced </div>
</div>
But this is the case for all customfields

Ventsi Genchev

I absolutely agree with you, Patrick. But these changes do not depend on us.  :)
For now I will overwrite the file just because of the <br>.
Audio Store:
https://vsystem.bg - Bulgarian language
https://vsystem.bg/en - English

jenkinhill

My understaning is that both <br> and <br /> are acceptable in HTML5 and XHTML.  Although out of habit, when writing HTML I always use <br />
Kelvyn
Lowestoft, Suffolk, UK

Retired from forum life November 2023

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

Studio 42

The problem is not only here.
In PDF the result is not the same too.
Using div work in all case.

AH

tcpdf used by VM does not handle DIV and CSS well
Regards
A

Joomla 3.10.11
php 8.0

Milbo

Quote from: Studio 42 on January 26, 2019, 11:55:34 AM
I think that the render is nont nice and should never use any <br> but should use <div> so it's more logical to add CSS if you need customfield title inline or as block.
<span class="product-field-type-C">
<span> Product Width 46.0</span><br>
<span> Product Length 68.5</span><br>
<span> Weave Advanced </span><br>
</span>
Should be
<div class="product-field-type-C">
<div> Product Width 46.0</div>
<div> Product Length 68.5</div>
<div> Weave Advanced </div>
</div>
But this is the case for all customfields

I like that idea, how would that look like in bs4, and how would you call extra classes? to make it inline, what is the css for?
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

Studio 42

Quote from: Milbo on January 28, 2019, 22:07:10 PM
I like that idea, how would that look like in bs4, and how would you call extra classes? to make it inline, what is the css for?

To display inline you have to add with css display:inline; but why you want display the custom fields inline ?
All the customfield part should be displayed using display:block; to not break the render.
About DIV support, i dont remember me that this break PDF render, but in virtuemat perhaps because the container is span.
So using only DIVs should definitely render better