8000 How does localization work in mixcore? · mixcore · Discussion #683 · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

How does localization work in mixcore? #683

Answered by truongtphat
teocto asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @teocto,

For page: yourdomain/specificulture/abc
For post: you can use this code to get posts by specificulture on razor file

@inject MixCmsContext context
@inject MixCacheService cacheService
@inject IMixCmsService cmsService
@{
    var culture = ViewData["culture"] as string;
    var postRepo = PostContentViewModel.GetRootRepository(context, cacheService);
    var posts = await postRepo.GetPagingAsync(m => m.MixTenantId == cmsService.GetCurrentTenant().Id && m.Specificulture == culture, new PagingModel()
            {
                SortBy = "CreatedDateTime",
                SortDirection = SortDirection.Desc,
                PageSize = 3,
                PageIndex = 0
            });

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by Smilefounder
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants
0