This package use Strapi as headless CMS for Pagopa.it website.
yarn install
and then yarn build
(useful command to build the React Admin FE)
# Use the local env
$ cp .env.local .env
HOST=0.0.0.0
PORT=1337
APP_KEYS="MY_KEY"
API_TOKEN_SALT=MY_KEY
ADMIN_JWT_SECRET=MY_KEY
JWT_SECRET=MY_KEY
DATABASE_HOST=localhost
DATABASE_PORT=5432
DATABASE_NAME=postgres
DATABASE_USERNAME=postgres
DATABASE_PASSWORD=mysecretpassword
A Docker image is available for a postgres db
# Pull the latest Docker image
$ docker pull postgres
# Run the Docker container at http://127.0.0.1:<YOUR_HOST_PORT>/
$ docker run --name pagopa-corporate-cms -e POSTGRES_PASSWORD=mysecretpassword -d -p 5432:5432 postgres
# start the postgres db
$ docker start pagopa-corporate-cms
start your db
yarn strapi develop
when in dev mode or when you want to add/modify content-types and components
yarn strapi start
when you in uat/production env
Access the admin console from the HOST:PORT/admin address (ex: http://localhost:1337/admin)
generate a full_access token to access the strapi endpoints from Settings -> API Tokens
go to Settings/internationalization add Italian (it) as a new locale Set it as the default locale from the advanced panel
- from the content manager:
- select the Page collection
- Create new entry
- the page path will be generated from the
url_path
andslug
in the client asurl_path/slug
- from the content manager:
- select the Page collection
- Create new entry
- the
slug
should be: "index" - leave the
url_path
empty - hit the save and the publish button
- Go to the navigation settings page
- Add the
highlight
field:- Custom fields settings -> Create new custom field
- Fill the name and label with "highlight"
- Change the field type to boolean
- Toggle the 18n option from Additional Settings -> i18n
- click Save Configuration
- click Restart Strapi (restart manually if there is any error)
- Go to the navigation plugin page
- create a new navigation from Manage->Create
- the displayed id should identify the it locale and id+1 the en locale
- You can check the exacts navigation id or slug running the following query in the strapi postgres db:
SELECT * FROM navigations;
- Add a component with the BackgroundGraphics sub component (Ex. Block Visual + Text)
- find the backgroundAnimation field
- click the plus button
- compile the size, left and top fields
- size: 100, left: 50, top: 50 to have a circle of 100px in the middle of the component
- from the content manager:
- select the CTAlias collection
- create new entry
- from is the desired path from which the user will be redirected
- to is the path were the user will be redirected
- strapi-plugin-navigation to manage navigation menus
- strapi-plugin-config-sync to manage export/import of config between environments (tipically export when in dev, import when in prod)
Using strapi-plugin-config-sync we can export permission settings and other stuffs storing json files in confin/sync folder, after a dev session. Theese json files can be committed and used when in prod to programmatically sync environments.
$ docker exec -it pagopa-corporate-cms bash
$ psql -U postgres
# list all tables
$ \dt
Only the first heroSliderItem
fields are rendered, you can add other item to the list filling only the image
field to be displayed in the slider
Use the blue marker to add a blue highlight on the text.
The indent editor widget can be used to set the text position.
The reveal field can be toggled on to enable the scroll reveal effect animation.
half: is used to display image and text in a row full: displays the title and image in a cloumn and the text will be aligned under the image and to the right big: match the intro component text width setting visual width to big and no image
Using strapi-plugin-config-sync we can export permission settings and other stuffs storing json files in config/sync folder, after a dev session. These json files can be committed and used when in prod to programmatically sync environments.
yarn cs export [optionally type ex user-role]
yarn cs import
For more info visit the plugin's main page on github
- strapi-plugin-navigation to manage navigation menus
- strapi-plugin-config-sync to manage export/import of config between environments (typically export when in dev, import when in prod)