I've wrote a block using this guide: http://community.postnuke.com/Wiki-WritingABlock.htm
Block is written for PN 764
This block allows to build tree-like menu and is not connected with any module...
Because method described in above-mentioned guide requires a module with which block is associated temporary I've wrote this block as Admin module's block.
And my questions is: is this a good choice? Probably the better choice would be the Block module... but in pn764 its impossible (Block module have hardcoded block dir includes/blocks/). Or maybe there is another way to write a block in this way?
Will be appreciate for any suggestions.
--
Polish Zikula Team
Bianor Works - my Zikula works on CoZi
Watch
GitHub Core
Show your support for Zikula! Sign up at Github account and watch the Core project!
GitHub Modules
- mazdev responded to »Hide "Register new account" and change template to 3 col« 07:50 AM
- mesteele101 created topic »Zikula 1.3.3 - Site Search 1.5.2 - Unable to turn off plug-ins« 07:48 AM
- internetking created topic »password problem« 25. May
- mesteele101 responded to »ERR (3): E_USER_ERROR: Smarty error: [in pagesvar:pagesitem2en line XXX]…« 25. May
- mazdev responded to »Pages 2.5.0 and updating - Page not found« 25. May
- mesteele101 responded to »Zikula 1.3.3 - Selecting a category in Pages not working« 25. May
- mdee created topic »How to implement returnpage ?« 25. May
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
Block and module...
-
- Rank: Team Member
- Registered: Apr 07, 2005
- Last visit: Jan 18, 2010
- Posts: 228
-
- Rank: Team Member
- Registered: Sep 06, 2006
- Last visit: May 09, 2010
- Posts: 2446
Hi Jusuff!
You have to know that the guide is for PN 0.8, there the blocks usually belongs to a module.
If you're writing a 0.764, i recomment you to take the code of an 0.764 existing block, may be includes/blocks/mainmenu.php and modify the info, permissions and all that you need.
If you want a templated module, you must build this into one module, may be Admin, and put yours templates (admin_blocks_*.htm) in there, and again, reading the code of an existing block will, may help you a lot.
Good luck!
--
- Mateo T. -
Mis principios... son mis fines -
- Rank: Team Member
- Registered: Apr 07, 2005
- Last visit: Jan 18, 2010
- Posts: 228
Thanks for your reply.
I think the Admin module would be a good "parent" for my block :)
--
Polish Zikula Team
Bianor Works - my Zikula works on CoZi -
**unknown user**
- Rank: Senior
- Registered: Mar 16, 2002
- Last visit: Oct 21, 2009
- Posts: 2330
Best case scenario: don't upload the block file into the core! :) Every little change you make to the core files/directories is something that you must keep diligent track of when you upgrade the site. Even a seemingly simple item to remember can easily be forgotten.
If you do feel compelled to upload any blocks into the core, however, consider placing them into the ../system/Blocks/pnblocks/.. directory, where the other stand-alone blocks reside. This decision would observe 2 golden rules:
1) keep like things together, and
2) don't re-invent the wheel.
:)
Another approach, while it might seem a bit much, is to create a module for your block based on the 'blank' module, and including your block file there instead. (The block can then be installed/uninstalled and the 'module' name can be reflective of the block, even.) Doing it this way allows you to use the block, while at the same time removing the need to alter the PostNuke core.
Just a few ideas...
;)
- John
edited by: alarconcepts, Jul 15, 2007 - 11:34 AM -
- Rank: Team Member
- Registered: Apr 07, 2005
- Last visit: Jan 18, 2010
- Posts: 228
alarconcepts: thanks for suggestion.
Separated module for a block looks like best solution.
Admittedly I already wrote for pn764 block as the element of the module Admin, however in the pn8 case I would have to modify core - and definitely I wouldn't like it.
So its time to consider wise advice :)
edited by: Jusuff, Jul 29, 2007 - 02:57 PM
--
Polish Zikula Team
Bianor Works - my Zikula works on CoZi -
**unknown user**
- Rank: Senior
- Registered: Mar 16, 2002
- Last visit: Oct 21, 2009
- Posts: 2330
No problem ... it so happens that I faced the exact same question at one time and issues only became apparent at upgrade time or shortly thereafter when some of my content was missing or broken.
Glad to help.
:)
- Moderated by:
- Support
Users on-line
- 0 users
This list is based on users active over the last 60 minutes.
