I would like to know what are the consequences when I change the folder structure to a “year-based” approach?
events / 2016 / speech a
events / 2016 / speech b
events / 2017 / speech xyz
The website will have events that get deprecated when the event took place. I think it would make sense to have them in a year based folder structure, so when you want to archive them you just cut them. My question would be how I can do that (couldn’t find it under docs/content can someone guide me to the right place?) and the more important question would be what that would mean for my code base.
Depending on this I would make the change or if the changes I would need to do in my code base is too much I won’t make the switch.
There are a couple of things you need to consider:
- I suppose you currently use a flat events folder structure, e.g. all events directly in the events folder?
- if you change the site structure, your links will change as well, so you would have to make sure (e.g. via your server configuration or .htaccess or a route) that old links to your pages will still work, if that is important for your website
- if you don’t want the year to show up in your URL, you can use a route.
- as regards the code base, I don’t think you have to make a lot of changes, all you would have to change is how your controller fetches those pages (i.e. grandchildren of events instead of children, presumably based on date?). The templates would still be the same.
The folder structure is devided into
events / locations / event-a so the new structure would be
events / locations / year / event-a
Changing links could indeed be a problem. The site is not online for now but there are already more then 40 events in the page and you don’t want to correct all the links.
If I would make it year based how would you manage the event creating process? Would you create a subpage “year” and then the subpage “event-a” or is there some automation that I could do?
The links would work automatically, so if the page is not online yet, you don’t have to care about that.
Since you only create the year once, it does not really make sense to automate that, does it? You don’t want to create the next ten years in advance, I guess.
hm yes you’re right
I guess I will give it a try and see what happens
Let me know if you run into any issues.