COMMUNITY FORUM
[SOLVED] Module position in k2 template?
- Roman Lipatov
-
Topic Author
- Offline
- New Member
Less
More
9 years 8 months ago - 9 years 8 months ago #146621
by Roman Lipatov
[SOLVED] Module position in k2 template? was created by Roman Lipatov
Hi!
Is it possible to add module position in k2 template, for example in item.php
Thanks.
Is it possible to add module position in k2 template, for example in item.php
Thanks.
Last edit: 9 years 8 months ago by Roman Lipatov.
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
-
- Offline
- Platinum Member
Less
More
- Posts: 15920
9 years 8 months ago #146622
by Krikor Boghossian
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Replied by Krikor Boghossian on topic Module position in k2 template?
Yes, the same way you load modules outside index.php in Joomla!
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.
- Roman Lipatov
-
Topic Author
- Offline
- New Member
9 years 8 months ago #146623
by Roman Lipatov
Replied by Roman Lipatov on topic Module position in k2 template?
You talking about this method:
or about this:
?
{loadmodule module[, title[, style]]}
or about this:
<jdoc:include type="modules" name="header" style="none" />
?
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
-
- Offline
- Platinum Member
Less
More
- Posts: 15920
9 years 8 months ago #146639
by Krikor Boghossian
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Replied by Krikor Boghossian on topic Module position in k2 template?
Not really.
This is the code you should use:
This is the code you should use:
<?php foreach (JModuleHelper::getModules('MODULE_NAME') as $module) {
echo JModuleHelper::renderModule($module, array('style' => 'MODULE_STYLE'));
}?>
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.
- Roman Lipatov
-
Topic Author
- Offline
- New Member
9 years 8 months ago - 9 years 8 months ago #146643
by Roman Lipatov
Replied by Roman Lipatov on topic Module position in k2 template?
Thanks!
It works perfect.
Is this method more fast and correct than method with Nonumber Modules Anywhere?
It works perfect.
Is this method more fast and correct than method with Nonumber Modules Anywhere?
{module Title}
Last edit: 9 years 8 months ago by Roman Lipatov.
Please Log in or Create an account to join the conversation.
- Joe Campbell
-
- Offline
- Platinum Member
Less
More
- Posts: 438
9 years 8 months ago #146653
by Joe Campbell
Replied by Joe Campbell on topic Module position in k2 template?
Hi Roman,
The code Krikor provided can ONLY load a module position (outputs all modules assigned to that position).
While NoNumber Modules Anywhere can BOTH output an entire module position OR just one specific module.
Note: You can set Modules Anywhere to also handle the {loadposition} tags. In that case, you can safely disable the {loadposition} plugin all together.
Source: www.nonumber.nl/extensions/modulesanywhere
I hope this helps,
Joe Campbell
The code Krikor provided can ONLY load a module position (outputs all modules assigned to that position).
While NoNumber Modules Anywhere can BOTH output an entire module position OR just one specific module.
Note: You can set Modules Anywhere to also handle the {loadposition} tags. In that case, you can safely disable the {loadposition} plugin all together.
Source: www.nonumber.nl/extensions/modulesanywhere
I hope this helps,
Joe Campbell
Please Log in or Create an account to join the conversation.
- Tarun Das
-
- Offline
- Junior Member
Less
More
- Posts: 38
9 years 8 months ago - 9 years 8 months ago #146700
by Tarun Das
Joomla! 3.4.3, K2 v2.6.9 (Eagerly waiting for v3)
Website: Yankee Russia
Replied by Tarun Das on topic [SOLVED] Module position in k2 template?
A word about Module Anywhere.
Module Anywhere is useful if you want your module to be appear in the textarea of K2 pages. In other words in introtext area. Because you need a writable place where you can put the name and parameters { xxxx xxx } of Module Anywhere. But if you want your module to be appear outside textarea you have to create a new module position in templateDetails.xml file and write the code Krikor provided in item.php page where MODULE_NAME = the new module position you created in templateDetails.xml file and MODULE_STYLE = your css class.
I faced this problem lately and here is how I solved it.
Module Anywhere is useful if you want your module to be appear in the textarea of K2 pages. In other words in introtext area. Because you need a writable place where you can put the name and parameters { xxxx xxx } of Module Anywhere. But if you want your module to be appear outside textarea you have to create a new module position in templateDetails.xml file and write the code Krikor provided in item.php page where MODULE_NAME = the new module position you created in templateDetails.xml file and MODULE_STYLE = your css class.
I faced this problem lately and here is how I solved it.
Joomla! 3.4.3, K2 v2.6.9 (Eagerly waiting for v3)
Website: Yankee Russia
Last edit: 9 years 8 months ago by Tarun Das.
Please Log in or Create an account to join the conversation.