- Créée par Céline Didier, dernière mise à jour par Benjamin Lemoine le mai 16, 2025 4 min de lecture
Vous regardez une version antérieure (v. /wiki/spaces/ESUPMULTI/pages/1425801229/Connecteur+CMS+Headless) de cette page.
afficher les différences afficher l'historique de la page
« Afficher la version précédente Vous regardez la version actuelle de cette page. (v. 8) afficher la version suivante »
Paramétrage
Le connecteur CMS a été pensé de manière à pouvoir s'interfacer avec plusieurs CMS. Actuellement, 2 modules permettent de communiquer avec Wordpress et Directus.
La configuration du CMS qui sera utilisé se fait au niveau du fichier .env
# CMS TO USE : directus | wordpress DEFAULT_CMS= # DIRECTUS #DIRECTUS_API_URL=xxx #DIRECTUS_API_TOKEN=xxx # WORDPRESS #WORDPRESS_API_URL=xxx #WORDPRESS_API_USERNAME=xxx #WORDPRESS_API_PASSWORD=xxx
Dans DEFAULT_CMS indiquez le CMS souhaité, puis dé-commentez les lignes de conf propres au CMS choisi.
Collections et leurs champs disponibles
Channels
query {
channels {
id
code
color
icon
routerLink
filterable
translations {
languagesCode
label
}
}
}
query {
channel(id: "1") {
id
code
color
icon
routerLink
filterable
translations {
languagesCode
label
}
}
}
{
"data": {
"channel": {
"id": "1",
"code": "ALERT",
"color": "#EF154E",
"icon": null,
"routerLink": null,
"filterable": false,
"translations": [
{
"languagesCode": "en",
"label": "ALERT"
},
{
"languagesCode": "fr",
"label": "ALERTE"
}
]
}
}
}
Contact Us
query {
contactUs {
icon
to
translations {
languagesCode
title
content
}
}
}
{
"data": {
"contactUs": {
"icon": "mail",
"to": "test@test.com",
"translations": [
{
"languagesCode": "fr",
"title": "Nous contacter",
"content": "<p>On peut tromper 1000 fois 1 personne, mais on ne peut pas tromper 1000 fois 1000 personnes</p>"
},
{
"languagesCode": "en",
"title": "Contact us",
"content": "<p>You can fool 1 person 1000 times, but you can't fool 1000 people 1000 times</p>"
}
]
}
}
}
Features
query {
features {
id
description
translations {
languagesCode
title
shortTitle
searchKeywords
}
icon
iconSvgDark
iconSvgLight
menu
authorization {
roles
type
}
position
settingsByRole {
position
role
}
type
routerLink
link
ssoService
statisticName
}
}
query {
feature(id: "1") {
id
description
translations {
languagesCode
title
shortTitle
searchKeywords
}
icon
iconSvgDark
iconSvgLight
menu
authorization {
roles
type
}
position
settingsByRole {
position
role
}
type
routerLink
link
ssoService
statisticName
}
}
{
"data": {
"feature": {
"id": "1",
"description": "Redirige l'utilisateur vers le service interne affichant les dernières actualités",
"translations": [
{
"languagesCode": "fr",
"title": "L'actualité",
"shortTitle": null,
"searchKeywords": null
},
{
"languagesCode": "en",
"title": "News",
"shortTitle": null,
"searchKeywords": null
}
],
"icon": null,
"iconSvgDark": "<svg width=\"14\" height=\"14\" viewBox=\"0 0 14 14\" xmlns=\"http://www.w3.org/2000/svg\">...</svg>",
"menu": "top",
"authorization": null,
"position": 10,
"settingsByRole": [
{
"position": 1,
"role": "student"
}
],
"type": "internal",
"routerLink": "/rss",
"link": null,
"ssoService": null,
"statisticName": "rss"
}
}
}
Important News
query {
importantNews {
id
translations {
languagesCode
title
content
buttonLabel
}
image
authorization {
roles
type
}
color
link
position
statisticName
}
}
query {
importantNew(id: "1") {
id
translations {
languagesCode
title
content
buttonLabel
}
image
authorization {
roles
type
}
color
link
position
statisticName
}
}
{
"data": {
"importantNew": {
"id": "1",
"translations": [
{
"languagesCode": "fr",
"title": "Cartes étudiant",
"content": "Vos cartes d'étudiant sont disponibles !",
"buttonLabel": "Voir vos cartes"
},
{
"languagesCode": "en",
"title": "Student cards",
"content": "Your student cards are available!",
"buttonLabel": "See your cards"
}
],
"image": "5a3695fc-af24-4c60-bd67-50eaee02d81e",
"authorization": {
"roles": [
"student"
],
"type": "ALLOW"
},
"color": "#EF154E",
"link": "/cards",
"position": null,
"statisticName": "cards"
}
}
}
Login
query {
login {
translations {
languagesCode
notAuthenticatedText
connectionText
}
}
}
{
"data": {
"login": {
"translations": [
{
"languagesCode": "fr",
"notAuthenticatedText": "Vous n'êtes pas authentifié",
"connectionText": "<p>Bonjour</p>"
},
{
"languagesCode": "en",
"notAuthenticatedText": "You are not authenticated",
"connectionText": "<p>Welcome</p>"
}
]
}
}
}
Social Networks
query {
socialNetworks {
id
title
icon
link
position
}
}
query {
socialNetwork(id: "1") {
id
title
icon
link
position
}
}
{
"data": {
"socialNetwork": {
"id": "1",
"title": "github",
"icon": "logo-github",
"link": "https://github.com/EsupPortail",
"position": 1
}
}
}
Static Pages
query {
staticPages {
id
translations {
languagesCode
title
content
}
icon
iconSvgDark
iconSvgLight
position
statisticName
}
}
query {
staticPage(id: "1") {
id
translations {
languagesCode
title
content
}
icon
iconSvgDark
iconSvgLight
position
statisticName
}
}
{
"data": {
"staticPage": {
"id": "1",
"translations": [
{
"languagesCode": "fr",
"title": "Aide",
"content": "<h2>Bonjour !</h2>\n<p>Lorem ...</p>"
},
{
"languagesCode": "en",
"title": "Help",
"content": "<h2>Hello !</h2>\n<p>Lorem ...</p>"
}
],
"icon": "help-circle-outline",
"iconSvgDark": null,
"iconSvgLight": null,
"position": 1,
"statisticName": "help"
}
}
}
Widgets
query {
widgets {
id
description
widget
translations {
languagesCode
title
content
}
icon
iconSvgDark
iconSvgLight
authorization {
roles
type
}
position
settingsByRole {
position
role
}
type
routerLink
link
ssoService
color
statisticName
}
}
query {
widget(id: "1") {
id
description
widget
translations {
languagesCode
title
content
}
icon
iconSvgDark
iconSvgLight
authorization {
roles
type
}
position
settingsByRole {
position
role
}
type
routerLink
link
ssoService
color
statisticName
}
}
{
"data": {
"widget": {
"id": "1",
"description": "Widget affichant les prochains événements dans le calendrier",
"widget": "calendar:calendar",
"translations": [
{
"languagesCode": "en",
"title": "Your next events",
"content": null
},
{
"languagesCode": "fr",
"title": "Vos prochains évènements",
"content": null
}
],
"icon": null,
"iconSvgDark": null,
"iconSvgLight": null,
"authorization": {
"roles": [
"anonymous"
],
"type": "DISALLOW"
},
"position": 50,
"settingsByRole": [],
"type": "external",
"routerLink": null,
"link": "https://mail.mon-univ.fr/zimbra/preauth/preauthUL_ETU.jsp?ticket={st}",
"ssoService": "https://mail.mon-univ.fr/zimbra/preauth/preauthUL_ETU.jsp",
"color": null,
"statisticName": null
}
}
}
- Aucune étiquette