Hello everyone,
is there a way to have a dynamic home page that changes between a set depending on the day of week?
can you show me an example? Trying to understand how it would work.
-
☆ A M B ☆
- 24,524 Posts
Create 7 documents, one for each day.
Create a new snippet with the code as shown above (edit the array to have the actual IDs of your documents). Name it HomeToday.
As the content for your site_start document (as set in the Configuration; it’s 1 by default) put the snippet tags [[HomeToday]].
That should do the job.
Do you need to change the entire page each day? Or just part of it each day?
If you need to change the entire page, you can do the above, if you only need to change a portion of the page you can:
Write a snippet (php snippet) that determines the day, and outputs a chunk (html chunk) based on what day it is? Are you changin much each day?
Well I’m doing a movie theaters website, I have it up and running but wanted to see how hard to would be to have it change between the 3 showtime blocks, eg. Monday-Thursday, Friday, Saturday & Sunday. Because they change showtimes but I wanted to guest to be brought to that days show time on that day, they can navigate to the other STs by clicking the menu but they wanted to have the least amount of work to do as possible.
(Though I should have charged 2x for the amount of work I had to do to get it the way they wanted)