Hi,
I need to have a module plugin available in my theme. How do I tell my theme that I want to have plugins from my module loaded? Any tips are appreciated.
Greetings/Thanks
R
- mercromina responded to »error when i try to upgrade to the last version of dizkus module (3.1)« 08:01 PM
- craigh responded to »TagIt 3.0 for Zikula« 03:58 PM
- localrags responded to »Remove contents of nuke_sc_anticracker from Database« 11:30 AM
- jmvaughn responded to »Shoutit for zikula 1.3?« 09:31 AM
- mdee responded to »Different page content under one template (tpl file) based on URL« 07:17 AM
- espaan responded to »Categories disappear when editing ...« 08. Feb
- eledril responded to »How decrease zikula cpu usage« 08. Feb
Zikula Blog
- Anatomy of Open Source Projects on Mar 07
- Continuous Review on Mar 01
- Not Invented Here on Feb 24
- How to Contribute Your Code at Github on Jan 13
- 10 Steps to Coding-Nirvana: Tips for Successful Module Writing on Nov 12
- Submitting Bug Report Tickets That Get Results on Aug 17
- Cozi Tricks #1: Syntax Highlighting on Aug 07
Login
How do I force my theme to load module plugins
-
- Rank: Team Member
- Registered: Jan 05, 2003
- Last visit: May 28, 2010
- Posts: 766
-
- Rank: Developer
- Registered: Jun 16, 2003
- Last visit: May 29, 2010
- Posts: 1915
-
- Rank: Team Member
- Registered: Jan 05, 2003
- Last visit: May 28, 2010
- Posts: 766
-
- Rank: Developer
- Registered: Jun 16, 2003
- Last visit: May 29, 2010
- Posts: 1915
I know how to do it in 1.3, but I'm not sure its even possible in 1.2.x. maybe try putting it in MyTheme/templates/plugins/? -
- Rank: Team Member
- Registered: Jan 05, 2003
- Last visit: May 28, 2010
- Posts: 766
-
- Rank: Developer
- Registered: Jun 16, 2003
- Last visit: May 29, 2010
- Posts: 1915
In the module installer, you register a Persistent handler to make all your plugins available.
then that callable needs to add the plugin directory to the view stack.
It's pretty slick actually. -
- Rank: Team Member
- Registered: Jan 05, 2003
- Last visit: May 28, 2010
- Posts: 766
I just looked at the pnRender class and found the function _add_plugins_dir() ... I haven't tried it yet, but I'm guessing this can be used to force the loading of module plugins ...
Greetings
R -
- Rank: Software Foundation
- Registered: Jul 21, 2001
- Last visit: May 31, 2010
- Posts: 604
Robert,
You should not need to do that. AFAIK themes automatically register the theme/Name/templates/plugins folder.
Drak
--
Zikula Lead Developer
Board Member of the Zikula Foundation
Follow me on twitter.com/zikuladrak -
- Rank: Team Member
- Registered: Jan 05, 2003
- Last visit: May 28, 2010
- Posts: 766
OK, but that means that I need to copy my module plugin to theme/Name/templates/plugins ... I somehow don't like having multiple pieces of code floating around my code tree ... OTOH, if it works and that's the way to do it, I'll gladly take it as a solution ...
Greetings/Thanks
R -
- Rank: Software Foundation
- Registered: Jul 21, 2001
- Last visit: May 31, 2010
- Posts: 604
Sure, but since you are using Zikula 1.2.x, this is your only option.
From 1.3.0 you can do as Craig says. You can register a persistent event handler (intercepting theme.init or view.init depending on what you want to do) which can then register the plugin. From 1.3.0 calling Smarty methods directly is not allowed, you must use the methods provided in the Zikula_View class.
Regards,
Drak
--
Zikula Lead Developer
Board Member of the Zikula Foundation
Follow me on twitter.com/zikuladrak -
- Rank: Team Member
- Registered: Sep 06, 2006
- Last visit: May 09, 2010
- Posts: 2411
I remember a config feature available for modules,
that I see is available for themes too on the 1.2.4 code (pnTheme.class.php):
Use a text file indicating which module plugin paths needs to be added:
/templates/config/usemodules.txt
Each line should be a module name, for instance:
If you rely on plugins of those modules.Code
News
scribite
If it doesn't work, remove the TXT extension.
I remember I've added it because windows doesn't allow files without extension, but it was like that for previous versions.
Try it.
--
- Mateo T. -
Mis principios... son mis fines -
- Rank: Software Foundation
- Registered: Jul 21, 2001
- Last visit: May 31, 2010
- Posts: 604
Ah yes, I remember this now - but word of warning. That is for Zikula 1.2.x or less. From Zikula 1.3.0 you should use the persistent handlers because usemodules.txt is deprecated and will not work when legacy mode is disable (and will be removed entirely from 1.4.0).
Regards,
Drak
--
Zikula Lead Developer
Board Member of the Zikula Foundation
Follow me on twitter.com/zikuladrak
- Moderated by:
- Support
Users on-line
- 0 users
This list is based on users active over the last 60 minutes.
