- Posts: 29
- Thank you received: 1
Custom module position in lisiting_div causes "500 - Layout listing_ not found."
9 years 1 month ago #279081
by roojai
Custom module position in lisiting_div causes "500 - Layout listing_ not found." was created by roojai
-- HikaShop version -- : 3.2.0
-- Joomla version -- : 3.7.5
-- PHP version -- : 7.0.23
-- Error-message(debug-mod must be tuned on) -- : 500 - Layout listing_ not found.
This is a strange one! I want to put a filter in a custom position on a product page.
The position is below the actual product so I customised the listing_div layout and used code like this to display a module"
This works in other places in my customisations, for example I use this code to display a filter on my product category page.
But for some reason it causes an error: 500 - Layout listing_ not found.
If I unpublish the module, but leave the code in the layout over-ride then the error goes.
If I publish the same module on the same page in a proper template module position then its fine, and the module will show.
So I am asking if there is something special about the listing_div.php code which might prevent a custom module position.
Many thanks!
-- Joomla version -- : 3.7.5
-- PHP version -- : 7.0.23
-- Error-message(debug-mod must be tuned on) -- : 500 - Layout listing_ not found.
This is a strange one! I want to put a filter in a custom position on a product page.
The position is below the actual product so I customised the listing_div layout and used code like this to display a module"
Code:
<?php
jimport( 'joomla.application.module.helper' );
$modules = JModuleHelper::getModules( 'productfilter' );
foreach ($modules as $module) {
echo JModuleHelper::renderModule( $module );
}
?>
This works in other places in my customisations, for example I use this code to display a filter on my product category page.
But for some reason it causes an error: 500 - Layout listing_ not found.
If I unpublish the module, but leave the code in the layout over-ride then the error goes.
If I publish the same module on the same page in a proper template module position then its fine, and the module will show.
So I am asking if there is something special about the listing_div.php code which might prevent a custom module position.
Many thanks!
Please Log in or Create an account to join the conversation.
9 years 1 month ago #279085
by nicolas
Replied by nicolas on topic Custom module position in lisiting_div causes "500 - Layout listing_ not found."
Hi,
It's a reference issue. The rendering of the module must overwrite the $this->params array where all the display settings are stored for the view display.
Before your code, add:
$params = $this->params;
And after your code, add:
$this->params = $params;
That should save the params and circumvent the issue.
It's a reference issue. The rendering of the module must overwrite the $this->params array where all the display settings are stored for the view display.
Before your code, add:
$params = $this->params;
And after your code, add:
$this->params = $params;
That should save the params and circumvent the issue.
The following user(s) said Thank You: roojai
Please Log in or Create an account to join the conversation.
9 years 1 month ago #279118
by roojai
Replied by roojai on topic Custom module position in lisiting_div causes "500 - Layout listing_ not found."
Perfect - that worked!
Please Log in or Create an account to join the conversation.
Time to create page: 0.044 seconds