BoltCMS - (3.6)¶
Using Repeaters in Bolt - Custom Templates¶
https://github.com/bolt/bolt/issues/6605 Currently preview pages with repeaters and custom blocks are causing previews not to be shown and in the "partials/_sub_fields.twig" it mentions that this is the case / will not be displayed. (To be fixed in Bolt 4)
Editing Config¶
Styling & Themes¶
BoltCms uses themes located at /public/themes
To change the current theme edit the yaml file /app/config/config.yml
Find the line theme: base-2018
and change to the folder of your choice in the themes folder.
BoltCms also uses Foundation Zurb 6 (currently) see links for quick references: Flex-Grid
BoltCms uses gulp - installs needed: Nodejs Gulp
The location for the theming is as below:
/public/themes/
To build and compile the scss and js go to location:
/public/themes/source/
and run
gulp build
by default this should compile scss and minify the css.
Setting up on a Server¶
Assuming the setup on a local environment has been correctly configured: Bolt Docs Setup
Server Folder & File Permissions for secure: Bolt Permissions for Flat File !sensitive-info
#Permissions for bolt to use database, upload files and cache + thumbnail creation
for dir in app/cache/ app/database/ public/thumbs/ ; do
find $dir -type d -print0 | xargs -0 chmod u+rwx,g+rwxs,o+rx-w
find $dir -type f -print0 | xargs -0 chmod u+rw-x,g+rw-x,o+r-wx > /dev/null 2>&1
done
for dir in app/config/ extensions/ public/files/ public/theme/ ; do
find $dir -type d -print0 | xargs -0 chmod u+rwx,g+rwxs,o+rx-w
find $dir -type f -print0 | xargs -0 chmod u+rw-x,g+rw-x,o+r-wx > /dev/null 2>&1
done
Default Nginx Configuration: Bolt NGINX Configuration
Subfolder server configuration¶
Inside the public folder where you wish your files to be (in this example we will use subdirectory). Create symlinks for each file and folder in the public directory into the subdirectory - giving access to the original files. for example:
# pwd = /var/www/vhosts/project-name/public/subdirectory/
ln -s ../theme ./
ln -s ../bolt-public ./
ln -s ../extensions ./
ln -s ../files ./
ln -s ../thumbs ./
The index file inside the subdirectory will also need updating to accommodate the change of location for files.
Adding an extra "../" in the location for the vendor files.
$app = require __DIR__ . '/../../vendor/bolt/bolt/app/web.php';
Nginx Changes¶
Here we redirect the normal / location to the subfolder useful for local development.
In the location for the /subfolder/ entry notice the updated url with /subfolder.
## File: /etc/nginx/conf.d/bolt-cms-project.conf
# Development Only Redirect on Local Machine
location / {
return 301 /subfolder/;
}
location /subfolder/ {
try_files $uri $uri/ /subfolder/index.php?$query_string;
}
We then also need to add in extra config files.
include includes/boltcms/bolt.conf;
include includes/boltcms/restrictions.conf;
include includes/boltcms/php-fpm.conf;
bolt.conf¶
Redacted
restrictions.conf¶
php-fpm.conf¶
Redacted