1. Edit/Create Custom Module | |
This section allows the creation of a new custom module. Image missing - old was: {img src="img/wiki_up/admin_modules_07.png" align="center"} You need to indicate the name (used in the select box to assign the module), the title and the data that will be displayed, the data must be HTML (any since you are admin). The right part of this panel can be used to help you include some objects that can be used in user modules, you can include in an user module: Use 'Create New User Module' to create custom modules Image missing - old was: {img src=http://doc.tiki.org/img/wiki_up/admin_modules_07.png align="center"} Once a user module is created, it can be selected and assigned from the Module Name list, just like the standard modules available to the site.
Tip for multilingualism, you can use the following syntax in your custom module to display a different menu depending of the current language
Copy to clipboard
Inside the module, you can also display a menu depending on the user's group using the same syntax with the $group variable (which seems empty for Anonymous)
Tip You can control the visibility of your module by category by setting optional parameters when assigning it in the "Parameters" text area
Copy to clipboard
or
Copy to clipboard
or even like this (tested in Tiki27)
Copy to clipboard
|
2. Including content from feature XYZ in Custom Modules | |
|
2.1. A poll | |
(it will display the form to vote for the indicated poll) +Copy to clipboard
|
2.2. Any poll from the active polls | |
Copy to clipboard
|
2.3. A random image from any gallery | |
Image Galleries are deprecated! Use File Galleries instead!
Copy to clipboard
|
2.4. A random image from a single gallery | |
Image Galleries are deprecated! Use File Galleries instead!
Copy to clipboard
|
2.5. The current value of a dynamic content block | |
Copy to clipboard
|
2.6. A random value from a dynamic content block | |
Copy to clipboard
|
2.7. An RSS feed | |
Copy to clipboard
|
2.8. A banner | |
Copy to clipboard
|
2.9. A menu | |
just a normal menu Copy to clipboard
Copy to clipboard
A normal menu with an automatic opening of the sections the current url is in and the sub-section of this url. The other sections will be closed automatically. There is no consideration of the cookies normal menu with a custom class id Copy to clipboard
vertical Copy to clipboard
Copy to clipboard
vertical Copy to clipboard
Copy to clipboard
|
2.10. A structure "menu from table of contents of structure of pages" | |
Copy to clipboard
Note that there is a last checkbox to allow parsing the content of the menu, so that, wiki markup can be recognized and converted to html when showing the module in the browser (HomePage will be a clickable link then, in the previous example). new way: Copy to clipboard
|
2.11. The current date | |
The following syntax can be used to display the current server date on a module: Copy to clipboard
|
2.12. Dynamic Content | |
You can include dynamic blocks in a user module using a simple syntax: Copy to clipboard
|
2.13. Banners | |
If you want you can include a banner in a user module, using the following syntax: Copy to clipboard
|
2.14. Polls | |
You can display the form to vote a poll in a user module using the syntax Copy to clipboard
Copy to clipboard
|
2.15. A random image | |
Image Galleries are deprecated! Use File Galleries instead!
You can use the following function to display one random image from an image gallery: Copy to clipboard
|
2.16. RSS feeds | |
You can display the content of an RSS feed from another site in a user module after you created the feed (see using external RSS feeds later on this section), the syntax is: Copy to clipboard
|
3. Develop your own Custom Module | |
A module is made up of one or two files:
|
4. Little Tutorial in 3 Steps from a forum post | |
(Torsten once more answered comprehensive instead of updating the docs and linking, so he copy-pasted it here 😉 ) |
Question was | |
I want to create a custom footer very very much like the one at the bottom of this page, formatted the same way etc. I don't seem to be able to see a footer module. Can anyone shed any light on this? Thanks |
Answer | |
Torsten Fabricius wrote:
Hello HadleysHope,
Please note: For step three below, I assume you have a Tiki 14 or 15 or trunk. For Tiki 12 it would be slightly different, as Tiki 12 not yet knows about the Bootstrap magic. I assume, that you are not familiar with custom modules, so a few pointers: 1) What is a module The Tiki integrated "legacy modules" (not an official name!), so the modules that are integrated from installation (in the Tiki code base) are literally simply containers with predefined content based on templates. Templates contain HTML and smarty code and optionally can contain WikiSyntax aswell. Custom modules are empty containers where you can write arbitrary HTML, smarty and WikiSyntax and then apply them to the module zones in the exact same way as you would do with the legacy modues.
2) Steps for a simple custom module in the footer like on this page/site First you create a custom module in /tiki_adminmodules.php in the Tab "Custom Modules" and name it this way: Name: test_footermenu
I always name them in lower case to distinguish them in the list from the legacy modules - but you are free to name and label (title) them differently and with upper case aswell. The content of a module must not be empty, so we add some temporary code and to make it visible when applied: Copy to clipboard
Second you go to the Tab "Assigned Modues" and click on the button "Add Module". You will find the newly created module in the drop down list which is offered to you to choose one.
Now you need to provide the necessary parameters in the parameters textbox. Let's assume you want to not show the box and backgound and headng etc. of the module but only the plain content of the module, so we need nobox=y and we want to display the module only on the HomePage so we need page=HomePage The syntax for the parameters and values would be following: Copy to clipboard
And voilà, when you open the HomePage in another Browser Tab, you will see a red 300px high rectangle in the footer with the text: Hello, I am your new custom module.
Three now: Go back to the Tab "Custom Modules" and choose to edit your new custom module (you can keep it assigned, as the content will update. For testing on a production site you should create a wiki page "Test" and limit visibility to it (see above) with the parameter page=Test instead of page=HomePage. You want 4 menus (created before, assuming they have the Id Numbers 44, 45, 46 and 73) besides each other and they shall flip below each other on a narrow screen. We do that with Bootstrap classes in the divs and we avoid inline styling!
Bootstrap class col-md-3:
Copy to clipboard
In case the menus would not be in the same line (stepped display) you can try the following (usually necessary with the similar setup with {DIV()}...{DIV} plugins on wiki pages, I do not off-hand know if ths is necessary with plain HTML in custom modules aswell (no time to test myself): Copy to clipboard
Alias
|