Skip to content
Grav 2.0 is officially stable. Read the announcement →
Archive

Question re: reusing content across multisite

Started by Muut Archive 10 years ago · 3 replies · 379 views
10 years ago

I'm new to Grav and studying its feasibility for a new website. University websites are incredibly complex, and it's difficult to find a CMS that adheres to a DRY (don't repeat yourself) paradigm. Looking at the documentation, I'm unable to ascertain whether it's possible to store content simply as "data" and reuse it throughout the site...even a multisite installation...without having to copy it.

For example, let's say that within "catalog.university.edu" there are a series of YAML files, each one corresponding to a specific degree. The fields dictate the name of the degree, the department that houses it, and even the course sequence. Then, within "specificdepartment.university.edu" I may want to provide a list of degrees within that department as part of a modular page, with each link displaying the SAME content from the catalog site, but within the template of the department site. Therefore, whenever I edit the single YAML file for the degree, the changes are immediately seen wherever the content is referenced.

Is this type of content reusability possible? I'm imagi ning that, conceptually, it would involve somehow using a variable to symbolize the specific call for the correct degrees, and then some kind of url routing to pull the correct content once a degree link is clicked, but I may be hoping for something too complex or odd here.

10 years ago

In multisite, every site has its own folder with pages, configuration, etc. You could have a "common" site with a "common" pages folder, and have symbolic links from every site you have to that folder. This way, if a common page is edited in a site, the changes are propagated across all sites. Same could be for the theme etc. Being all folders, symlinks are the easiest thing to "simulate" a sync.

10 years ago

I love symlinks :) They allow for such elegant solutions.

10 years ago

Wow. I would have racked my brain over this for so long and never considered symlinks. Thank you!

Suggested topics

Topic Participants Replies Views Activity
Archive · by Deleted User, 9 years ago
0 1355 9 years ago
Archive · by Muut Archive, 9 years ago
2 935 9 years ago
Archive · by Muut Archive, 9 years ago
2 4065 9 years ago
Archive · by Muut Archive, 9 years ago
1 2953 9 years ago
Archive · by Muut Archive, 9 years ago
3 1119 9 years ago