Outlast - Microsite Editor


Enabling microsite loading

There are two typical ways of using microsites: with subdomains or as folders.

Create a local copy of microsite.conf.ini and set up the microsite_url_prefix and microsite_url_postfix so that the admin panel displays a user-friendly depiction of the final url. See conf file for an example on a folders implementation.

Enabling folders

To enable folders add the microsite error handler to your default controller’s __error() method:

// Use microsite friendly url handler
	$this->zajlib->microsite->error($request);

Enabling subdomains

To enable subdomains, you need to add the microsite error handler to your default controller’s main() method:

// If the subdomain is admin, redirect to admin
switch($this->zajlib->subdomain){
	case 'admin':
		// Redirect to admin
		return $this->zajlib->redirect('admin/');
	default:
		// Use microsite friendly url handler
		return $this->zajlib->microsite->error($this->zajlib->subdomain);
}

Editing content

Log in to http://example.com/admin/microsite/ to create a new site or edit content of an existing site. Click “Edit content” to get access to all the editable content.

If you need to edit something that is not available, contact an administrator or see below for details on creating templates.

Creating templates

To create a template for the Microsite Editor follow these steps:

  • create a standard Outlast Framework template file
  • for each editable tag use the Outlast CMS data attributes
  • add the template by going to http://example.com/admin/micrositetemplate/, clicking “New template”, and filling out the details

Default and localized content

You can localize the field name and default content by adding a language file with a [fields] and [content] section. The [fields] section defines the name of the fields in the admin panel. The [content] section defines the default content of the fields. This default content will be used as placeholders in the preview and in the admin.

When you create a new MicrositeTemplate in the admin, you can specify which language file it should use. Do not specify the locale here – it should be something like templates/my_great_template.

Here’s an example lang file for the default en_US locale:

[fields]
maintitle = Main title
subtitle = Subtitle

[content]
maintitle = Amazing sale!
subtitle = Buy now and save up to 50%

Then we have a localized version in hu_HU:

[content]
maintitle = Hatalmas akció!

Notice that the fields are not defined and that we only localize what we want to. Any content we do not localize will show up in the default locale.

Important You must create a language file for each template in the default locale that includes the content and fields sections. For every other locale, you only need to create a language file if you want the template to be supported for that locale. For locales that do not have a lang file for the given template, the user will get an error when he/she would like to select that combination.

Updating templates

After adding or updating the data attributes, go to http://example.com/admin/micrositetemplate/ and click “Template update”. This will reparse the HTML template and create all the editable field sections.

Outlast Web & Mobile Development (c) 2023 | Privacy Policy |