Jump to content

Recommended Posts

Posted

Hi,

I am attempting to use the Multisite module to share Project content across three different sites. Here's how my pages structure is set up:

  • Home
    • Projects
      • project 1
      • project 2
      • project 3

      [*]www.site1.com

      • Site1 Category1
      • Site1 Category2

      [*]www.site2.com

      • Site2 Category1
      • Site2 Category2

      [*]www.site3.com

      • Site3 Category1
      • Site3 Category2

In my Project template, I have a page field for Category - which allows me to select multiple Categories (and sites). When viewing each site & category, the projects show up correctly... but I'm unsure how to link to the Project detail page and stay within the current site.

Does this approach make sense? Or is there a better way of structuring my pages to get this to work?

Posted

Not totally sure what you are looking for. Your page structure looks just fine for me. If I follow you correctly you choose categories from project page, and then you want to show those projects in different domains?

Something like this should work:

  1. Create a new template called "view_project"
  2. Add page called "project" under each your sites and give those pages a template "view_project"
  3. Allow urlSegments for your view_project template

And code that goes into your view_project template should be something like this (written in browser):

<?php
if ($input->urlSegment1) {
 $projectName = $sanitizer->pageName($input->urlSegment1);
 $project = $pages->get("parent=/projects/, name=$projectName");
 echo "<h1>$project->title</h1>";
 // Or just echo $project->render();
} else {
 echo "No project found";
}

And when linking to your projects you should use urls like these: www.site1.com/project/projectname/

  • Like 1
Posted

Does this approach make sense? Or is there a better way of structuring my pages to get this to work?

I would probably do it other way around: I would choose projects from categories. Usually I would do otherwise, but since your projects is just a "data reporsity" and categories are on different domains that would make more sense for me). But that is just a matter of preference.

  • Like 1
Posted

I would probably do it other way around: I would choose projects from categories. Usually I would do otherwise, but since your projects is just a "data reporsity" and categories are on different domains that would make more sense for me). But that is just a matter of preference.

Thanks apeisa, this makes a lot more sense - and will also let me set the display order of projects within each category. I appreciate your help on this, as well as your work on the module!

  • Like 1

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...