Module Options


Learn how to setup main Photon CMS module parameters.

Table of Contents
  1. Module Type
  2. Module Name
  3. Table Name
  4. Anchor Text
  5. Anchor HTML
  6. Slug
  7. Icon
  8. Parent Module
  9. Non-grouped fields to bottom

Module Type

Required: Yes

Module Types are described in detail in the Module Types section.

Module Name

Required: Yes

Module Name is a human-readable module name. 

When you start typing in the Module Name field, a Table Name string will be auto-generated. Once you modify the table name manually, the auto-generation script stops allowing you to keep a custom-set table name.

Table Name

Required: Yes

Table Name represents a table name in a snake_case notation. 

When you start typing in the Module Name field, a Table Name string will be auto-generated. Once you modify the table name manually, the auto-generation script stops allowing you to keep a custom-set table name.

Anchor Text

Required: No

Anchor texts are used to visually represent each entry. For example, for a user, it can be the user first and last name. Module anchor_text field can contain any text and also supports shortcodes for fields.

For example, if anchor text is User: {{first_name}} {{last_name}}that means that each entry within that module will have its anchor text compiled by inserting values from first_name and last_namecolumns of the respective entry. Like User: John Doe.

Anchor Text Many-to-one Relations

Many-to-one relations can also be used inside anchor_text field. In this case, the template would be the name of the related table name of the field. For example, if your relation is a field named ‘title’ in a table named ‘companies’, then your template would be {{companies.title}}. An example of a whole anchor text of a user would be {{first_name}} {{last_name}}, {{companies.title}}and would render to something like John Doe, Photon CMS Inc..

Anchor texts are used by our native frontend for searching within entires of individual dynamic module. They can also be used as a search criteria within API filter route as any other module field.

Anchor HTML

Required: No

In case you need to implement an advanced visual representation of an entry you can use Anchor HTML. Within it you can store any HTML code together with template variables representing module fields, used in the same way as for Anchor Text.

If Anchor HTML is defined it will automatically be used for visual representation within Photon CMS Control Panel, but Anchor Text will still be used by default for quick-searching.

Custom Methods Within Anchor HTML Templates

You are free to define your custom methods that would be used alongisde of the template variable representation of module fields. In order to use custom methods you need to define your own trait and use it within /app/PhotonCms/Core/Entities/DynamicModule/DynamicModuleHelpers.php

Custom method should be written in the following format: {{argument1,argument2,...,argumentN|methodName}} where arguments are names of the fields. For example, method  {{width,height|max}} will call method max from your custom trait, pass fields width and height from individual dynamic module entry, and e.g. determine which field is larger and print its value within Anchor HTML text.

Slug

Required: No

You can define your own template which will be used to automatically suggest a URL valid name of any dynamic module entry.

The Slug is defined using template variables in the same way like in Anchor Text and Anchor HTML; e.g. {{first_name}}-{{last_name}}

Major difference is that for Slugs these template variables are only used in Photon CMS Control Panel to generate slug suggestion string while creating an entry. User can freely modify the suggested slug before saving it.

Once you modify the Slug string manually, the auto-generation script stops allowing you to keep a custom-set Slug value.

Icon

Required: Yes

Icon is a representation of Font Awesome icon class name. To help you with icon selection, we've implemented a handy icon picker field.

Photon CMS is using the Font Awesome v4.7 Icon Pack.

Parent Module

Required: No

If this value is set then each entry of the current module can belong to an entry of the parent module.

Learn more about nesting in the Module Nesting section.

Non-grouped fields to bottom

If you're using the field grouping feature, setting this value to 'ON' will render the non-grouped fields below the field groups instead above them.

Sign-up to stay informed about news and updates.