Skip to Main Content

Learn MODX


Topics

  1. Log into the MODXCloud Dashboard
  2. Create a People Template
    1. Duplicate the  Bootstrap Base Template
    2. Name:  People Template
    3. Create Template Variables (TVs) for in the People category
      1. Phone
        1. people-phone / Phone
        2. Input Type: Text
      2. Email 
        1. people-email / Email
        2. Input Type: Email
      3. Title (text)
        1. people-title / Title
        2. Input Type: Text
      4. Department (Resource)
        1. people-department / Department
        2. Input Type: Resource List
        3. Parents: # (id number for departments)
        4. Include Parent: No
  3. Create Several People Resources
    1. Select Template
    2. Enter Pagetitle
    3. Enter TV values
    4. Publish
    5. Save
  4. Update People Template
    1. Display the values in the TVs
      1. See Code Below for Display People TVs
    2. Challenge with people-department
      1. getResourceField
        1. [[getResourceField? &id=`[[*people-department]]`]]
      2. pdoField
        1. [[pdoField? &id=`[[*people-department]]` &field=`pagetitle`]]
    3. Make the Email a mailto: link
      1. <a href="mailto:[[*people-email]]">[[*people-email]]</a>
  5. Use getResources to list the display list of people.
    1. Edit the People page
    2. Turn Off Rich Text
    3. add the getResources call
      1. getResources Documentation
      2. Passing Arguments 
      3. Creating a tpl chunk 
  6. Display staff by department (optional if time permits)
    1. Add the getResources code from the People page to the People Template
    2. Add filter to limit the results to just the department
      1. &tvFilters=`people-department==[[*id]]`
  7. Q&A

 

 

Documentation

 

Display TVs in People Template

 

People Template Content to List Staff

 

 

people-list-tpl (chunk)