Wiccle.com in Facebook Wiccle.com in Twitter Wiccle.com in LinkedIn Wiccle.com in Youtube RSS from Wiccle.com Wiccle.com in Atom
 
 
 

Thread: iWiccle Module Reference / Adding new modules

Started: January 26, 2010, 01:07 PM  ⋅  Zone: Public Forums  ⋅  Category: Install & Modification  ⋅  Posts: 6  ⋅  Views 1276
Started by: Markus  ⋅  Description: If you want to take your iWiccle to the next level, here are instructions for adding and customizing new modules.
Post #1
Member: Markus  ⋅  Date: January 26, 2010, 01:07 PM  ⋅ Subject: "iWiccle Module Reference / Adding new modules"

If you want to take your iWiccle to the next level, here are instructions for adding and customizing new modules. The following is a copy of the instruction sheet from the new "iWiccle Module Reference & Default Files" zip.

You can use the example files to create a new module called "MyModule" and then clone the layout of any other module into it, and extend your default module set within the limits of your imagination.

I will not be separately updating the below every time it grows for the  -- please download the latest file to get the latest additions. I will be integrating all these tutorial materials under Tutorials in final shape soon enough.

 


+-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
| iWICCLE MODULE REFERENCE & DEFAULT FILES
+-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
|  by Markus Loponen & Keith Killilea
| (c) 2009-2010 Bridge Media Ltd.
|  Revision: 2010/01/26 | Text version: 0.10
|  iWiccle version: 1.2x
+-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
| iWiccle CMS Community Builder | http://www.wiccle.com/
+-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
| This document and the attached sample PHP files file may be freely copied, modified
| and distributed for purposes of iWiccle and Wiccle customization and related tutorials.
| Where substantial amounts of text are copied, this source header must be included
| to eliminate conflicting tutorials in the future as the product evolves.
+-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-


This document provides a basic reference for creating new modules, and an explanation of the standard module file set. This document uses "mymodule" as a hypothetical module you could create. You can see the end result of creating a module with these instructions and sample files in the online demo: http://demo.iwiccle.com



GENERAL INFORMATION ON MODULES

There are two kinds of modules: dynamic and static. They are responsible for providing your site with different and distinct areas atop the genereal iWiccle framework.

STATIC: "Site" is an example of a static module; it doesn't provide any extra functionality in terms of posting content, but it gives you a new "layout container" into which you can create custom pages, just as you can do under any of the other modules. If you want to isolate different Builder-produced custom content areas on your site, and have them available as main menu tabs, you are looking for a "static" module.

To create the files for a new static module, you will only need to edit what's been noted for the module "Core" file.

DYNAMIC: "Gallery" is an example of a dynamic module; it works as a layer for customizing dynamic content, and is responsible for providing alternative content formats, language strings, and parameters for iWiccle Core on processing dynamic content.

To create a copy of new dynamic module, you will only need to edit what's been noted for the module "Core" file. If you want to start customizing the way it works, refer to the notes on the rest of the standard module files.



HOW TO PLUG IN A NEW MODULE?

Upload the module files you have prepared to /modules, /templates and /languages as indicated. Then, go to Admin CP > Modules > Configuration, and create a new module entry, choosing the folder you have prepared. Your module will now be added in, and a set of permission masks for the usergroups will created. (Note that some permission masks apply for both module types; "Read" permission means "allowed to access any pages in this module".)

Your new module will become active and work like the default modules of iWiccle. If you want to copy the layouts of one of the existing modules into your new module, please use the Admin CP > Layouts bulk exporter/importer, export the layouts from any module, and import them to your new module. (If you want, you can also customize your modules and share new module layout sets with others!)

Please refer to the included screenshots for an illustration on how the Site module (as an example) is cloned in the Admin CP after uploading the module files. You can use the example files to create a new module called "MyModule" and then clone the layout of any other module into it, and extend your default module set within the limits of your imagination. Be sure to edit the module in its own new Admin CP page under Modules after creating/importing a layout, to select a default page and to provide a description.

