Hi all,
Found Processwire when trying to decide what to use to update a website I run for a friend and was hoping for some advice on designing the most important system I need for this website to work.
First some background: the site is for a Priest; he has hundreds of homilies, one for each day of the year. The concept is that on each day of the year, the relevant day's homily will be highlighted to readers (probably at the top of the homepage). The complication with this is that the Church calendar runs in a three year cycle on Sundays and two years on weekdays, and Easter moves around which means that a homily could, for example, either be on the 28th February or the 20th May, or various dates in between. So I'm trying to escape from being tied to the Gregorian calendar except in a superficial way.
Each homily is unique to a specific day of a specific year, so I've added fields that can be selected to find a specific homily, getting more granular each time:
Year1 (1 of the 3 Sunday years)
Year2 (1 of the 2 weekday years)
Season (1 of 6 or so seasons, e.g. Lent)
Week (1, number of weeks dependent on length of season)
Day of week (1 of 7)
So with this information we can find any homily for any given day. For example, today (15/04/2019) [value in brackets] is Day[Monday], Week[6], Season[Lent], Year2[Cycle 1], Year1[Year C].
At the moment, I've thrown that into a database - so now I can input any date 2019-2022 and find out what that specific day would be in 'Church calendar' terms - and that can be extended pretty much infinitely without much effort
On the Processwire end, I followed the Tutorial: Approaches to categorising site content - Tutorials - ProcessWire Support Forums tutorial using the Simple Multiple Categories approach and ended up with the following page structure:
> Home
>>Homilies
>>>Homily1, Homily2, etc
>>Season
>>>Lent, Advent, etc
and so on.
One of the things that was confusing me was that you can't seem to address a page by its Title but instead have to use its Id number - e.g. instead of just looking for "Lent" it has to be "1057". This is fine when you're only addressing things in Processwire, but I don't want to have to hardcode the page Id into my background database when I know that "Lent" is never going to be changed from being "Lent" - basically in my use case, "Lent" is as reliable as "1057" for me to work with. So I went looking in Adminer and found that the "field_title" database in Processwire contains the Id of each page and its Title. The concept I'm now working with is that I should be able to just search in this table for "Lent", return "1057" for the page Id, and then place that into a second query (somehow on the Processwire end) which just looks for each relevant Id number like any query in Processwire - e.g.
$dailyhomily = $pages->find("template='homily', Year1='1029', Season='1057'"); etc.
Obviously, the Year1, Season etc would have to use variables.
To be honest, I'm just looking for suggestions on approach at this point. I'm right at my limits when it comes to PHP (can get by) and SQL (really bad) but I don't mind learning and messing around until something works!
Gut feeling is that this is a module somehow, but I'm not even close to understanding how to hook into the background stuff with Processwire so likely to need a lot of help with that?