Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Aleksandr ┼ámailov 1 post 72 karma points
    Oct 03, 2019 @ 04:43
    Aleksandr Šmailov
    1

    How to publish only non-default language variant content?

    I'm using Umbraco 8.1.3 (same thing with 8.1.5).

    Steps:

    • Create Document Type
    • Enable vary by culture
    • Add 1 invariant property
    • Add 1 variant property (vary by culture enabled)
    • Set a default language (for example: en-US - English US)
    • Add additional language (for example: da - Danish)
    • Create content using newly created document type. Fill in invariant property in English tab and fill in variant property in Danish. Save and Publish only Danish content.

    If you now query content (for example in UmbracoApiController) using UmbracoHelper: Umbraco.Content(newContendId) and retrieve values from the properties, invariant property will be empty. If you query content using Services.ContentService and retrieve properties, invariant one will have only it's EditedValue set and the PublishedValue will be empty.

    Now, this all makes sense since the Umbraco explicitly mentions when creating non-default content variants that invariant properties are inherited from default language variant. I imagine this was a design decision.

    Essentially this means that we must create and publish Default language variant otherwise Non-default language variants will have some properties missing


    The problem is that in my custom application there should be no definition of a default language. Some content should be created only in Danish, some content only in English.

    Questions:

    1. Is it possible to achieve this in Umbraco 8?
    2. If not, is there a workaround?
Please Sign in or register to post replies

Write your reply to:

Draft