https://docs.vmgd.whatworks.com.au/
  • ICT Team
    • Setting up your development environment
      • Install programs
      • Create a development wordpress site in Local
      • Git clone the repo
      • Configure the database connection
      • Pull database from live server
      • Run dev server
      • Push changes to live server
    • Making changes to the website
      • File Structure Overview
      • Creating a New Page Template
      • Content Entry Workflow
      • Deployment
    • VMGD Backend Requirements
      • Functional Requirements
        • Ability to edit website and mobile app content
        • API endpoints + documentation for mobile app
        • GraphQL server that allows the website front-end + mobile app to query all website content
        • Mobile Notification
        • Triggers
      • Non-Functional Requirements
        • Availability
          • Vercel CDN
          • Fastly CDN
          • Fastly Firewall
          • Caching + Firewall Diagram
Powered by GitBook
On this page
  1. ICT Team
  2. Making changes to the website

Creating a New Page Template

1. Set Up ACF Fields in WordPress

  • Location: WP-Admin > Custom Fields > Add New Field Group

  • Define fields as per the page design, ensuring types align with content (e.g., text, images).

  • Set location rules to specify where these fields will appear.

2. Create the Page and Assign Template

  • Go to WP-Admin > Pages > Add New.

  • Assign the relevant template in the "Page Attributes" section.

3. Code the Template

  • Create a New Branch

  • Add a .php file in the WordPress theme folder.

  • Create a folder in nextjs/src/components/pages/ matching the page name.

  • Add a .tsx file for the page React component and a .graphql file for queries.

4. Configure Layout and Data

  • Use the .tsx file to set up the page layout and structure.

  • Map GraphQL data to match ACF fields.

5. Register the Template

  • Add an entry in template-map.ts to link the WordPress template with the Next.js component.

6. Write the GraphQL Query

  • Use the .graphql file to define a query that fetches the ACF data for the page.

PreviousFile Structure OverviewNextContent Entry Workflow

Last updated 6 months ago