Repository Stack / Mini CMS Tutorial

Testproject

Repository Stack

Repository

Video

Requirements

Caution: This is an administrative stack with a lot of power. Please use responsibly.

Minimum RapidWeaver 7, Stacks 3.5, PHP Version 5.6 required.

Maximum file upload size is restricted in PHP settings of your server.

How to install the Repository Stack

Drag and drop the Repository Stack to a new stacks page. The Repository Stack should be the only stack on the page.

Regardless of the theme/framework you’re using, the Repository Stack uses its own theme. Currently you can choose between Bootstrap default and Material Design themes.

The Repository Stack will not allow you to navigate further up the directory tree from where it is installed.

Therefore, install the stack inside a folder of your choice. The stack doesn’t have to be named index.php, so it can reside next to another page if needed.

The Repository Stack will hide its own generated page and asset folder.

Basic Settings

Stacks Image 332053

Basic Authentication

The Repository Stack does not store passwords in clear text. Therefore, you need to generate your own hash, to be entered inside the stack’s settings.

You can generate a new hash here: https://hash.instacks.com. You should enter the password of your choice in the “Password” field. Then click “Generate Hash”.

Enter the generated hash key into the Repository Stack settings, and then use the password you chose to sign into the Repository control panel.

You must use the password you used to generate the hash key to sign into your control panel. The hash key will not work for signing in.
Stacks Image 332051

Sitelok Integration

For a Sitelok integration, an installed Sitelok application and license is required. The Sitelok install path should not be changed, unless the RapidWeaver project where Repository Stack is used in is not installed in the server root, or when Sitelook is not located in its default install path. You are able to define a user group, which is required for the logged in Sitelok user. No additional stacks or settings are required.
Stacks Image 332079

Email Notification

Stacks Image 332059

Permissions

Below screenshot shows you the different permission settings of the stack.
Stacks Image 332065

Further Security Considerations

Choose a random username and password.

Do not show the page with Repository Stack inside the navigation.

Use the black and white list of allowed file extensions to restrict the upload capabilities.

Only enable these functions, which you are really sure you want the user of the stack to be executed. Uploading of zip archives and extracting them will not check the black and white list of allowed file extensions.

Repository Stack does not password protect the uploaded files. The password is only used for the Repository Stack user interface. Password protection of files can be done via .htaccess password protection.

Embed Stack / Mini CMS

Embed

Video

Basic Settings

Embed Stack will embed dynamically files of your web server into the static generated code. With Embed Stack, it is possible to build some sort of minimalistic CMS.

Embed has just one setting for defining the root folder of files. This could be the same folder than also Repository Stack uses.

Place one instance of the Embed Stack on the page, where you want to embed the content of other static files.
Stacks Image 332115

Macros

The table below shows the different integration macros you are able to use on the page, where Embed Stack is placed on.

With using the macro in any text input field (like basic text stacks, or input fields for metadata), you are able to replace the content of the file with the macro.

  • Plain Text: No further formatting, perfect for one liners like title headers, or own HTML code.
  • Markdown Formatted Text: Text content will be processed by a markdown processor. Best for multiline text, which contains markdown formatting.
  • Image: Generates an image tag with the referenced image file.
  • MP3 Audio: Places an HTML5 audio player on the page for playing the mp3 audio file.
  • MP4 Video: Places an HTML5 video player on the page for playing the mp4 video file.
  • CSV Table: Generates a HTML Table based on the referenced CSV file.
  • PDF: Places a PDF viewer on the page with the referenced PDF document.

Note that previewing the macro replacement locally in RapidWeaver will not work. Previewing will only work on the published page on the server, where also the resource files are existing.

It is possible to use files from subfolders also. If the Embed Stack is configured to use all files from /resources, you can use a macro like test/filename.txt to embed a filename.txt inside the folder /resources/test.
DescriptionMacro
Plain Text%embed(filename.txt)%
Plain Text (localized)%embedLoc(filename.txt)%
Markdow Formatted Text%embedMd(filename.txt)%
Markdow Formatted Text (localized)%embedMdLoc(filename.txt)%
Image%embedImg(filename.jpg)%
Image (localized)%embedImgLoc(filename.jgp)%
MP3 Audio%embedMp3(filename.mp3)%
MP3 Audio (localized)%embedMp3Loc(filename.mp3)%
MP4 Video%embedMp4(filename.mp4)%
MP4 Video (localized)%embedMp4Loc(filename.mp4)%
CSV Table%embedCsv(filename.csv)%
CSV Table (localized)%embedCsvLoc(filename.csv)%
PDF%embedPdf(filename.pdf)%
PDF (localized)%embedPdfLoc(filename.pdf)%

Localization

The general workflow of localization of embedded files is the same:

  • You have a piece of text you want to translate stored in a file, e.g.: filename.txt.
  • This filename.txt acts as standard or fallback text. It will be displayed all the time when no translation variant is available.
  • In order to create a translation version for this module, e.g. in German, add a filename-de.txt.
  • In all cases where the visitor of your site is using the German language, filename-de.txt will be displayed. In all cases the visitor has another language setting, filename.txt will be displayed.
  • It is possible to create multiple translations at the same time with adding additional filename.txt variants, all followed by a dash and the 2 letter ISO language code. Check the list of ISO 639-1 codes therefore.

Language Selector

In order to select the language, the page has to be loaded with the URL parameter locale = 2 letter ISO language code. Here are some examples:

  • You add 2 buttons on your home page, both with links to either http://yourpage.com/?locale=de for German, or http://yourpage.com/?locale=en for English (in above example our fallback language). This will trigger a reload of the home page with the selected language.

  • You add 2 navigation items in your menu, both with links to either http://yourpage.com/?locale=de for German, or http://yourpage.com/?locale=en for English. This will also trigger a reload of the home page with the selected language, independend where the user is currently inside the menu structure.

  • You add 2 navigation items in your menu, both with relative links to either ./?locale=de for German, or ./?locale=en for English. This will trigger a reload of the current page with the selected language, independend where the user is currently inside the menu structure. In order to make these relative links working, make sure all your pages are Stacks pages with an instance of Localizer Stack.

Repository Stack

Repository Stack