add joomla module to product description

  • Posts: 261
  • Thank you received: 5
9 years 10 months ago #220353

-- HikaShop version -- : 2.5.0
-- Joomla version -- : 3.4.4
-- Error-message(debug-mod must be tuned on) -- : no error message

Hi,

I like to add a joomla module to product descriptions of some products. There's an 'insert module' button under the texteditor.
Only.... When I use that button the module is added to the product but shows 3 sometimes even 4 times scattered all over the page and not where I want it. It looks horrible.

I must be doing something wrong. Is there a tutorial on how to add a joomla module to a product description correctly?

Thanks

Sjaak

Please Log in or Create an account to join the conversation.

  • Posts: 84306
  • Thank you received: 13701
  • MODERATOR
9 years 10 months ago #220360

Hi,

You can directly add an insert module tag in the product description:
docs.joomla.org/How_do_you_put_a_module_inside_an_article%3F

Please Log in or Create an account to join the conversation.

  • Posts: 2143
  • Thank you received: 747
9 years 10 months ago #220439

Hi Sjaak,

In addition to what Nicolas was pointing at, there's another way:

You have NoNumber's "Modules Anywhere" installed on your site. Means you may as well use a simple tag like

{module XYZ}
anywhere in your site and definitely in product descriptions. "XYZ" is the module ID, which you can find out in the Joomla Module Manager.

Actually, it is already quite a bit in use on your site, so go ahead and continue using it. ;)


Need help with customisations of layouts, style or other site development? PM me!
(Don't forget to turn on "E-mail notification of new messages" )

Please Log in or Create an account to join the conversation.

  • Posts: 261
  • Thank you received: 5
9 years 10 months ago #220453

Hi Thomas (You know I strongly oppose to calling you lousyfool)

With my limited knowledge (and your help) I found out that that should be how it works. Only when I use this method I get this: www.artlantismedia.com/index.php/shop/13-joshua-tree-2
(as soon a solution is available the page will be adjusted)

Even the shopmenu at the left disappeared. So somewhere, something is going wrong and I start asking questions in this forum.

Sjaak

Please Log in or Create an account to join the conversation.

  • Posts: 2143
  • Thank you received: 747
9 years 10 months ago #220468

Hey Nicolas,

Found the culprit. Not a good idea to insert a module (or other "more sophisticated" code) into the product description while the social plugin, particularly the Pinterest button is on.

In the "System - Hikashop Social Plugin", /plugins/system/hikashopsocial/hikashopsocial.php, line 213 says

return '<span class="hikashop_social_pinterest'.$c.'"><a href="//pinterest.com/pin/create/button/?url='.urlencode($url).'&media='.urlencode($imageUrl).'&description='.htmlspecialchars(strip_tags($element->description), ENT_COMPAT,'UTF-8').'" class="pin-it-button" count-layout="'.$count.'"><img border="0" src="//assets.pinterest.com/images/PinExt.png" title="Pin It" /></a></span>';

Means the module content as part of the product description is getting inserted there, and the module code is breaking it and messing things up badly.

Solution for now: Turning off the Pinterest button in the plugin. The module is more important in the short run, so this works here and now: see the page under Sjaak's link.
But what if someone wants both, Pinterest button and a "trickier" product description? Any possible change you can see in the social plugin that would keep everyone happy at all ends? (Other than taking the product description entirely out of the href...)


Need help with customisations of layouts, style or other site development? PM me!
(Don't forget to turn on "E-mail notification of new messages" )
The following user(s) said Thank You: Sjaak

Please Log in or Create an account to join the conversation.

  • Posts: 84306
  • Thank you received: 13701
  • MODERATOR
9 years 10 months ago #220470

Hi,

Thanks for finding that out.
Change that line to:

return '<span class="hikashop_social_pinterest'.$c.'"><a href="//pinterest.com/pin/create/button/?url='.urlencode($url).'&media='.urlencode($imageUrl).'&description='.htmlspecialchars(strip_tags(preg_replace('#\{(load)?(module|position) +[a-b_0-9]+\}#i','',$element->description)), ENT_COMPAT,'UTF-8').'" class="pin-it-button" count-layout="'.$count.'"><img border="0" src="//assets.pinterest.com/images/PinExt.png" title="Pin It" /></a></span>';
and that should fix the problem.

Last edit: 9 years 10 months ago by nicolas.
The following user(s) said Thank You: Sjaak

Please Log in or Create an account to join the conversation.

  • Posts: 261
  • Thank you received: 5
9 years 10 months ago #220619

Hi,

Thanks for the help.
After some consideration and help from Thomas (deep bow) I decided to purchase Nonumbers 'Advanced Module Manager Pro'. It gives me more possibilities to add modules to products.

Sjaak

Please Log in or Create an account to join the conversation.

Time to create page: 0.068 seconds
Powered by Kunena Forum