Skip to content

Commit

Permalink
Merge pull request #36 from Kentico/feat/improve_support_for_page_urls
Browse files Browse the repository at this point in the history
Support for page urls improvements
  • Loading branch information
michalJakubis authored Jul 24, 2024
2 parents ddf9748 + d8f5078 commit 45e6b76
Show file tree
Hide file tree
Showing 10 changed files with 1,164 additions and 1,088 deletions.
6 changes: 4 additions & 2 deletions docs/Model/ContentItemSimplifiedModel.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Model [discriminator](../UmtModel.md#discriminator): `ContentItemSimplified`

|PropertyName|Summary|.NET Type|Notes|
|---|---|---|---|
|PageUrls||Kentico.Xperience.UMT.Model.PageUrlModel[]||
|PageUrls|PageUrlModel item is required for each content language that exist in XbyK instance without regards to created LanguageData (urls are pre-created for non-existing language versions)|Kentico.Xperience.UMT.Model.PageUrlModel[]||
|PageGuid|Required only if page needs to be referenced as a parent by any child page|System.Guid?||
|ParentGuid||System.Guid?||
|TreePath||string?||
Expand All @@ -44,11 +44,13 @@ Model [discriminator](../UmtModel.md#discriminator): `ContentItemSimplified`
<p>*) value is required</p>

## PageUrlModel
Defines url for web page item


|PropertyName|Summary|.NET Type|Notes|
|---|---|---|---|
|UrlPath||string?||
|PathIsDraft||bool?||
|PathIsDraft|currently unused, until simplified model supports Draft content items (and not only Published or InitialDraft)|bool?||
|LanguageName||string?||

<p>*) value is required</p>
Expand Down
17 changes: 15 additions & 2 deletions docs/Model/ContentLanguageModel.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Model [discriminator](../UmtModel.md#discriminator): `ContentLanguage`
<p>*) value is required</p>


### ContentLanguage Sample
### ContentLanguage Sample - English US
This sample describes how to create content language for English (United States)
```json
{
Expand All @@ -30,7 +30,7 @@ This sample describes how to create content language for English (United States)
}
```

### ContentLanguage Sample
### ContentLanguage Sample - English UK
This sample describes how to create content language for English (United Kingdom)
```json
{
Expand All @@ -42,3 +42,16 @@ This sample describes how to create content language for English (United Kingdom
"ContentLanguageCultureFormat": "en-GB"
}
```

