- Posts: 261
- Thank you received: 5
add joomla module to product description
10 years 10 months ago #220353
by Sjaak
add joomla module to product description was created by Sjaak
-- 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
-- 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.
10 years 10 months ago #220360
by nicolas
Replied by nicolas on topic add joomla module to product description
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
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.
10 years 10 months ago #220439
by lousyfool
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" )
Replied by lousyfool on topic add joomla module to product description
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
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.
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
Code:
{module XYZ}
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.
10 years 10 months ago #220453
by Sjaak
Replied by Sjaak on topic add joomla module to product description
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
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.
10 years 10 months ago #220468
by lousyfool
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" )
Replied by lousyfool on topic add joomla module to product description
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
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...)
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
Code:
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.
10 years 10 months ago - 10 years 10 months ago #220470
by nicolas
Replied by nicolas on topic add joomla module to product description
Hi,
Thanks for finding that out.
Change that line to:
and that should fix the problem.
Thanks for finding that out.
Change that line to:
Code:
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>';
Last edit: 10 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.
10 years 10 months ago #220619
by Sjaak
Replied by Sjaak on topic add joomla module to product description
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
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.192 seconds