PageFactory (Kirby Plugin)

Installation

Starting Point / Prerequisites

  • Working on a linux/unix-based computer (including Macs) *)
  • Apache2 web server installed and working
  • git and composer installed and working
  • We assume that you will install Kirby & PageFactory in a subfolder of doc-root (e.g. localhost/myapp/).
  • In other cases you will need to slightly adapt the installation process.

*) Experimetal support for Windows is underway

Installation Script

1) Download the installation script.

→ best to store it in a folder just above your new web-app.

2) Run install-pagefactory.sh in a terminal window:

cd path/to/parent/folder/
sh install-pagefactory.sh myapp

→ this will install a working website based on Kirby and Pagefactory.

Jumpstart

3) Open the page in your browser, e.g. http://localhost/myapp/ or http://localhost:8888/myapp/

→ you should see the "Congratulations!" page.

4) Open the Admin Panel to modify the homepage, add new pages, languages, users etc.

→ Note that after adding pages you will automatically get a navigation menu.

Manual Installation

Open a terminal window and execute the following steps:

1) Create the root folder of your new web-app, e.g. myapp/ and cd into it

mkdir myapp
cd myapp

2) Clone Kirby's Plainkit

git clone https://github.com/getkirby/plainkit.git .

3) (Optionally) clone Kirby plugin Twig from github.com/wearejust/kirby-twig.git

git submodule add https://github.com/wearejust/kirby-twig.git site/plugins/kirby-twig
composer update –working-dir=site/plugins/kirby-twig 

3) Clone MarkdownPlus as a submodule to folder site/plugins/markdownplus/

git submodule add https://github.com/pgfactory/markdownplus.git site/plugins/markdownplus
composer update –working-dir=site/plugins/markdownplus

3) Clone PageFactory as a submodule to folder site/plugins/pagefactory/

git submodule add https://github.com/pgfactory/kirby-pagefactory-plugin.git site/plugins/pagefactory
composer update –working-dir=site/plugins/pagefactory

4) Copy files to their final location and rename some

cp -R site/plugins/pagefactory/install/content/  content
cp -R site/plugins/pagefactory/install/site/     site
mv content/home/home.txt                         content/home/z.txt

→ the last step is essential, it tells Kirby to use the Twig template site/templates/z.twig – which picks up content elements previously prepared by PageFactory.

 

5) Open page in your browser, e.g. http://localhost/myapp/

Add Pages

Open the Admin-Panel and

  • change the status of Home to Public
  • click on Add to create a new page (make it Public as well)

→ If you reload your homepage, you'll notice a navigation menu in the upper right corner.

Comment re. Styling:

PageFactory ships with some basic styling, just to get you going, like the positioning of the navigation menu.

If that suits you as a starting point, just add styling in site/assets/css/autoload/ (or on a per page basis). Otherwise remove class pfy-default-styling from the template site/templates/z.twig and start from scratch.

Multi-Lingual Setup

To make your website multi-lingual, go to the Admin-Panel and navigate to option Languages in the main menu.

  • first define your default language
  • then add any additional languages.

→ If you reload your homepage, you'll notice a simple language selection menu in the lower left corner. (like en, de).

 

Note: for this to work, option languages must be enabled in site/config/config.php:

'languages' => true,

→ Normally the PageFactory's installation process did that automatically.

 

Note:
PageFactory ships with language resources for English and German. To add other languages, see chapt. Multi-Language Content.

In particular, you'll need to modify the file:

  • site/plugins/pagefactory/variables/pagefactory.yaml

Possibly also:

  • site/custom/variables/custom-vars.yaml

PageFactory