(Reload your settings at Admin CP > Reboot to load the new module into to your session memory if it's not showing up / is showing restricted permissions.)



STANDARD MODULE FILE SET DETAILS

There are a total of seven default files that are present for each iWiccle module. If you don't use some of the files, it is safe (although unnecessary) to remove references to class/config/mysql files from the module's core file. The language and template extensions will have to be in place to keep the system from complaining.
 

# FOLDER: MODULES

Each module's own base folder contains four standard files. How much you need to modify the files depends on what you want to do with your module. If you want to just create a copy of one of your existing modules, all you need to do is what's indicated for the "core" file.

    /modules/mymodule/mymodule_core.php
    /modules/mymodule/mymodule_class.php
    /modules/mymodule/mymodule_config.php
    /modules/mymodule/mymodule_mysql.php
    
Core: This is the file that's loaded when a module is called. Open it up and change the following line at the beginning:

    define("MODULE_IDENT", "mymodule");

You can also change the function name if you wish, but that won't affect the way your module works.

Class: This is where you can add different extensions, such as new menu-handling functions, different post- and pre-parsers for content units, and so on. Refer to existing modules for examples of common extensions that have been used.

Config: This is where you can change some of the parameters for how your module works, if it's a dynamic module. Any functionality extensions that replace standard site features also have to be declared here before they become active. (The configuration parameters will be documented separately; you can also refer to /core/variables.php for some of the possible entries you can enter into a config-file to modify the way your module works.)

MySQL: This is where you can include new MySQL methods for use in your module, if you need to.

[Grid: /mymodule_grid.php]
    There is an optional grid file present in some modules that extends the layout grid, just as /core/layout_grid_extensions.php does, but only for that module. If a grid file is used, it needs to be included from the Core module file. (Refer to "groups" module in iWiccle.)


# FOLDER: TEMPLATES

Each module has its skin entries in the /templates/skinname/modules folder. If your new module doesn't feature any new template elements (ie. it is a static module, or a copy of a dynamic module that doesn't do any overrides), these files can be blank, but they need to be there to keep the system symmetric.
    
    /templates/pro/modules/skin_mymodule.php
    /templates/pro/modules/skin_mymodule_ow.php
    
The "skin_mymodule" file is loaded whenever the module is loaded, and its skin elements are available in global scope under the $skin variable.

The "skin_mymodule_ow" ("overwrite") file is loaded whenever dynamic content is called (posts, blogs, etc.), and the default skin elements for the content type are overwritten with the entries in this file. (If you want to modify "post full size" content format for your module as an example, you would copy it from skin_posts.php, place it into the overwrite file, and modify it as necessary.


# FOLDER: LANGUAGES

Each module has its own language file that provides unique names for generic content-types (such as "parent" becomes "Blog", "Gallery", "Group" etc. and "post" becomes "Post", "Photo", "Video" etc.).

    /languages/en/lang_module_mymodule.php
    
The language strings in this file are combined with /lang_module_deriv.php that derives a set of standard strings ("latest photos", "updated groups") etc. based on the names you have given different content types. Whatever strings you define here ($lang['whatever_text'] = "foobar") are available by language tags [[WHATEVER_TEXT]] in all templates specific to this module, as well as in the custom text and custom header fields of the Builder.

Post #2
Member: Markus  ⋅  Date: January 26, 2010, 02:17 PM  ⋅ Subject: "Re: iWiccle Module Reference / Adding new modules"

A small correction:

Note that some permission masks apply for both module types; "Read" permission means "allowed to access any pages in this module".

This is an answer for those of you who want to for example have a splash page and limit the rest of your site to registered users:

Simply untick "Read" permissions from all other modules except your default module, and use the default Site (or a clone thereof, or whatever you wish) module to display everything that needs to be public-viewable.

Post #3
Member: Markus  ⋅  Date: January 26, 2010, 03:02 PM  ⋅ Subject: "Re: iWiccle Module Reference / Adding new modules"

You can now see a basic example of what you can accomplish with the attached module kit in our online demo. These are the screenshots illustrating what I did after uploading the sample files directly to the demo site. They have now been included into the Module Reference Kit.

Admin CP > Modules > Configuration:

iWiccle Module Cloning #1

The module folder you have uploaded will be available as an option, as shown above.

iWiccle Module Cloning #2

Return to editing the module details after creating or cloning the first layouts to it, so you have a default page you can choose.

This is how you clone layouts from one module to another:

iWiccle Module Cloning #3

iWiccle Module Cloning #4

iWiccle Module Cloning #5

Now you can return to edit the module description, set the default page, and 1) copy in the raw navigation data from another module, 2) type it in by hand using the syntax show below, or 3) use the Menu Builder to do it.

