Prestashop 1.7 - display module without hook - prestashop-1.7

Can i display module (for example - language switcher) inside template directly, without hook?
I seem to have problem with custom hook, every i add (using theme.yml of current theme) wont output anything inside template.
I know these hooks are added to database, they appear in "position" site in admin panel (only when i select "Display non-positionable hooks"), but wont output any module in frontend (i add them into template of course - like this {hook h='coolkid'}).

If your module implements the WidgetInterface then you can call the module directly without using a hook.
In the template instead of
{hook h='coolkid'}
You'd call it using
{widget name='coolkid'}
You can read more about it here.

Related

Why isn't loadposition working to load a module within a custom HTML module in Joomla 3.2?

I am developing a website with Joomla 3.2. I want to put a search box inside a custom HTML module. I have the module loading plugin enabled, a module position defined for the search box ('searchbox'), created the module instance, assigned it to the correct position, enabled it, and made sure it was assigned to all pages.
Inside my custom HTML module I inserted the following:
{loadposition searchbox}
As you can see here - http://ojospa.webez.net/ - it isn't working (look in the upper right hand corner).
Why isn't it working? I've looked over everything to make sure there were no typos and everything looks fine.
Any help would be appreciated.
Thanks!
Cynthia
You need to enable the "Prepare Content" parameter in the options of the module. Then it should work.

Joomla 3: Advanced Options for modules not working

In Module Manager, when I go to the module settings, in the second tab called "Options" there is "Advanced Options" section. Inside Advanced Options, there are some fields such as Module Tag, Header Tag and Header Class. When I update these fields, I cannot see any update in the module's html. Do I need to call these functions in the module template using code something like this $params->get('header_class')? I thought this would work without having to make changes to the template code. Just wanted to clarify.
I believe you should reference those items via $params such as $params->get('header_tag', 'h2') in the module chrome. If the module chrome does not make use of that parameter(s), then you won't see any change. You can create an override in your template /html/modules.php to use them.

Add a module to a component , but not every page of the component

i'm working on a joomla 1.5 for a university project (when it started 2.5 wasn't out :D). What i'm trying to do is to assign a module to my custom component , but not every page of it.
The 2 different pages of my component is a page that shows every product , but the other one needs an id to work. In order to assign the module just to a page i think i need to assign every page my component has to a menu item.
But my problem is that i don't know how to assign my page that shows a specific product the variable id to make it work.
The Joorthodox way, i guess, would be to control the module availability from the module manager in administator page, where you can assign it to certain pages/menu items only.
Thus summarizing, create a menu item type for that page assign it to a menu item which in turn will be your module control switch for that page.
Another approach could be a control directly to the joomla module renderer. An example can be found here: joomla-is-there-a-module-render-plugin-event
One method would be to set the module to be hidden on that page using CSS.
Go to views/view_name/tmpl/default.php and within the tags at the top, add the following code in:
$doc = JFactory::getDocument();
$doc->addStyleDeclaration(" #element_id { display: none; } ");
You will need to inspect the module using a tool such as Firebug, Chrome Dev Tools or another tool depending on which browser you're using, and change element_id to whatever suits your needs.
Hope this helps
Just use Advanced Module Manager and assign your module by URL's not just by the menu link, it works for me to hide and show a module inside the different pages of the same component

Modify component output using module......Joomla 3.0

I am a new developer in joomla.
I just want to integrate joomla component to custom module.When a user install module then output of related component must be change as per module file automatically .
I want to use filters with Jreviews_geomap_addon.So create a module to use filter icons into geomap...
Thanks
The module should have a form or link that submits or changes the URL when clicking on the links. You can then read the url parameters using:
$var_name = JFactory::getApplication()->input->get('var_name');
You can then use the $var_name to change what data is displayed by your component.

PyroCMS Custom Module Layout

I created a custom module called Drawings. I wanted to give it its own theme layout on the frontend, so I followed the advice I found HERE - I put a layout file titled Drawings.html in my theme.
This had the correct effect on the frontend, but caused other problems and questions that I've been struggling to sort out:
The backend admin section for my module now uses the Drawings.html layout, which breaks its functionality completely. How can I set a specific layout for my module front end, but keep the standard admin backend layout (same backend implementation as in the sample module tutorial)?
I read the following in the Template Library: "When using Public_Controller and Admin_Controller, the layout is already set." Perhaps the solution involves using the set_layout function in these controllers somehow? All my attempts failed so far though.
I feel I am doing something incorrectly because now my module is not modular. For example, after creating the Drawings.html layout file in the theme, a statement like {{ theme:css file="drawings.css"}} in that layout file searches for those resources in my theme. So I have to put those JS and CSS resources in my theme, instead of in my module's CSS and JS folders. How do I keep and access my resources in the module's JS and CSS folders?
I don't know how this is supposed to work.
When you are using front end controller use a layout there using philsturgeon template library like this
function index(){
$this->template->set_layout('drawing')
->build('yourview');
}
This way you can load a custom layout for your application.

Resources