hide position when filter module not displayed

  • Posts: 26
  • Thank you received: 1
7 years 5 months ago #255419

-- HikaShop version -- : 2.6.4
-- Joomla version -- : 3.6.4
-- PHP version -- : 5.6.3

Hi there !
I didn't found somewhere in this forum where you solved this situation :

This is my index.php code :

<?php  if ($this->countModules('left')) : ?>
	<aside class="col-md-4">
		<jdoc:include type="modules" name="left" style="xhtml"/>
	</aside>
	<div class="col-md-8">
<?php else : ?>
	<div class="col-xs-12">
<?php endif;  ?>

When there are no module published in left, the whole aside stuff shouldn't display.
The problem is with hikashop filtering module I set the "Display on the product page" option to no
and i stil get
<aside class="col-md-4">
			
</aside>
<div class="col-md-8">
on my page. the module isn't displayed but I still get the container to show itself.

Thanks for your help !
Regards

Last edit: 7 years 5 months ago by nalta.

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

  • Posts: 26017
  • Thank you received: 4004
  • MODERATOR
7 years 5 months ago #255420

Hi,

Please check all your modules in the position "left".
Your template do not know that the modules have no content ; but he just know that there is published modules.
If the block is there, it means that you have a published module in that position and you have a module which return an empty content.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

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

  • Posts: 26
  • Thank you received: 1
7 years 5 months ago #255612

Hi,
Thank you for trying to help.

Thats what I'm saying I have no other module in position "left" except hikashop filtering module.
When I set I set the "Display on the product page" option to no it returns an empty content ...

Regards

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

  • Posts: 81598
  • Thank you received: 13082
  • MODERATOR
7 years 5 months ago #255614

Hi,

HikaShop cannot hide a position of the template when a module of HikaShop is empty.
All HikaShop can do is make sure that the HTML returned by the module is empty.
Then, it's up to the template to check that the HTML returned is empty so that it displays the position HTML or not.
Here is for example a thread talking about possibilities to do that by default in Joomla and with a solution at the end for templates:
groups.google.com/forum/#!topic/joomlabugsquad/8hcxWyyNpxc
Here is another solution for templates:
forum.joomla.org/viewtopic.php?t=324899

The bottom line is that we can't give you a precise solution as it has to be done in the template and thus you should contact your template provider.

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

  • Posts: 26
  • Thank you received: 1
7 years 5 months ago #255728

Okay I fixed it with :

if(JModuleHelper::renderModule(array_shift(JModuleHelper::getModules( 'left' ))) == "") :

Thanks for your help !

Regards

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

Time to create page: 0.070 seconds
Powered by Kunena Forum