- ModMaker
- Define Fields
- Administration
- Data output
- Templates
- config.php

# ModMaker - Edit templates and module installation

## Module installation

Before editing the template it is easier to install the module and create a few test data sets.

1. After downloading extract the zip file
2. Secure the empty database file /data/_MODULE_NAME_.db
3. Upload the module in /modules directory
4. Login to Webutler
5. Call the module installation /modules/_MODULE_NAME_/admin.php
6. Create test data

Then create a new page and load the module:

<?PHP require 'modules/_MODULE_NAME_/view.php'; ?>

If the template editing is complete, the database file with the test data can be simply overwritten with the empty backed up database file and the test data you are going again. The installation then has to be performed again.

## Display category tree and latest records

For the category tree or the latest records must be before the load of the view.php additional variables are set. Charging can be performed in menu/block files or directly into pages.

### Category tree:

<?PHP
$_MMBLOCK['_MODULE_NAME_catmenu'] = '1';
$_MMBLOCK['_MODULE_NAME_modpage'] = '_PAGE_NAME_';
require 'modules/_MODULE_NAME_/view.php';
?>

### Latest records:

<?PHP
$_MMBLOCK['_MODULE_NAME_newest'] = '1';
$_MMBLOCK['_MODULE_NAME_modpage'] = '_PAGE_NAME_';
require 'modules/_MODULE_NAME_/view.php';
?>

_MODULE_NAME_ must be replaced by the selected modul/directory name. In _PAGE_NAME_ the page name must be entered, which should be called. So the page into which the module is loaded.

In catsmenu.tpl a UL list of all categories will be displayed. The output of the latest records is generated newest.tpl in the template.

## Changing the templates

The templates are located in the directory /view/tpls. The download only the templates are included that are necessary according to the ModMaker settings.

main.tpl is the main template, all other templates are loaded into the main template. The expenditure of checkboxes and the multiple image upload to be looped. For the output of the individual data, there are the templates checkbox.tpl and multiimgs.tpl. Placeholder for loading of sub-templates or links consist of text to uppercase with 3 leading and final 3 diamonds (###). All links that do not want to have one in the templates can be deleted.

When was selected in the ModMaker Administration menu item "individual start post in the topic" stands for the list of topics, alternatively the template topicslist_startdata.tpl and alternatively for the starting post in the topic the template topic_startdata.tpl available. If one of the templates does not exist, the data.tpl template is used.

The templates (if available) can be loaded into one another as follows:

### Categories

catslist.tpl
cat.tpl to topics or records list »
cat.tpl to topics or records list »
cat.tpl to topics or records list »
cat.tpl to topics or records list »
filter.tpl filter mask
pager.tpl next and back links

### Topics list

subcatslist.tpl
subcat.tpl to topics list »
subcat.tpl to topics list »
filter.tpl filter mask
topicslist.tpl
topicdata.tpl loads topicslist_startdata.tpl or data.tpl
Data from the database
to topic »
topicdata.tpl loads topicslist_startdata.tpl or data.tpl
Data from the database
to topic »
topicdata.tpl loads topicslist_startdata.tpl or data.tpl
Data from the database
to topic »
pager.tpl next and back links

### Topic

subcatslist.tpl
subcat.tpl to topics list »
subcat.tpl to topics list »
filter.tpl filter mask
topic.tpl
topic_startdata.tpl or data.tpl Data from the database
to record »
data.tpl Data from the database
to record »
data.tpl Data from the database
to record »
data.tpl Data from the database
to record »
pager.tpl next and back links
Links previous and next topic

### Records list

subcatslist.tpl
subcat.tpl to records list »
subcat.tpl to records list »
filter.tpl filter mask
datalist.tpl
data.tpl Data from the database
to record »
data.tpl Data from the database
to record »
data.tpl Data from the database
to record »
data.tpl Data from the database
to record »
pager.tpl next and back links

### Record

subcatslist.tpl
subcat.tpl to topics list »
subcat.tpl to topics list »
filter.tpl filter mask
datafull.tpl Data from the database
Links previous and next record

### Visitors input

datanew.tpl or topicnew.tpl
userinput.tpl Input fields

### Options

In the Administration module you put in an option group, one option per line and the values ​​of an option separated by pipes (|). The values ​​in a row are output in options.tpl template.

Input:
Value1|Value2|Value3
Output:
$db_data['option'][0] = Value1
$db_data['option'][1] = Value2
$db_data['option'][2] = Value3

$db_data ['option'][0] and $db_data['option'][1] are examples included in the template. Other values ​​must be added. The values ​​also language defines in multilingualism and images are possible, which can be uploaded directly to the administration option.

For different/multiple option groups sets different templates and placeholders can be created. But that must be options.tpl expanded with the database ID of the option group. From options.tpl is options(_ID).tpl and variables ###LOAD_OPTIONS_TPL### will be ###LOAD_OPTIONS(_ID)_TPL###.