Nested Relation Controllers issue

Hi,

I have a question regarding the new October CMS 3.6 Nested Relation controller.

I’m particularly interested in its compatibility with multisite functionality.

  1. How would I manage/set it up to function across multiple sites if I create a country, then create a city within that country, ensuring that the city is created in all sites (across all languages)?
  2. Additionally, what happens if I delete a city in one site? Can I configure it to be deleted across every site (in every language)?

Thank you for your assistance.

Best regards, Zsolt

Hey @ngyzsolt

Take a look at the multisite trait docs: Traits - October CMS - 3.x

If the city uses the multisite trait, then when the propagatableSync mode is enabled, then the city will be created across all sites.

This happens by default when propagatableSync is used, when a record is deleted for one site, it will be deleted for all sites.

I hope this helps.

1 Like

Thank you for your answer,

Am I able to use $propagatableSync in Tailor blueprints?

If yes, what about if records are created already, and me as a developer I add the propagatableSync just now? If my client delete a record in one site, it will be deleted in other sites as well?

Thank you,
Zsolt

In most cases: yes. When sync is turned off, you can still create synchronized records manually, and the user interface will prompt you with: A record does not exist; create one? At this point, the two records will become linked as if they were synced.

If you create the two records independently, then there is no such linkage, and they won’t be deleted since there is no way to know they are connected.

1 Like

Am I able to use $propagatableSync in Tailor blueprints?

Thank you,
Zsolt

Am I able to use $propagatableSync in Tailor blueprints?

Thank you,
Zsolt

Hi @daft ,

Am I able to use propagatableSync in Tailor blueprints?

Thank you,
Zsolt

I attach the blueprints:

I have the gallery blueprint:

handle: Camps\Gallery
type: structure
name: Gallery
drafts: false
multisite: sync

structure:
    maxDepth: 1

# primaryNavigation:
#     label: Structure
#     icon: icon-tree
#     order: 140

navigation:
    icon: icon-file-image-o
    parent: Camps\Camp
    order: 20

fields:
    category:
        tab: General
        label: Category
        commentAbove: Select Category
        type: entries
        source: Camps\GalleryCategory
        maxItems: 1
        span: left
        validation: required
        translatable: false
    
    short_description:
        label: Short description
        type: text
        span: full
        validation: required|string
        tab: General

    cover_image:
        label: Cover Image
        type: fileupload
        mode: image
        fileTypes: jpg,jpeg
        mimeTypes: jpg,jpeg
        maxFilesize: 4
        maxFiles: 1
        commentAbove: 'kell a comment meg'
        span: left
        tab: General
        validaiton: required
        translatable: false

    highlights:
        label: Highlights
        type: fileupload
        mode: image
        fileTypes: jpg,jpeg
        mimeTypes: jpg,jpeg
        maxFilesize: 3
        commentAbove: 'Format: JPG, JPEG. Size: max 3MB. Dimension: fullhd'
        span: adaptive
        required: 1
        tab: Highlights
        validation: required
        translatable: false

    collections:
        tab: Collections
        label: Collections
        # commentAbove: Select one if related to a Project
        toolbarButtons: create|delete
        type: entries
        displayMode: controller
        source: Camp\GalleryCollection
        span: adaptive
        translatable: false

then I have the collection blueprint:

handle: Camp\GalleryCollection
type: entry
name: Entry
drafts: false
multisite: sync
navigation: false
propagatableSync: true

fields:
    title:
        hidden: true

    year:
        label: Year
        type: dropdown
        size: small
        options: Yuppi\Helpers\options\GalleryCollectionYearOptions::getYearOptions
        validation: required
        translatable: false

    images:
        label: Images
        type: fileupload
        mode: image
        fileTypes: jpg,jpeg
        mimeTypes: jpg,jpeg
        maxFilesize: 3
        commentAbove: 'Format: JPG, JPEG. Size: max 3MB. Dimension: fullhd'
        span: full
        translatable: false

