PHaiku

Basic usage

All the data is located in the ./data folder unless specified differently in the ./config/config.php under the data.source keyword.

Toggle multilingual

In the default data set, two languages are be present: english (en) and slovenian (sl). If you don't need multilingual features just do the following:

  • in the ./config/config.php file set the key "multilingual" to false: "multilingual" => false,
  • copy content from the ./data/en folder to the ./data folder
  • delete the language folders in the ./data folder.

The file structure of the ./data folder if multilingual is enabled:

./data
	/en
		/widgets
			/menu.php
			/some_widget_data.php
		/news
			/2014_05_08_Breaking_news.html
			...
		/pages
			/index.html
			/some_content.html
			/category
				/categorized-content.html
				...
		/front
			section1.html
			section2.html
			...
		_config.php

	/fr/
		[same as above]
		...
	

The file structure of the ./data folder if multilingual is not enabled:

./data
	/widgets
			/menu.php
			/some_widget_data.php
		/news
			/2014_05_08_Breaking_news.html
			...
		/pages
			/index.html
			/some_content.html
			/category
				/categorized-content.html
				...
		/front
			section1.html
			section2.html
			...
		_config.php
	

Add content

To add a new content page, you must create that page in html and save it as an html file in the /page/ folder. Example: foo.html The page will be visible as soon as it is saved under the url /p/foo (in case of multilanguage, this will be prefixed with the two letter language code).

The page will not (at this time) be visible in the menu. To make it accessible from the menu add this line to the menu:

	"Foo" => "/p/foo",
	

If you have multilingual enabled, the language prefix will be added automatically. You just have to have a separate menu for each language in their respecitve language folders (see file structure above).

Categories

You can categorise your content by storing it to subfolders inside the ./data folder. ./data/{language}/foo/bar.html will be accessible under {language}/p/foo/bar.

This is how you reflect this in the menu:

"Foo" => [
	"Bar" => "/p/foo/bar",
]	
	

If you're using the provided Dropdowns for extension, you'll have a nice dropdown, just as this one in the demo. Else, you may use any other menu sistem in the frontend.

Although this will scale to infinity, a good practice is to have up to three categories deep. Few users will have the will to navigate further ...

Deleting

Although deleting is as easy as deleting files, and lines in the menu, you might also consider renaming the files: foo.html.bak will no longer be accessible from the frontend, or commenting the lines of the menu you no longer need.

<?php
return [	
	"Home" => "/" ,
	"Foo" => "/p/foo",
	"Bar" => [
		// "Baz" => "/p/bar/baz",  <<< this entry will disapear from the menu
		"Booz" => "/p/bar/booz",
	]
];
	

Cache

Since the 0.8 version caching is implemented and there is a possibility that you will not see the changes right away. To clear the cache, visit the url yoursite.com/clearcache. This is the default route for this purpose. It is recommended however, that you change it in the settings and keep it private.

That's all there is for the basics.

Comments

Feel free to comment or ask questions! Thanks!

comments powered by Disqus

Execution time: 0.1967s Memory usage: 0.683552MB