I should preface all this by saying that this is my first ContentBox site. I used to do CMS Stuff with Farcry CMS a while back and I’ve used Coldbox for years on an admin toolkit mainly for MVC and Wirebox including ORM. So, I haven’t dug that deep into ContentBox stuff yet.
In my case, I don’t think a full parent-child relationship would be needed. To me that implies that we’d inherit more than content, but also layouts, theme settings, site settings, etc. I want to keep the sites separate still. They will have similar but different layouts, so if we use the same theme, I’ll make sure to have the ability to override a bunch of it in the theme settings.
I think what I was thinking more than anything is some kind of site-level categorization. For example, if Site 1 has an About Us page and a Contact Us page and Site 2 also has those, but the About Us is different, I don’t want to display both, just the relevant one, but Contact Us could be the same on both. So, using a site level selection, I would select Site 1 and create both the About Us and Contact Us pages. Then on the sidebar, we’d have related data similar to categories:
Site Selection
Site 1 would be pre-selected and probably grayed out because the page is being created on site 1 so obviously it would be available there. However, for the Contact Us page, I would also check “Site 2” indicating that 1 page is available on both. But then, in Site 2, I have to create that About Us page since it’s unique and then maybe I want a Gallery page. That would get created under Site 2 so would only be available there. So for the Menu:
Site 1:
Home | About Us | Contact Us
Site 2:
Home | About Us | Contact Us (from Site 1) | Gallery
Some gotchas right off would be anything looking at file system paths, for media, Content Store items, etc. If Contact Us had a nice image on the top, that image is stored in the content for Site 1 since that’s where it was created, but when you are on Site 2, it’s looking for that content in Site 2’s folders. That would need to be amended to allow for the site where the content item was created (if that’s not already what it does). And the root menu generation would have to stop using the siteID for which site you are on, but a combination of the siteID you are on and the site selection.
This is the part of the change that I’m lease familiar with because it’s all deep in the ContentBox code and I don’t know what changes might affect what other things. Plus, I don’t want to change core code if I can change it because then upgrades will be painful.
My initial thought right now is to create categories for each site and then in the header for the theme, I can change the default call to rootMenu to something like this:
<cfset pageService = application.wirebox.getInstance(“pageService@contentbox”) />
<cfset args = {
excludes = “”,
type = “data”,
typeClass = “”,
separator = “”,
levels = “2”,
elementClass = “”,
parentClass = “parent”,
activeClass = “active”
} />
<cfset args.pageRecords = pageService.findPublishedContent(
parent : “”,
category : “Site 2”,
showInMenu: true,
properties: “contentID,slug,title,numberOfChildren”,
sortOrder : “order ASC, publishedDate ASC”
) />
<cfset menuData = cb.buildMenu( argumentCollection = args ) />
(buildMenu in CBHelper.cfc has to be made public for this)
Then most of my changes are just localized to my theme and I can manipulate the data how I need. I was just hoping for something more built-in that I could leverage.