And when I create a collection for a gallery, does not create in all sites. And I expect like to be created the collection in all sites, and will be deleted in all sites if I delete a collection.

Am I doing something wrong? Because if I create a collection in a gallery, does not create in all sites.

Thank your for the help,
Zsolt

Code looks good, are you on the latest version?

Yes, I use 3.6.10 version

image

And does not create the collection in all site. Only in the current site.

I tried to create new menu in Demo theme.

Blueprints looks like below. I just added multisite: all and propagatableSync: true in

uuid: 85e471d2-09b9-4f3d-a63b-1ae9d92d2879
handle: Site\Menus
type: entry
name: Menu
drafts: false
pagefinder: false
multisite: all
propagatableSync: true

customMessages:
    buttonCreate: New Menu

navigation:
    label: Menus
    icon: icon-sitemap
    order: 300

fields:
    slug:
        label: Code
        column:
            label: Code
            invisible: false
        validation:
            - required
    items:
        label: Menu Item
        type: nesteditems
        span: adaptive
        maxDepth: 0
        customMessages:
            buttonCreate: Add Item
            titleCreateForm: Create Item
            titleUpdateForm: Edit Item
        form:
            fields:
                title:
                    label: Title
                    tab: Reference
                    default: New Menu Item
                    span: full
                    type: text
                    validation:
                        - required

                reference:
                    label: Reference
                    type: pagefinder
                    tab: Reference
            tabs:
                fields:
                    _menu_item:
                        type: mixin
                        source: Fields\MenuItem

uuid: 936f26c0-b816-4c78-afaa-0b6977e80213
handle: Fields\MenuItem
type: mixin
name: Menu Item
multisite: all
propagatableSync: true

fields:
    is_hidden:
        label: Hidden
        comment: Hide this menu item from appearing on the website.
        type: checkbox
        tab: Display

    code:
        label: Code
        comment: Enter the menu item code if you want to access it with the API.
        tab: Attributes
        span: auto
        type: text
        preset:
            field: title
            type: slug

    css_class:
        label: CSS Class
        comment: Enter a CSS class name to give this menu item a custom appearance.
        tab: Attributes
        span: auto
        type: text

    is_external:
        label: External Link
        comment: Open links for this menu item in a new window.
        tab: Attributes
        type: checkbox

    priority:
        label: Priority
        commentAbove: The priority of this URL relative to other URLs on your site.
        tab: Sitemap
        type: radio
        column: false
        inlineOptions: true
        options:
            '0.1': '0.1'
            '0.2': '0.2'
            '0.3': '0.3'
            '0.4': '0.4'
            '0.5': '0.5'
            '0.6': '0.6'
            '0.7': '0.7'
            '0.8': '0.8'
            '0.9': '0.9'
            '1.0': '1.0'

    changefreq:
        commentAbove: How frequently the page is likely to change.
        label: Change Frequency
        tab: Sitemap
        type: radio
        column: false
        inlineOptions: true
        options:
            always: Always
            hourly: Hourly
            daily: Daily
            weekly: Weekly
            monthly: Monthly
            yearly: Yearly
            never: Never

    nesting:
        label: Include nested items
        shortLabel: Nesting
        comment: Nested items could be generated dynamically by supported page references.
        type: checkbox
        tab: Reference
        column: false

    replace:
        label: Replace this item with its generated children
        comment: Use this checkbox to push generated menu items to the same level with this item. This item itself will be hidden.
        type: checkbox
        tab: Reference
        column: false
        scope: false
        trigger:
            action: disable|empty
            field: nesting
            condition: unchecked

And menu_item does not created in all sites, only in current site. Menu is created, but menu_items does not.

I cant find why.

Thank you,
Zsolt

It looks like it could be a bug, and related to this topic:

Oh, okay. I also noticed that it has already been reported to the helpdesk.

Thank you for taking the time to address this. I really appreciate it.

Kind regards,
Zsolt

Yes, let’s move the conversation to this topic as well.

I will lock this one for now since it is getting too large.

1 Like