Adding Pages

Using The GUI

First, log in to the GUI - http://yoursite.com/gui - on your website. To add now a page in a certain location, you can navigate to the desired location in the site browser (on the left) and hit the "Add Subpage" button. Your site's landing page is your "Home". If you want to create a page on the first level of your site, you basically will create a subpage of the "Home" page. After completing the "Add Subpage" dialog, you will be automatically forwarded to your new page's "Data & Settings" panel:

Data & Settings

data-and-settings.png

Main Properties

  • Title The page's title. The title will also be used to generate the page's URL.
  • Tags: You can add multiple "tags" to your page. These tags can be used for filtering in listings. Multiple tags have to be separated by a comma ,.

Settings

  • Template The template you want to use for the current page.
  • Prefix The pages of your site get sorted alphabetically in all navigation elements. The prefix can be used to define the order of your pages. It won't show up in the page's URL and is just for internal use.
  • Visibility To hide the page from your navigation and menus, this button can be activated.
  • Redirect page to another URL When defined, the page acts as an alias and will always be forwarded to the given URL. Only absolute URLs should be used here!

Variables

All placeholder variables used in the currently selected template show up here. This is the place where you can add your actual page content.

Files

files.png

All files you want to use, either for the gallery extension or within your markup, can be saved along with your page's data. You can switch to the file manager by hitting the Files button on the left sidebar.


Using A Text-Editor

It is recommended to disable caching when editing content outside the GUI!

finder-textmate.png

Naming Directories

As described before, each directory below /pages containing a .txt file gets treated as a page. The name of the directory will be used as the page's URL. You can change the order of pages by prepending any alphanumeric prefix to that directory name, separated by a .. The prefix will be stripped from the URL like this:

/pages/01.about_me    ->    http://domain.com/about_me
/pages/02.work        ->    http://domain.com/work
/pages/03.contact     ->    http://domain.com/contact

There is no limit for the level of subpages. You can create a subpage by creating a subdirectory including a text file within a page's directory.

Choosing A Template & Adding Content

The name of the text file defines the template used to render the page. A text file called my_template.txt will look for a .php file called my_template.php within the currently used theme directoy. You can simply open that .php file to see what variables get used by the template. Page Variables are always used in a template like this:

Somewhere in the template (.php):

<div class="some_class">@p(variable_name)</div>

The text file:

variable_name: Your content here

Reserved Page Variables

You can also store custom settings in the text file, using the same format. Automad uses these reserved variables to customize a page's behavior:

  • theme Overriding the global theme
  • title The page's title
  • tags A comma separated list of tags for filtering
  • url A redirect URL to be used to create aliases
  • hidden If set to 1 or true, the page will be ignored by any automatically generated navigation

For example you can define tags to be used to filter page lists, separated by commas or use another theme for just that page:

 tags: Product, Awesome, Work
 -
 theme: my_other_theme

Files

Instead of the GUI, files can of course be copied to a page's directory via a common file browser or FTP program.

See also