iWiccle Module Cloning #6

Once you have completed these steps, and reloaded your session settings to load in the new module if necessary (refer to Reboot tutorial), the end result looks as follows:

iWiccle Module Cloning #7 Final

Now, go create more modules for yourself! After all it's only ten that are bundled in by default. =)

Post #4
Member: Markus  ⋅  Date: January 26, 2010, 03:25 PM  ⋅ Subject: "Re: iWiccle Module Reference / Adding new modules"

Wiccle Web Builder 1.0 and subsequent releases will bring the above process under a simple Wizard that will let you decide how you want to clone a module, and then execute the tasks.

I'm sure you can all think of many ways how to use our default modules -- "if they just were a bit different". Well now you can get all the slightly different modules you want with a couple of clicks!

This module cloning option, along with the layout bulk export/import, are something that have risen directly from my personal dev needs, in particular the need to get pages, page sets and modules done much faster than using normal means, and are an example of the sorts of tools we are building into the framework to help you extend your iWiccle/Wiccle in practically unlimited ways.

Just so it's clear and spelled out: There is no upper limit to the amount of modules you can create. You can have 10x10=100 modules on your site if you want, and rebrand each of them slightly to make them unique. If you create modules that are substantially different from the default modules, we urge you to offer them online for download or sale (and soon enough in our Shop as well).

Post #5
Member: dexcode  ⋅  Date: July 11, 2010, 09:22 PM  ⋅ Subject: "Re: iWiccle Module Reference / Adding new modules"

Has the module Wizard described above exist yet or does it still need to be done manually?

Post #6
Member: Markus  ⋅  Date: July 11, 2010, 11:47 PM  ⋅ Subject: "Re: iWiccle Module Reference / Adding new modules"

I didn't have time to include it in the 1.0 version build, there were just too many possible options that could have been added in. This is one of the first tasks on my list of things to work on at Admin CP.  Have you tried it manually yet? It's a fairly straight-forward task once you get the hang of it, the only thing that takes a bit more time in the process of cloning is the lack of "permission mask cloning"; posting permissions need to be set manually for each usergroups for every new module.

On a general note on this and all other features that have been discussed in the past: We are currently in the process of mapping all our future feature lists into a Trac, making it much easier for everyone to keep tabs on what's coming and when to expect it. This will result in the WWB 1.1.0 major release, in works as we speak.

On iWiccle 1.21.2, I have been a bit too occupied to wrap my head around finishing up the release. Ought to be out by Wednesday, I am yet to port over and test the multilanguage fixes, as well as a few new extensions to the core that rolled out with WWB 1.0.

 

Install & Modification

Add to Favorites
Public Forums
Category  ⋅  Deploying iWiccle and Wiccle into unique solutions that match your needs.
 

Public Forums

Add to Favorites
Public Forums
Zone  ⋅ Public forum sections for support and discussions. Available for everyone.
 

Zone Categories

 
Questions? Ask us!
Back to Top