Coder Social home page Coder Social logo

Comments (5)

solverat avatar solverat commented on June 1, 2024 1

Good catch, I just pushed the correct examples. In your third example, the object_id: 123 would be ignored, since the entity property is stronger in i18n_create_context_by_entity which will then call the corresponding link generator!

from pimcore-i18n.

solverat avatar solverat commented on June 1, 2024

A twig helper would be the better way. Good one!

from pimcore-i18n.

solverat avatar solverat commented on June 1, 2024

I spent way too much time on this :). But now, this is possible on dev-master.

In case you're still interested: https://github.com/dachcom-digital/pimcore-i18n/blob/master/docs/21_CustomI18nContextLookUp.md

We refactored the complete I18n bootstrap for this, but I think it was worth the time. The workflow is much cleaner now.

Would love to hear some feedback before we're going to tag this.

from pimcore-i18n.

BlackbitDevs avatar BlackbitDevs commented on June 1, 2024

Love it!

The only thing I am wondering about:

{% set object_context = i18n_create_context_by_entity(pimcore_object(16), { _locale: 'en', object_id: 16 }) %}

Is there a difference to

{% set object_context = i18n_create_context_by_entity(pimcore_object(16), { _locale: 'en' }) %}

?

Or the other way around, what happens when doing

{% set object_context = i18n_create_context_by_entity(pimcore_object(16), { _locale: 'en', object_id: 123 }) %}

from pimcore-i18n.

BlackbitDevs avatar BlackbitDevs commented on June 1, 2024

Ok, sounds good to me. Big thanks for the effort!

from pimcore-i18n.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.