-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for importing page aliases and external links #50
base: master
Are you sure you want to change the base?
Add support for importing page aliases and external links #50
Conversation
e459ddb
to
825d477
Compare
825d477
to
a48e779
Compare
1bcd6df
to
1bcafb4
Compare
This PR should be ready, it should be able to import a CIF like this: <?xml version="1.0" encoding="UTF-8"?>
<concrete5-cif version="1.0">
<pages>
<page name="Home" path="" public-date="2023-02-14 09:06:18" filename="" pagetype="page" template="full" user="admin" description="" package="" root="true">
<locale language="en" country="US"/>
<hreflang>
<alternate locale="fr_FR" path="/fr" />
<alternate locale="it_IT" path="/it" />
</hreflang>
<area name="Main">
<blocks>
<block type="content">
<style>
<borderWidth>2px</borderWidth>
<borderColor>rgba(255,0,0,1)</borderColor>
<borderStyle>solid</borderStyle>
<borderRadius>10px</borderRadius>
</style>
<data table="btContentLocal"><record><content>Content for page '/'</content></record></data>
</block>
</blocks>
</area>
</page>
<page name="Home IT" path="/it" user="admin" public-date="2025-01-16 16:00:22" filename="" pagetype="" template="full" description="" root="true" package="">
<locale language="it" country="IT"/>
<hreflang>
<alternate locale="en_US" path="/" />
<alternate locale="fr_FR" path="/fr" />
</hreflang>
<area name="Main">
<blocks>
<block type="content">
<style>
<borderWidth>2px</borderWidth>
<borderColor>rgba(255,0,0,1)</borderColor>
<borderStyle>solid</borderStyle>
<borderRadius>10px</borderRadius>
</style>
<data table="btContentLocal"><record><content>Content for page '/it'</content></record></data>
</block>
</blocks>
</area>
</page>
<page name="Home FR" path="/fr" user="admin" public-date="2024-11-07 13:37:00" template="full" root="true">
<locale language="fr" country="FR" />
<hreflang>
<alternate locale="en_US" path="/" />
<alternate locale="it_IT" path="/" />
</hreflang>
<area name="Main">
<blocks>
<block type="content">
<style>
<borderWidth>2px</borderWidth>
<borderColor>rgba(255,0,0,1)</borderColor>
<borderStyle>solid</borderStyle>
<borderRadius>10px</borderRadius>
</style>
<data table="btContentLocal"><record><content>Content for page '/fr'</content></record></data>
</block>
</blocks>
</area>
</page>
<page name="Example" path="/example" user="admin" public-date="2024-11-07 13:37:54" filename="" pagetype="page" template="full" package="">
<additional-path path="/test" />
<hreflang>
<alternate locale="fr_FR" path="/fr/exemple" />
</hreflang>
<area name="Main">
<blocks>
<block type="content">
<style>
<borderWidth>2px</borderWidth>
<borderColor>rgba(255,0,0,1)</borderColor>
<borderStyle>solid</borderStyle>
<borderRadius>10px</borderRadius>
</style>
<data table="btContentLocal"><record><content>Content for page '/example'</content></record></data>
</block>
</blocks>
</area>
</page>
<page name="Exemple" path="/fr/exemple" user="admin" public-date="2024-11-07 13:37:00" filename="" pagetype="page" template="full" package="">
<hreflang>
<alternate locale="en_US" path="/example" />
</hreflang>
<area name="Main">
<blocks>
<block type="content">
<style>
<borderWidth>2px</borderWidth>
<borderColor>rgba(255,0,0,1)</borderColor>
<borderStyle>solid</borderStyle>
<borderRadius>10px</borderRadius>
</style>
<data table="btContentLocal"><record><content>Content for page '/fr/exemple'</content></record></data>
</block>
</blocks>
</area>
</page>
<external-link name="External Link" path="/fr/go-out" destination="https://path.to/url?p1=one&p2=two" new-window="true" user="admin" public-date="2024-11-09 12:38:54" package="" />
<alias name="Alias Name" path="/fr/alias" original-path="/fr/exemple" user="admin" package="" />
<page name="/a/b" path="/a/b" user="admin" public-date="2024-11-07 13:37:00" pagetype="page" template="full" />
<alias name="/d" path="/d" original-path="/a/b" user="admin" />
<page name="/a" path="/a" user="admin" public-date="2024-11-07 13:37:00" pagetype="page" template="full" />
<page name="/d/e" path="/d/e" user="admin" public-date="2024-11-07 13:37:00" pagetype="page" template="full" />
</pages>
<stacks>
<folder name="Root Folder" path="/" />
<folder name="A/B Test" path="/Root Folder" />
<stack name="Stack Name" path="/Root Folder/A/B Test">
<area name="Main">
<blocks>
<block type="content">
<style>
<borderWidth>2px</borderWidth>
<borderColor>rgba(255,0,0,1)</borderColor>
<borderStyle>solid</borderStyle>
<borderRadius>10px</borderRadius>
</style>
<data table="btContentLocal"><record><content>Content for stack (neutral)</content></record></data>
</block>
</blocks>
</area>
</stack>
<stack name="Stack Name" path="/Root Folder/A/B Test" section="it_IT">
<area name="Main">
<blocks>
<block type="content" custom-template="my_custom_template">
<style>
<borderWidth>2px</borderWidth>
<borderColor>rgba(255,0,0,1)</borderColor>
<borderStyle>solid</borderStyle>
<borderRadius>10px</borderRadius>
</style>
<data table="btContentLocal"><record><content>Content for stack (it_IT)</content></record></data>
</block>
</blocks>
</area>
</stack>
</stacks>
</concrete5-cif> |
c83bae5
to
885b6b2
Compare
In this PR I added the new property/setting Here it is when creating a new import batch: And here it is when edining the basic details of an existing batch: Hovering the question marks, we have these tooltips: Why? When importing a page that's the root of a language, we need to create a new multilingual section (aka tree), and doing that under the Creating multilingual sections is also required in order to import the localized versions of stacks and global areas. By default, the setting is backward compatible, meaning that pages will be imported under the |
See concretecms/concretecms#12293 (comment)