ACMS v2 Documentation

Install

  1. Unpack the acms.zip archive and upload the content of the acms_v2 folder to your web server
  2. Create the acms database (use phpmyadmin or whatever database management client you have available)
  3. Import the acms.sql.gz file to your new database. This will create blank tables. If you want sample data installed, use the acms-sample-data.sql.gz file instead
  4. Open /application/config/database.php file and enter the database name, username and password you have chosen when setting up the database
  5. Open /application/config/config.php file and set the right base_url and base_email. Make sure you have the trailing slash included
  6. Login:

Administration panel: www.yourdomain.com/admin
Username: admin@acms.com
Password: 12345678
For security reasons, change the login creditentials after first login.

Configure

Configuration is done in the configuration file located at /application/config/config.php

Base URL & base email

Base URL is used through the system for creating permalinks and correct paths. Base URL has to be set to your web domain address (e.g. http://yourdomain.com/). If you have a local setup, your base URL may look like http://localhost/acms/ (or whatever your local path is). Make sure you have the trailing slash.

Base email is used as the main email address for contact form. Email address can be overridden if you need a form which sends the results to another email address.

Admin URL

Default administration URL is set to /admin (e.g. yourdomain.com/admin).

To customize the admin URL, open the /application/config/constants.php file and change the ADMIN_URL constant from admin to your needs.

Languages

You can have unlimited number of site languages. Different language is accessed by adding a language abbreviation after the domain name. E.g. yourdomain.com/de, yourdomain.com/es, etc.

Default language abbreviation is ignored. So if default language is set to english (en), en abbreviation is not needed after the domain name.

To set up supported languages, open the main config file mentioned above and update the following items:

$config['language_abbr'] = '' - define default language abbreviation. Abbreviation set here will be ignored in the URL.

$config['lang_uri_abbr'] = array() - this is the array of available site languages. If you have only one supported language, set the array value to default language. First parameter is a language abbreviation and the second parameter is the language folder. Keep all language folders set to english no matter what language abbreviation you have.

$config['lang_uri_abbr'] = array(
	'en' => 'english',
	'de' => 'english',
	'es' => 'english',
);

WYSIWYG Editor

Default WYSIWYG Editor is CKEditor and file manager is KCFinder.

You are able to create custom Editor body style and also add custom styles to choose from the Style drop down menu.

Editor body css style

Default location for the Editor body css file is /css/editor.css.
You can change the path by updating the $config['contents_css'] config item.

Custom css styles

Custom styles can be defined in the ckeditor javascript file. Default location of the file is /js/ckeditor-styles.js. More about custom CKEditor styles can be found here: http://docs.ckeditor.com/#!/guide/dev_howtos_styles
You can change the path by updating the $config['styles_set'] config item.

Editor language

All available languages can be found in /admin_assets/ckeditor/lang/.
Default editor language can be set in $config['wysiwyg_lang'] config item.

Caching

ACMS provides a way to cache all content to speed up your site and to reduce the server load. Performance boost depends mostly on how much traffic you have. If you have only a few pages and not that much traffic, you will probably not benefit a lot from the caching feature.

To enable the caching feature set the $config['cache_enable'] to TRUE.

There are few other caching options available:

  • $config['cache_auto_clear'] = TRUE; - if set to TRUE, system will automatically clear the cache once you create or update a page, post or any other content.
  • $config['cache_expires'] = 120; - time in minutes you wish the viewed content to remain cached.
  • $config['cache_path'] = ''; - default system path is /application/cache/. Make sure it is writable if using the caching feature

You can also manually clear the cache by clicking on the Clear Cache link in the administration panel (available only if caching feature is enabled).

Blocks

Blocks are small content blocks or sections which can be easily updated by site admin. These blocks can be integrated anywhere on the site (in a template). Blocks are very usefull if your site has multilanguage support. You can have the same block for each language but with different, language specific content.

Block admin fields

  • Title - only internaly used. You can add a description of the block so you or another user can easily identify what that block does on the page
  • Identifier - it is used internaly as an ID of the block for a template integration. Available only to Super Admin and it has to be unique for each block within the same language.
  • Content - Content which will be shown on the page.
  • Toggle visual editor - you can enable or disable the visual WYSIWYG editor. If disabled, pure textarea will be used.

Block template integration

Once you create a new block, you can it in a template. You can place the block anywhere, in any template.

To integrate the block, use the following helper:

<?php echo @block('<identifier>', true); ?>

First parameter is the block identifier that you have chosen when creating a block.
Second parameter can be set to TRUE or FALSE. If set to TRUE, the same block content will be used for all languages. Default value is FALSE and can be omitted.

Pages

Pages module configuration can be done in Pages config file: /application/modules/pages/config/config.php

Setting up homepage

Simply create a new page and set the URL to slash /. This will indicate the page as a root page/homepage.
The same procedure can be applied for every other language (if any).

Templates

Master template is located in /application/views/ folder. All other templates are loaded into this template.

Available Master template tags:

  • <?php echo @$page_title; ?> - Page main title
  • <?php echo @$meta_keywords; ?>
  • <?php echo @$meta_description; ?>
  • <?php echo @$content; ?> - used as placeholder for loading modules content/templates
  • <?php echo @$class; ?> - provides page and template specific class

Custom Page Templates

Once defined, list of custom templates will be available in the page Templates menu. Example of configuring custom page templates:

$config['templates'] = array(
	 'default' => 'Default Template',
	 'onecolumn' => 'One Column Template',
	 'homepage' => 'Homepage Template',
	 'contact' => 'Contact Template',
);

Page Template Tags

  • <?php echo $title; ?> - Page title
  • <?php echo $content; ?> - Page content

Pages Content field

Available options:

  • full - full WYSIWYG editor
  • simple - simple WYSIWYG editor
  • none - WYSIWYG disabled. Texarea field enabled
  • false - content field disabled

Example:

$config['pages_content'] = 'full';

Pages SEO fields

SEO fields can be enabled TRUE or disabled FALSE.

$config['pages_seo'] = TRUE;

Pages Custom Fields

Custom fields can be used to create page specific content. E.g. different background image for each CMS page.
Custom fields can have few different configuration options:

  • title - for internal use only. This will be the title of the field
  • field_type - can be set to checkbox, text, textarea, wysiwyg, simple_wysiwyg
  • limit_id - not required. Used if you want to limit the field to specific page

Configuration example:

$config['pages_custom_fields'] = array(
	'extra' => array(
		'title' => 'Background Image',
		'field_type' => 'simple_wysiwyg',
	 ),
	'special_page' => array(
		'title' => 'Special page',
		'field_type' => 'checkbox',
		'limit_id' => array(20,21),
	 ),
);

Custom fields template integration:

<?php echo @custom_block('<field identifier>', $id); ?>

First parameter: field identifier.
Second parameter: page ID.

Publish

Publish module configuration can be done in Publish config file: /application/modules/publish/config/config.php

Category Configuration Options

  • $config['publish_category_image'] - category Image field
  • $config['publish_category_content'] - category Content field. Available options are full, simple, none, false
  • $config['publish_category_publish_date'] - publish date field
  • $config['publish_category_seo'] - SEO fields

Subcategories

Subcategories can be created by using the category Position field.

  • When creating a root (level 1) category, Position needs to be set to 01, 02, 03, etc.
  • When creating a subcategory, use the period character to create different category level. E.g. 01.01 - level 2 category, 02.01.01 - level 3 category

Posts per page

$config['publish_per_page'] - default number of posts per page

$config['publish_<template name>_per_page'] - number of posts per page for custom created template

If custom per page limit is not defined, default one will be used.

Posts Configuration Options

  • $config['publish_author'] - author field
  • $config['publish_admin_author_column'] - show author column
  • $config['publish_excerpt'] - excerpt field
  • $config['publish_content'] - main content field
  • $config['publish_date'] - publish date field
  • $config['publish_admin_images_column'] - show image column (depends on publish_images)
  • $config['publish_images'] - use publish images
  • $config['publish_image_fields'] - number of image upload fields (max. 10 fields)
  • $config['publish_image_max_images'] - number of allowed images per post
  • $config['publish_orderby'] - order posts by. Default value is date
  • $config['publish_order_direction'] - order direction. Available values are desc, asc, random
  • $config['publish_rss_per_page'] - rss items per page
  • $config['publish_featured_post'] - use featured posts option
  • $config['publish_seo'] - SEO fields

Posts and Category Templates

Posts templates are located in /application/views/publish/ folder. Each category has few available templates:

  • index - posts list template
  • detail - post details template
  • pagination - pagination template
  • rss - rss template

You can create different templates for each category. For example Gallery category can have a different look than Blog category. Once defined, template select menu will be available for each category. If category template does not exist, default template will be used.

Category templates configuration:

$config['publish_templates'] = array(
	"blog" => "Blog template",
	"gallery" => "Gallery template",
);					

First parameter: name of the template folder (within publish views folder).
Second parameter: Name of the template in category select menu. You can choose any name you like.

Once category templates are configured, create a new folder within the publish views folder and give it the same name as you have defined in the config file (see above example). Afterwards you can copy&paste desired default publish template and adapt the look and feel to your needs.

Posts Template Tags

The same template tags are available for Index (Archive) and Details template. In Index template, tags must be used within a foreach loop.

Category Template Tags (only for Publish Index template)

  • title
  • content
  • image
  • image_title
  • image_alt
  • subcategories
  • total_rows

Example:

<h1><?php echo $title;?></h1>
<?php echo $content;?>
<img src="<?php echo $image;?>" alt="<?php echo $image_alt;?>" title="<?php echo $image_title;?>" />

Subcategories example:

<?php if($subcategories): ?>
	<?php foreach($subcategories as $subcategory): ?>
		<a href="<?php echo $subcategory->permalink; ?>"><?php echo $subcategory->title; ?></a>
	<?php endforeach; ?>
<?php endif; ?>

Post Template Tags (each post - loop)

  • id
  • title
  • slug
  • permalink
  • date
  • modified
  • excerpt
  • content
  • author_name
  • main_image
    • name - image file name
    • alt - image alt description
    • title - image title
  • images - array of all available post images
    • name - image file name
    • alt - image alt description
    • title - image title
  • category
    • id
    • slug
    • title
    • permalink

Post Loop Example:

<?php if($query): ?>
	<?php foreach ($query as $row): ?>
		<?php echo $row->title; ?>
		<?php echo $row->excerpt; ?>
		<?php echo $row->main_image->name; ?>
		<?php echo $row->category->title; ?>
	<?php endforeach; ?>
<?php else: ?>
	<p>There are no posts at this time</p>
<?php endif; ?>

Post Details Example:

<h1><?php echo $title;?></h1>
<?php echo $excerpt; ?>
<?php echo $content;?>
<?php echo $main_image->name; ?>
<?php echo $category->title; ?>
<?php foreach ($images as $image): ?>
	<?php echo $image->name; ?>
<?php endforeach; ?>

Post Custom Fields

Custom fields can be used to create post specific content. E.g. different background image for each post.
Custom fields configuration options:

  • title - for internal use only. This will be the title of the field
  • field_type - can be set to checkbox, text, textarea, wysiwyg, simple_wysiwyg

Configuration example:

$config['publish_custom_fields'] = array(
	"foo" => array(
		"title" => "Field description",
		"field_type" => "text",
	),
	"foo2" => array(
		"title" => "Field description",
		"field_type" => "checkbox",
	),
);						

Custom field template integration:

<?php echo @custom_block('<field identifier>', $id); ?>

First parameter: field identifier.
Second parameter: post ID.

To get specific types of posts from the database, get_posts() function can be used.

Available properties:

  • category - category ID or slug/URL can be provided
  • per_page - number of posts. Default value is 5
  • offset - post offset
  • orderby - id, date, title
  • order_direction - asc, desc, random
  • featured - filter only featured posts
  • post_id - filter only specific post
  • published_only - if set to false, unpublished posts will be included. true by default
  • children - include posts from child categories. true by default

Example usage:

<?php $posts = get_posts(array('category' => 'sample-category', 'featured' => true, 'per_page' => 2)); ?>
<?php if($posts): ?>
	<?php foreach ($posts as $post): ?>
		<?php echo $post->title; ?>
		<?php echo $post->excerpt; ?>
		<?php echo $post->main_image->name; ?>
		<?php echo $post->category->title; ?>
	<?php endforeach; ?>
<?php else: ?>
	<p>There are no posts at this time</p>
<?php endif; ?>

Category Menu

Available properties:

  • start_position - category start position. If you enter 02, category tree will begin from the item on position 03
  • list_attr - provided value will be appended to the root ul element
  • exclude - it will exclude defined categories. Expected value is category slug/URL. Use array to exclude multiple categories
  • item_class - provided class name will be appended to the li element in the following format: li class="foo foo<item id>".
  • item_id - provided ID will be appended to the li element in the same format as item_class property
  • before_item - prepends provided value before the item title
  • after_item - appends provided value to the item title
  • show_empty (default: true) - if set to false, category items with no posts will not be shown
  • active_class (default: selected) - active class is appended if current category is the same as the menu item. Default value is selected
  • lang - language abbreviation can be provided as a value. By default current active language is provided
  • %POST_COUNT% - can be used within before_item or after_item attributes. It will show total number of posts in each category

Example usage:

<?php 
echo category_tree(array(
	'start_position' => '02',
	'list_attr' => 'class="sidebar-menu"',
	'exclude' => array('sample-category'),
	'before_item' => '<span>',
	'after_item' => '(%POST_COUNT%)</span>',
	'show_empty' => TRUE,
	'active_class' => 'active',
	'item_class' => 'foo',
	'item_id' => 'foo'
));
?>						

Pagination

Template location: /application/views/publish/pagination.php

All available parameters can be found in the official CodeIgniter documentation.

Different template pagination

You can have different configuration for each template group.

  • Copy the default pagination template into new template group folder and configure based on your needs
  • Load the new pagination template <?php $this->load->view('publish/<template folder>/pagination'); ?>

RSS Feed

To get the RSS feed of the category, append the /rss at the end of the URL. Example:

http://yourdomain/articles/rss
http://yourdomain/articles/blog/rss

RSS Feed Template

Template location: /application/views/publish/rss.php

Template Tags:

  • title
  • language
  • content
  • link

Within Feed posts loop you can access all post variables/template tags.

Contact Form

Contact form contains following input fields:

  • Name
  • email
  • Subject
  • Message

Templates

Contact form templates are located in /application/views/forms/ folder.

  • contact_form.php - contains form html source
  • contact_success.php - template loaded when the form is successfully submitted

Form embedding

Use the following helper to embed the contact form into any other template:

<?php echo contact_form(); ?>	

Helper parameters

  • mailto - email address where form results will be submitted. If not defined, default email address will be used (config base_email)
  • form_template - template that contains the form source. Default value is forms/contact_form
  • success_template - template that contains the form success source. Default value is forms/contact_success

Example usage:

<?php 
echo contact_form(array(
	'mailto' => 'email address',
	'form_template' => 'forms/contact_form',
	'success_template' => 'forms/contact_success'
)); 
?>		

Spam protection

Simple and effective JavaScript (jQuery) solution is used as a Spam filter.

  1. Make sure you have a hidden "secure_code" field within the form html tag: <input type="text" name="secure_code" value="" />
  2. Add the following jQuery code: $("input[name='secure_code']").val('siteform').hide(); You can also use vanilla JS solution as long as the same functionality is preserved.

How it works

JavaScript will dynamically populate the secure_code input field with the "siteform" value. Once the form is submitted, form processor will check if "siteform" value is set. If it is not, form will not be submitted.
Since Spam robot can not handle JavaScript, secure_code field will be automatically populated (JavaScript value is overridden) with a another value which will not pass the validation.

Users

User groups permissions

Super Admin Admin Editor User
Dashboard
View Blocks
Create Blocks
Edit Blocks
Delete Blocks
View Menus
Create Menus
Edit Menus
Delete Menus
Edit Menu Items
View Pages
Create Pages
Edit Pages
Delete Pages
View Categories
Create Category
Edit Category
Delete Category
View Posts
Create Post
Edit Post
Delete Post
View Users
Create User
Edit User
Delete User
Edit Profile
Settings

Template Helpers

base_url()

Returns absolute site URL

Usage example:

<?php echo base_url(); ?>

media_path()

Returns the file path based on configured parameters.

  • base_url - default is set to TRUE. Returns absolute site URL
  • uploads_folder - returns default uploads folder path
  • file

Usage example:

<?php echo media_path(array('folder' => $folder_name, 'file' => $file_name)); ?>

image()

Image helper is used for dynamically resizing and cropping images. Helper will check if resized image already exists. If not, it will be created and stored on the server.
Helper will return new image path and has to be placed inside image src tag.

Usage example:

<img src="<?php echo @image(array('file' => $main_image->name, 'width' => 660, 'height' => 280)); ?>" alt="" />	

Available parameters

  • file - image file name
  • width - image width
  • height - image height

If both width and height are defined, Image will be cropped to exact dimensions. Otherwise, image will be proportionally resized.

Simply returns the homepage URL for the currently active language.

Usage example:

<?php echo homepage_link(); ?>

is_homepage()

Function will return true if current page is homepage

Usage example:

<?php if( is_homepage() ): ?>
	Homepage
<?php endif; ?>

is_lang()

Function will return true if the current language is the same as the one provided in the parameter.

Usage example:

<?php if( is_lang('en') ): ?>
	English
<?php endif; ?>

list_languages()

Function will take the language descriptions defined in the base config file (lang_desc array) and return them as links.

Available parameters

  • layout - type of output. Available options li (unordered list), img (links with image. Images not provided), a (links)
  • title - if provided, language title will be shortened to abbreviation

Usage example:

<ul class="lang">
	<?php echo list_languages(array('layout' => 'li', 'title' => 'code')); ?>
</ul>

logged_in()

Returns true if the user is logged in

Usage example:

<?php if( logged_in() ): ?>
	Logged In
<?php endif; ?>

breadcrumbs()

Available parameters

  • delimiter - default value is set to arrow - " > "
  • title

Usage example:

<?php echo breadcrumbs(array('delimiter' => '', 'title' => $bc)); ?>

Available parameters

  • module - available options: PAGES_M (default. Can be ommitted), CATEGORIES_M, POSTS_M. Based on provided option/module, admin edit path will be created
  • id - post id
  • label - link label. Default: "Edit"

Usage example:

<?php echo edit_post_link(array('module' => POSTS_M, 'id' => $id, 'label' => 'Edit post')); ?>

Settings

Translate Admin panel to your language

Administration Panel can be easily translated into your language by going to Settings->Translations. Once saved, all labels will be stored into the static language file.
Language files can be found in /application/language/english/ folder. You can also add translations manually by editing the language files.

TIP: It is recommended to backup the language file once you add translations to avoid override and losing changes.

FAQ

I am getting Page not found (404) error

  • make sure you have setup the homepage
  • make sure that you have uploaded the provided .htaccess file to server
  • try to remove Options +FollowSymLinks -Indexes and/or AllowOverride All items in the .htaccess file
  • if you have homepage already created, open the /application/config/config.php file and try to change uri_protocol from AUTO to REQUEST_URI

I can not login to admin panel

.htaccess file is setup by default to remove the domain www. prefix on server side. Make sure that you have not included the www. prefix in base_url config item.

How to add menu items?

Click on the Menu identifier or Edit menu items icon.

Changelog

Version 2.2 / 08-16-2015

  • New - additional menu helper properties (bootstrap friendly)
  • New - define maximum number of images per post
  • Update to CodeIgniter 3.0
  • CKeditor update (v4.5.2)
  • KCFinder update

File changes

  • /index.php
  • /system/*
  • /admin_assets/ckeditor/*
  • /admin_assets/kcfinder/*
  • /application/*

Database update
The table structure has changed a bit. Make sure you update your database as follows:

  • session_id field is renamed to id
  • user_agent field is dropped
  • user_data field is renamed to data and under MySQL is now of type BLOB
  • last_activity field is renamed to timestamp

CodeIgniter 3 introduces a lot of changes in this update.
Make sure you have a backup of your current view files/templates, site config and database config files.

Complete list of CI2 to CI3 changes can be found here.

Version 2.1.2 / 04-19-2015

  • CKeditor update (v4.4.7)
  • Bug fix - wysiwyg character encoding
  • /admin_assets/ckeditor/*

File changes

  • /admin_assets/ckeditor/*
  • /application/helpers/wysiwyg_helper.php
  • /application/modules/pages/controllers/pages.php
  • /application/modules/publish/controllers/publish.php
  • /application/views/admin/blocks/form.php
  • /application/views/admin/includes/content.php
  • /application/views/admin/includes/custom_fields.php
  • /application/views/admin/includes/excerpt.php
  • /application/config/constants.php

Version 2.1.1 / 03-23-2015

  • added slug character convert dictionaries
  • max publish upload fields limited to 10
  • Bug fix - publish rss fix
  • New feature - datepicker month and year dropdown menus
  • New feature - child categories on publish index template

File changes

  • /admin_assets/js/synctranslit.js
  • /admin_assets/js/initialize.js
  • /admin_assets/css/style.less
  • /admin_assets/css/style.css
  • /css/style.css
  • /application/views/publish/rss.php
  • /application/config/constants.php
  • /application/modules/controllers/publish.php
  • /application/modules/models/publishmodel.php
  • /application/views/publish/index.php
  • /application/views/admin/publish/form.php

Version 2.1.0 / 02-16-2015

  • Current CMS version variable moved from config to constants
  • Creating admin thumbnails for faster image and page loading
  • Bug fix - error log while post main image is not available
  • New feature - category tree menu post counter. (Read more)
  • New feature - category tree menu hide categories without posts. (Read more)
  • New feature - post edit link. Link will take you to admin post edit page. (Read more)

File changes

  • /application/config/constants.php
  • /application/views/admin/master.php
  • /application/views/admin/login.php
  • /application/modules/publish/controllers/publish.php
  • /application/modules/publish/helpers/publish_helper.php
  • /application/views/publish/admin/publish/*
  • /application/modules/publish/controllers/admin.php
  • /application/modules/publish/controllers/admin_categories.php
  • /application/modules/pages/helpers/pages_helper.php

Version 2.0.1 / 01-16-2015

  • Bug fix - missing argument bug while updating/deleting a menu
  • Bug fix - menu title validation (Title was not remembered if validation error occurred)
  • Bug fix - undefined index while creating a new menu item
  • Bug fix - you were unable to reorder the submenu items if parent item is deleted
  • Bug fix - one column page template filename

File changes

  • /application/modules/menus/controllers/admin.php
  • /application/modules/menus/models/adminmodel.php
  • /application/modules/menus/models/menuitemsmodel.php
  • /application/views/pages/onecolumn.php (instead of one-column.php)

Version 2.0 / 12-8-2014

Due to a lot of core and structure updates and slightly different way of integration (almost all files have been updated), version 2.0 is not compatible with the earlier ACMS versions. Clean installation is recommended.

Support

Thank you for using ACMS software.

If you have any questions, suggestions or you need help, please write an email to mile.lazar@gmail.com