Problem/Motivation

As I understand right now Media view modes are actually obsolte with rift. But for some cases it makes sense to use rift as an image formater inside view modes. For example to embedd images via CKEditor. Also if you want to extend the media entity with descriptions etc.

Proposed resolution

Lets create an image field formatter which actually is doing the same thing as reference formatter. What do you think?

Issue fork rift-3535046

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

christian.wiedemann created an issue. See original summary.

christian.wiedemann’s picture

Title: Embedding rift images via CKEditor. » Embedding rift images via CKEditor - or how to use rift inside the media entity.
d34dman’s picture

Right now this is not supported via UI.

However inside media template. You can use rift_picture Twig Function.

Example in media.html.twig, you can do something as follows.

{%
    set classes = [
    'media',
    'media--type-' ~ media.bundle()|clean_class,
    not media.isPublished() ? 'media--unpublished',
    view_mode ? 'media--view-mode-' ~ view_mode|clean_class,
]
%}
<div{{ attributes.addClass(classes) }}>
    {{ title_suffix.contextual_links }}
    {% if content %}
        {{ media|rift_picture('rift_view_mode_name') }}
        {{ content }}
    {% endif %}
</div>

christian.wiedemann’s picture

Status: Active » Needs review
d34dman’s picture

d34dman’s picture

Status: Needs review » Needs work
d34dman’s picture

Parent issue: » #3540394: Roadmap for 2.0.0
christian.wiedemann’s picture

heyho nice wishes from munich. I rebased and added the abstract to the class.

christian.wiedemann’s picture

Status: Needs work » Needs review
d34dman’s picture

Status: Needs review » Fixed

Thanks @christian.wiedemann am merging this in. I forgot to copy the commit message properly which ended up not liking the commits to this issue queue. This is in 2.x-dev. (Ref: https://git.drupalcode.org/project/rift/-/commit/ca848e1ab9ecc08c8a85d7a...)

Now that this issue is closed, please review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, please credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.