Joomla 4.2.6 VirtueMart 4.0.12 10777
Because I have to add a short text/ a customer advice, per each product, in the short description of a product I've added a module with the text that I want to add.
By the way when I add the module in this way (I am using modules anywhere but it the same with the standard module recall)
<div class="avvisopeso">{modulepos avvisopeso}</div>
the output is with "/> at the end of the module. (see attachment)
The module is perfectly clean without double "/> and it works fine if I call this module in a page.
So the problem is a conflict within Product description and the syntax of {modulepos avvisopeso}
Occasionally I have seen problems like yours, and while searching for a proper codefix have used Rereplacer, and useful plugin from Regularlabs - https://regularlabs.com/rereplacer It replaces odd characters on any page "on the fly".
Thank you for your reply jenkinhill.
I also use rereplacer from Regularlabs, but I don't know how to use this time.
If I call this module via {modulepos avvisopeso} on a normal page, it load correctly. But if I call it inside the product short description, than I can see this "/>
Look at here:
<!-- START: Modules Anywhere -->
<div class=" avvisopeso"="">Poichè si tratta di un prodotto artigianale, il peso del prodotto consegnato potrebbe essere diverso da quello indicato di circa +/- 10%.
</div>
<!-- END: Modules Anywhere -->"/>
It's quite a mess...
I can assure that the html into the module is correct (otherwise it shouldn't work properly if I load into a normal page)
It happen only if I call the module into the product short description. That's way i am afraid this could be a bug.
Hi
(I use Module anywhere too on VM)
because it works on normal page, I suggest you first to make your {modulepos avvisopeso} as a simple string custom field and add your own position in the product template.
and do you use an editor on the short description field ?
By my side I call my module with id only but hardcoded in my product category template (./category/default.php), to make it appear just below the category description.
Just like so:
<?php if(empty($this->keyword) && !empty($this->category) && !empty($this->category->category_description)) : ?>
<div class="category-desc-cont">
<?php echo $this->category->category_description; ?>
</div>
{module 138}
<?php endif; ?>
Quote from: sirius on December 27, 2022, 17:02:16 PM
Hi
(I use Module anywhere too on VM)
because it works on normal page, I suggest you first to make your {modulepos avvisopeso} as a simple string custom field and add your own position in the product template.
and do you use an editor on the short description field ?
By my side I call my module with id only but hardcoded in my product category template (./category/default.php), to make it appear just below the category description.
Just like so:
<?php if(empty($this->keyword) && !empty($this->category) && !empty($this->category->category_description)) : ?>
<div class="category-desc-cont">
<?php echo $this->category->category_description; ?>
</div>
{module 138}
<?php endif; ?>
Thank you Sirius, at the end I found a solution similar to your.
I've created a custom filed (string) with the content of the module "avvisopeso". Than I've positioned the custom filed in position "ontop" to show it just under the short description of the product.
Yes, the joomla content triggers are not used for the short description, just for the main text, imho.
But both of you have smart and interesting solutions :-) Great.
This problem can be circumvented in a very simple way - works with any variable
Quote<?php echo JHtml::_('content.prepare', $product->product_s_desc); ?>