blipson89 / Synthesis

Synthesis is a universal object mapper for Sitecore
MIT License
75 stars 25 forks source link

Multiple <sites> in the Helix model? #68

Closed bakgaard closed 6 years ago

bakgaard commented 6 years ago

Do you want to request a feature or report a bug? A bug, or my lack of understanding.

What is the current behavior? I setup a Helix project, and use the 8.3.0-RC01 NuGet package.

I created a patch to include which templates should be synchronized as such:

<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
    <sitecore>
        <synthesis>
            <providers>

                <!--Templates to include-->
                <templateInputProvider>
                    <includedPaths hints="list:AddTemplatePath">
                        <sites>/sitecore/Templates/Feature</sites>
                        <sites>/sitecore/Templates/Foundation</sites>
                        <sites>/sitecore/Templates/Project</sites>
                    </includedPaths>
                </templateInputProvider>

                <typeListProvider type="Synthesis.Configuration.ConfigurationTypeListProvider, Synthesis">
                    <assemblies hint="list:AddAssembly">
                        <DC>Marvel.*</DC>
                    </assemblies>
                </typeListProvider>

            </providers>
        </synthesis>
    </sitecore>
</configuration>

However, when I publish it, and check /sitecore/admin/showconfig.aspx I get the following lines:

<includedPaths hint="list:AddTemplatePath" hints="list:AddTemplatePath" patch:source="Synthesis.comic.config">
<sites patch:source="Synthesis.comic.config">/sitecore/Templates/Feature</sites>
</includedPaths>

The last two sites are not included.

I tried with the following setup , but that is not valid:

<sites>
  <site>1</site> 
  <site>2</site>
</sites>

How can I add the Helix structure?

What is the expected behavior? I had hoped multiple template folders could be included.

Please mention your Sitecore version and Synthesis version. Sitecore v. 9.0.171002, and Synthesis 8.3.0-RC01

kamsar commented 6 years ago

Use unique xml tag names for each include. It's a limitation of how Sitecore parses configs; they are being mashed together.

On Wed, Jan 3, 2018, 2:50 PM Rasmus Bækgaard notifications@github.com wrote:

Do you want to request a feature or report a bug? A bug, or my lack of understanding.

What is the current behavior? I setup a Helix project, and use the 8.3.0-RC01 NuGet package.

I created a patch to include which templates should be synchronized as such:

/sitecore/Templates/Feature /sitecore/Templates/Foundation /sitecore/Templates/Project Marvel.*

However, when I publish it, and check /sitecore/admin/showconfig.aspx I get the following lines:

/sitecore/Templates/Feature

The last two sites are not included.

I tried with the following setup , but that is not valid:

1 2

How can I add the Helix structure?

What is the expected behavior? I had hoped multiple template folders could be included.

Please mention your Sitecore version and Synthesis version. Sitecore v. 9.0.171002, and Synthesis 8.3.0-RC01

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/blipson89/Synthesis/issues/68, or mute the thread https://github.com/notifications/unsubscribe-auth/AAGU_WyGYkmddz8M1g4pyNoSv78HKFjnks5tHAQogaJpZM4RSXF7 .

rroman81 commented 6 years ago

Yep, exactly what @kamsar said. I used the following

...
<includedPaths hints="list:AddTemplatePath">
  <Feature>/sitecore/Templates/Feature</Feature>
  <Foundation>/sitecore/Templates/Foundation</Foundation>
  <Project>/sitecore/Templates/Project</Project>
</includedPaths>
...

Under typeListProvider, I separate each layer with a specific namespace prefix and thus use the same strategy.

bakgaard commented 6 years ago

Oh. That seems obvious in retrospective.

Thank you