Hide module if nothing to show

  • Posts: 1119
  • Thank you received: 114
8 years 6 months ago #241255

Hi,

I see that hikashop has some feature for related products. If there is nothing to show, module/title will be hidden.
Is there a way I could achieve it same for recently viewed products? I need to hide title until user have looked to any product...
In my first template I used advanced module manager but it doesn't work with my new template so thinking maybe some code change or something?

Thank you

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

  • Posts: 82868
  • Thank you received: 13377
  • MODERATOR
8 years 6 months ago #241280

Hi,

A well written template should not display the module title if the module doesn't output anything.
In any case, the display of the title is done by the template in the chrome files:
docs.joomla.org/Applying_custom_module_chrome
So it's always possible to modify a chrome of the template, or add a new one to not have the title display in some specific positions of the template.
That's something to see with the template provider.

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

  • Posts: 1119
  • Thank you received: 114
8 years 5 months ago #241408

Hi,

Thanks for replay. I think its my 3d try as I am looking into this.
I have read all Joomla and forums regarding this and still couldn't do it....
I would be fine just to hide title via joomla module setting and jtext it if there is something to display but I couldn't find how to do it.
All my coding failed.
I understand this is more related to joomla/template it self but I found that my template support is aweful...Hadnt tried Joomla but I very happy with your support!
So my question would be like this. Why only hikashop "related products" module does work? Where I could look inside code which is responsible for this? I think this is something with hikashop and I guess I could insert it to my modChrome_style

Thanks

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

  • Posts: 82868
  • Thank you received: 13377
  • MODERATOR
8 years 5 months ago #241419

Hi,

The related products module is actually not displayed by your template. It's displayed directly by HikaShop. That's why it is displayed on the product page even if it is disabled in the Joomla modules manager.
And since it's displayed directly by HikaShop, we properly check as to not display the title of the module if there is no content to display.
So I don't think that looking at the code of the HikaShop will help in anyway since there is no chrome system for that in HikaShop.

It really has to be checked with the template provider or by a 3rd party developer who knows how to customize the PHP of Joomla templates.
I wouldn't be able to tell you what to do exactly since each template does it differently. It would require some analysis of how the template works and how the website is configured. That's why I could only give you a link to the chrome documentation of Joomla, which is the closest thing useful in this instance.

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

Time to create page: 0.055 seconds
Powered by Kunena Forum