Jump to content


  • Posts

  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

Sarnoc's Achievements


Newbie (2/6)



  1. Ok thanks, I'll take a look. I'm really struggling with this so I'm just going to have to hack around with it until I can get something to work..
  2. Hi All, Back again! Following on from my last post (useful for background), I'm now trying to build filters for my website to make it easier to find the correct page. I've used the Skyscrapers style of building an array but I can't work out how to insert logic into the filter. For example, I have the following set up within my filters: Year_Sunday (1 of the 3 Sunday years) Year_Weekday (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) These are referencing page references, so each of those is a separate part of the site structure. In my code, I've just got: foreach(array('Liturgical_Year_Sunday', 'Liturgical_Year_Weekday', 'Liturgical_Season', 'Liturgical_Week') as $key) { if(!$value = $input->get($key)) continue; } as shown in the Skyscrapers demo. This gives me the ability to apply filters, but the logic appears to be OR rather than AND? For example, if I've got both Season and Week filters applied, (e.g. Lent, Week 4), I'll get any results that are tagged with Lent OR Week 4, when in fact what I want is the following filter logic: Liturgical_Year_Sunday OR Liturgical_Year_Weekday AND/OR Liturgical_Season AND Liturgical_Week I'm guessing it's something to do with how you build the selector, but I can't see that in the Skyscrapers code. If someone could give me some hints on where to find it and how to implement this, it would be much appreciated. Thanks
  3. Thanks everyone - I'll have a look and see what I can do! I'll let you know how it goes!
  4. 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?
  • Create New...