0

Kindly correct me if I'm wrong posting it here. But I just wanted an opinion with this implementation I have:

So, in Sitecore, we have multisite:

-Site1
-Site2
-Site3

And we have a separated node for all of the Functionality of a site. From each of the Functionality, we have a field called Visible to Site wherein a multiple choice of the sites (e.g. Site1, Site2, Site3) indicating into what sites this particular Functionality is available. Sometimes, a Site shares similar Functionality from other Sites. Hence, all that are under Shared folder. All in all, it looks like this:

-Site1
-Site2
-Site3
-Data
  - Functionality
    -Shared (this is a folder only)
      -IT
      -Sales
      -Management
    -Site2 (this is a folder only)
      -Construction
      -Games
      -Sales

BUT, noticed Sales under Site2 folder, this Sales have different content on it. (e.g. image). This is different to the Sales from Shared folder.

The Problem now based on this not so good current implementation is when we navigate Site2's Functionality Sales, it will be redirected to the Sales from the Shared folder because they have same name and Sitecore only renders the first one.

Proposed Solution

  1. I will add a template with a field called BasedFieldForItemResolve (lol too long) --> This field represents the name/id of the field that I can use. From my sample, I can use the field Visible to Site of the Functionality item. This template will be added as an inherited template of Functionality template.

  2. From my custom item resolver, I am checking the field BasedFieldForItemResolve if it has value. If there's no value, the item resolver will run as-is. But if it has a value, I will only get the item with the same value of the current context site

    var fieldForItemResolve = result.First().GetField("BasedFieldForItemResolve"); if(fieldForItemResolve != null && fieldForItemResolve.HasValue) { var siteRoot = Context.Database.GetItem(Context.Site.RootPath); if (siteRoot != null) { var filteredBySite = result.FirstOrDefault(x => new ID(x.Fields[fieldForItemResolve].ToString()) == siteRoot.ID); if (filteredBySite != null) Context.Item = Context.Database.GetItem(filteredBySite.ItemId); } }

If the BasedFieldForItemResolve is existing to the current item and the value of it is not null, I will get the value of it (and from the sample scenario, the value is Visible to Site)

My concern is regarding SEO, I'm wondering if it will be an issue

P.S. We are using Helix. The above structure was just an overview of the content tree. There are Data folders inside each sites and outside of them. The Data folder outside of the sites was made like that for reusability (I think that was the reason)

  • It sounds to me like you have some custom code doing all that. Out of the box, what you have described is not how Sitecore resolves items. If the Site definitions are setup correctly, it will not resolve a valid url from Site A to an item under Site B. You must have code in your implementation that is doing that. That is the code that needs fixing. – Richard Seal Oct 25 '19 at 12:39
  • Please take note that the Functionality items are outside Sites nodes. Here's the Path: sitecore/content/data – Tofu TheGreat Oct 25 '19 at 14:06
1

I don't think you are using Helix in your project. But if you want to still use the same structure. You can update your current architecture like this:

-Global
  -All the data that can be shared
-Site 1
  -Home
    -All the pages here
  -Data
    - Only data related to Site 1 here
  -Settings
    - Site related setting only
-Site 2
  -Home
    -All the pages here
  -Data
    - Only data related to Site 2 here
  -Settings
    - Site related setting only

There won't be any SEO impact using this structure as all the pages are under the Home item of the specific site. Under data, only content needs to be present.

  • We are using Helix. There are separate Data folders under each sites too. But There are Data folder outside of those sites also. This is to have a reusable content. (I believe that was the reason why the previous developer made it like this). Thank you for your point, but I don't think I can afford to move the functionality items on the individual sites. Too risky. And yes I think it is like this (for the functionality items) so that other sites can reuse it. – Tofu TheGreat Oct 25 '19 at 9:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.