### ContentLanguage Sample - English US
This sample describes how to create content language for English (United States)
```json
{
"$type": "ContentLanguage",
"ContentLanguageGUID": "f454e93b-5fe9-42a9-b1af-b572234ed9c4",
"ContentLanguageDisplayName": "English (United States)",
"ContentLanguageName": "en-US",
"ContentLanguageIsDefault": false,
"ContentLanguageCultureFormat": "en-US"
}
```
27 changes: 23 additions & 4 deletions docs/Samples/basic.json
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,15 @@
"ContentLanguageFallbackContentLanguageGuid": null,
"ContentLanguageCultureFormat": "en-GB"
},
{
"$type": "ContentLanguage",
"ContentLanguageGUID": "4c80c6dd-a5c2-443d-873a-e9c328024b7c",
"ContentLanguageDisplayName": "Spanish",
"ContentLanguageName": "es",
"ContentLanguageIsDefault": false,
"ContentLanguageFallbackContentLanguageGuid": null,
"ContentLanguageCultureFormat": "es"
},
{
"$type": "Channel",
"ChannelDisplayName": "email Channel Example",
Expand Down Expand Up @@ -896,13 +905,18 @@
"PageUrls": [
{
"UrlPath": "en-us/simplified-sample",
"PathIsDraft": false,
"PathIsDraft": null,
"LanguageName": "en-US"
},
{
"UrlPath": "en-gb/simplified-sample",
"PathIsDraft": false,
"PathIsDraft": null,
"LanguageName": "en-GB"
},
{
"UrlPath": "es/simplified-sample",
"PathIsDraft": null,
"LanguageName": "es"
}
],
"PageGuid": "4ea03de4-977e-48aa-9340-babf3d23bafa",
Expand Down Expand Up @@ -954,13 +968,18 @@
"PageUrls": [
{
"UrlPath": "en-us/simplified-sample/sub-page",
"PathIsDraft": false,
"PathIsDraft": null,
"LanguageName": "en-US"
},
{
"UrlPath": "en-gb/simplified-sample/sub-page",
"PathIsDraft": false,
"PathIsDraft": null,
"LanguageName": "en-GB"
},
{
"UrlPath": "es/simplified-sample/sub-page",
"PathIsDraft": null,
"LanguageName": "es"
}
],
"PageGuid": null,
Expand Down
2,033 changes: 1,026 additions & 1,007 deletions examples/Kentico.Xperience.UMT.Example.Console/SampleJson.cs

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions examples/Kentico.Xperience.UMT.Examples/SampleProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ public static List<IUmtModel> GetFullSample()
UserSamples.SampleAdministrator,
ContentLanguageSamples.SampleContentLanguageEnUs,
ContentLanguageSamples.SampleContentLanguageEnGb,
ContentLanguageSamples.SampleContentLanguageEs,

ChannelSamples.SampleChannelForEmailChannel,
ChannelSamples.SampleChannelForWebSiteChannel,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,17 @@ public static class ContentItemSimplifiedSamples
new()
{
UrlPath = "en-us/simplified-sample",
PathIsDraft = false,
LanguageName = ContentLanguageSamples.SampleContentLanguageEnUs.ContentLanguageName!
},
new()
{
UrlPath = "en-gb/simplified-sample",
PathIsDraft = false,
LanguageName = ContentLanguageSamples.SampleContentLanguageEnGb.ContentLanguageName!
},
new()
{
UrlPath = "es/simplified-sample",
LanguageName = ContentLanguageSamples.SampleContentLanguageEs.ContentLanguageName!
}
]
},
Expand Down Expand Up @@ -107,14 +110,17 @@ public static class ContentItemSimplifiedSamples
new()
{
UrlPath = "en-us/simplified-sample/sub-page",
PathIsDraft = false,
LanguageName = ContentLanguageSamples.SampleContentLanguageEnUs.ContentLanguageName!
},
new()
{
UrlPath = "en-gb/simplified-sample/sub-page",
PathIsDraft = false,
LanguageName = ContentLanguageSamples.SampleContentLanguageEnGb.ContentLanguageName!
},
new()
{
UrlPath = "es/simplified-sample/sub-page",
LanguageName = ContentLanguageSamples.SampleContentLanguageEs.ContentLanguageName!
}
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ public static class ContentLanguageSamples
{
public static readonly Guid CONTENT_LANGUAGE_ENUS_SAMPLE_GUID = new Guid("F454E93B-5FE9-42A9-B1AF-B572234ED9C4");
public static readonly Guid CONTENT_LANGUAGE_ENGB_SAMPLE_GUID = new Guid("A6C0A558-8B33-47B6-87A8-491B437C9923");
public static readonly Guid CONTENT_LANGUAGE_ES_SAMPLE_GUID = new Guid("4C80C6DD-A5C2-443D-873A-E9C328024B7C");

[Sample("contentlanguage.sample.en-us", "This sample describes how to create content language for English (United States)", "ContentLanguage Sample")]
[Sample("contentlanguage.sample.en-us", "This sample describes how to create content language for English (United States)", "ContentLanguage Sample - English US")]
public static ContentLanguageModel SampleContentLanguageEnUs => new()
{
ContentLanguageCultureFormat = "en-US",
Expand All @@ -18,7 +19,7 @@ public static class ContentLanguageSamples
ContentLanguageName = "en-US"
};

[Sample("contentlanguage.sample.en-gb", "This sample describes how to create content language for English (United Kingdom)", "ContentLanguage Sample")]
[Sample("contentlanguage.sample.en-gb", "This sample describes how to create content language for English (United Kingdom)", "ContentLanguage Sample - English UK")]
public static ContentLanguageModel SampleContentLanguageEnGb => new()
{
ContentLanguageCultureFormat = "en-GB",
Expand All @@ -28,4 +29,14 @@ public static class ContentLanguageSamples
ContentLanguageIsDefault = false,
ContentLanguageName = "en-GB"
};

[Sample("contentlanguage.sample.es", "This sample describes how to create content language for Spanish", "ContentLanguage Sample - Spanish")]
public static ContentLanguageModel SampleContentLanguageEs => new()
{
ContentLanguageCultureFormat = "es",
ContentLanguageDisplayName = "Spanish",
ContentLanguageGUID = CONTENT_LANGUAGE_ES_SAMPLE_GUID,
ContentLanguageIsDefault = false,
ContentLanguageName = "es"
};
}
Loading

0 comments on commit 45e6b76

Please sign in to comment.