-
EBT Blocks đź§±
-
EPT Paragraphs 🆕
-
Resources & Support
- Drupal Book
- Blog
- Case Studies
- Drupal Documentation
- JSON Drop API Documentation
- Forum
- What's New
- Download Drupal
- Contact
Extra Block Types (EBT) - New Layout Builder experienceâť—
Extra Block Types (EBT) - styled, customizable block types: Slideshows, Tabs, Cards, Accordions and many others. Built-in settings for background, DOM Box, javascript plugins. Experience the future of layout building today.
âť—Extra Paragraph Types (EPT) - New Paragraphs experience
Extra Paragraph Types (EPT) - analogical paragraph based set of modules.
GLightbox is a pure javascript lightbox (Colorbox alternative without jQuery)âť—
It can display images, iframes, inline content and videos with optional autoplay for YouTube, Vimeo and even self-hosted videos.
Scroll
How to get current revision in node translation?
19/02/2025, by Ivan
To get the current revision…
To get the current revision of a node translation in Drupal, you can use the
translation_revert_revision()function. This function takes two parameters: the first is the node object, and the second is the language code of the translation that you want to retrieve.Here's an example of how to use this function:
In this example, we first load the node object for the current node using the
\Drupal::routeMatch()->getParameter('node')function. We then use thegetTranslationLatestRevision()function to get the current revision for the translation of the node in the current language. Finally, we load the node revision object using theloadRevision()function and do something with it.Note that this code assumes that you have the Content Translation module enabled and that your node has translations available.