Tip
This project is built as a customization of a TACC CMS website. To manage this project's CMS, reference Core-CMS-Template Docs. To develop this project's custom code, keep reading.
- Navigate to project directory:
This is a CMS that contains a Portal client application.cd to acpd_cms
- Configure the project:
- Create a
/cms/src/taccsite_cms/secrets.py
with content from "Stache" secretAPCD DEV CMS
.
- Create a
- Start the CMS website:
This command will also first build the CMS as needed.make start
- Navigate to client app:
cd apcd_cms/src/client
- Install dependencies:
npm ci
- Start the client app:
npm run dev
- Change code and observe updates live in the browser.
-
Update
urls.py
:- Make the default page return as
TemplateView.as_view(template_name='<template_name')
- Add API endpoints.
These endpoints are used in Client.
- Make the default page return as
-
Update
views.py
:import
JsonResponse
- Remove Template building.
- Adjust context to return
json
. - Send
JsonResponse
.
-
Define hook:
- Add method to retrieve data from server.
- Add & Export
type
s inindex.ts
.
-
Defining component:
- Add one or more components as a
.tsx
file. - Export the component.
- Add
export
s inindex.ts
.
- Add one or more components as a
-
Update
apcd_cms/src/client/src/main.tsx
:import
the component.- Map (via
componentMap
) a unique ID to the component.
-
Update first line:
- from
{% extends "standard.html" %}
- to
{% extends "apcd_cms/templates/standard.html" %}
- from
-
Add an element where the component will render e.g.
<div id="list-registrations-root"></div>
Give the element its unique
id
as defined inmain.tsx
.