Open jaliao opened 4 years ago
/cc @jptissot
how about this? or tell me where is the source code?
thanks
it should not reorder the data if I remember correctly. Code is here : https://github.com/OrchardCMS/OrchardCore/blob/6cddd9f9904ff117ba82587f39fc76f49fac3cc3/src/OrchardCore.Modules/OrchardCore.ContentLocalization/Liquid/ContentLocalizationFilter.cs#L35
OK. Let me check.
Maybe look at this template as well:
@jptissot it's the same with Liquid
one more question
what's this? Castle.Proxies.DisplayLocalizationSetContentPickerFieldViewModelProxy
this is my code
<!-- slider begin CarouselBanner-Banner {{ Model.Content.CarouselBanner-Banner }} -->
<section>
{% assign PlaySpeed = Model.ContentItem.Content.CarouselBanner.PlaySpeed.Value %}
{% assign Autoplay = Model.ContentItem.Content.CarouselBanner.Autoplay.Value %}
<div id="bv-carousel" class="bv-carousel slick" data-autoplay-speed="{{ PlaySpeed }}" data-autoplay="{{ Autoplay }}">
{{ Model.Content.CarouselBanner-Banner | shape_render }}
</div>
</section>
<!-- slider end -->
and output is
<!-- LocalizationSets : 4dr4ccmff1p99xc1ehp811xrd4 -->
<!-- contentItems : Home Page Key Visual 20200414 -->
<!-- slider begin CarouselBanner-Banner Castle.Proxies.DisplayLocalizationSetContentPickerFieldViewModelProxy -->
<section>
<div id="bv-carousel" class="bv-carousel slick" data-autoplay-speed="4000" data-autoplay="true">
<!-- CSHTML -->
<!-- LocalizationSets : {{ Model.LocalizationSets }} -->
<!-- contentItems : {{ contentItems }} -->
<!--
DisplayMode : Image
BannerData : /media/0_HOME/0_Carousel/kv3.png
BannerURL :
BannerTitle : Key visual 3
BannerContent :
-->
<div class="slide">
<div class="slide-img" title="" style="background-image: url(/media/0_HOME/0_Carousel/kv3.png)"></div>
<a href="" class="bv-carousel-caption">
<h1 class="title">Key visual 3</h1>
<div class="summary"></div>
</a>
</div>
<!--
DisplayMode : Image
BannerData : /media/0_HOME/0_Carousel/kv2.jpg
BannerURL :
BannerTitle : Key visual 2
BannerContent :
-->
<div class="slide">
<div class="slide-img" title="" style="background-image: url(/media/0_HOME/0_Carousel/kv2.jpg)"></div>
<a href="" class="bv-carousel-caption">
<h1 class="title">Key visual 2</h1>
<div class="summary"></div>
</a>
</div>
<!--
DisplayMode : Vedio
BannerData : /media/0_HOME/0_Carousel/brand-film.mp4
BannerURL : /en-us/life_style
BannerTitle : Key visual 4
BannerContent :
-->
<div class="slide video">
<div class="slide-video">
<video autoplay loop playsinline muted="muted">
<source src="/media/0_HOME/0_Carousel/brand-film.mp4" type="video/mp4">
</video>
</div>
<a href="/en-us/life_style" class="bv-carousel-caption">
<h1 class="title">Key visual 4</h1>
<div class="summary"></div>
</a>
</div>
<!--
DisplayMode : Image
BannerData : /media/0_HOME/0_Carousel/kv1.jpg
BannerURL : /en-us/life_style
BannerTitle : Key visual 1
BannerContent :
-->
<div class="slide">
<div class="slide-img" title="" style="background-image: url(/media/0_HOME/0_Carousel/kv1.jpg)"></div>
<a href="/en-us/life_style" class="bv-carousel-caption">
<h1 class="title">Key visual 1</h1>
<div class="summary"></div>
</a>
</div>
</div>
</section>
<!-- slider end -->
Maybe look at this template as well:
and i use this template the output is the same
<!-- slider begin CarouselBanner-Banner Castle.Proxies.DisplayLocalizationSetContentPickerFieldViewModelProxy -->
--
| <section>
| <div id="bv-carousel" class="bv-carousel slick" data-autoplay-speed="4000" data-autoplay="true">
|
|
|
| <div class="field field-type-localizationsetpickerfield field-name-carousel-banner-banner">
| <span class="name">Banner:</span>
| <span class="value"><a display-for="Key visual 3">Key visual 3</a></span>
| <span>,</span>
| <span class="value"><a display-for="Key visual 2">Key visual 2</a></span>
| <span>,</span>
| <span class="value"><a display-for="Key visual 4">Key visual 4</a></span>
| <span>,</span>
| <span class="value"><a display-for="Key visual 1">Key visual 1</a></span>
| </div>
| </div>
| </section>
| <!-- slider end -->
It always the same order, no matter how i re-order them.
Finally, Back to use this ContentPickerField.
Which version of OC are you using ?
<ItemGroup>
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.10.8" />
<PackageReference Include="OrchardCore.Application.Cms.Targets" Version="1.0.0-rc1-12815" />
<PackageReference Include="OrchardCore.Logging.NLog" Version="1.0.0-rc1-12815" />
</ItemGroup>
can you try to use the latest version on MyGet?
sorry. seem can't work. I will create a new demo project and share with you when I finished my project.
I can give you admin password, if you need.
Sure, let me know, i'd like to see
give me your email this is mine "justin.liao@outlook.com"
An issue about LocalizationSetContentPickerField. I create a content type named CarouselBanner. This Content Type have a LocalizationSetContentPickerField named Banner.
so I create a Liquid file CarouselBanner-LocalizationSetContentPickerField.liquid
I add two content and output as bellow
These two record's LocalizationSets value are difference. means Model.LocalizationSets are difference in these two records But i try to output contentItems are the same data in there two records.
does the Liquid filter localization_set re-Order the data? or how to write this code.
Best regards, Justin