Forum

Thread tagged as: Question, Configuration, Discussion

Matching content with non-templated data

Some of the websites I build for clients need to transform their design colours according to the Church seasons (e.g., Lent, Easter, Pentecost, etc.). I would like to know how I could accomplish this in Perch. Here is the PHP/MySQL setup I use currently in my custom CMS:

db table "calendar_seasons" contains a library of the various Church seasons with no dates attached.

  • season ID
  • name of season
  • name of associated stylesheet
  • other design-related information for the season

Example:

  • seasonID | 1
  • season_Name | Advent
  • season_Stylesheet | advent.css
  • season_Display | 1
  • season_Sort | 100

db table "calendar_seasons_schedule" records instances of each season, so that website admins can schedule the year's upcoming seasons and make the website change its colours automatically:

  • schedule ID
  • link to season ID
  • start date
  • end date

Example:

  • scheduleID | 84
  • seasonID | 1 (for Advent)
  • start_date | 2015-11-30 00:00:00
  • end_date | 2015-12-25 00:00:00

By linking the two tables on the season ID, each scheduled season instance takes on the design specs of each library season item.

These scheduled seasons don't have any content beyond their scheduling, so I'm not sure where they would exist in Perch. The "calendar_seasons" items are used as content categories, so those are more straightforward.

This is pretty basic table linking. How would I go about doing this using Perch's system? Would this kind of functionality require creating a Perch App? Or is there some way to use part of Perch's core for this?

I'd really love to start using Perch for some of my projects, but this is one obstacle I need to figure out before diving in.

Luke

Luke Johnson

Luke Johnson 0 points

  • 6 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

If you want to read and write data to custom tables, then yes, you'll need to build an app for that.

If you just wanted to manage it within Perch and let Perch handle the data, then you could do it with a couple of a multiple item regions linked by a dataselect field in Perch, or with related collections in Perch Runway.

Thanks, Drew! I will read up on multiple item regions and Runway collections.