Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
So I have this filter in page view
Content translation: Language (= Current user's language)
and in Footer
Entity: Rendered entity ( node:354)
node:354 is on English, but It is also displayed on other languages.
There is no way to display some node only on one language?
Guessing then it is also not possible to have language appropriate node in Views Footer?
Comment | File | Size | Author |
---|---|---|---|
#12 | entity-views-area-translation-1744362-12.patch | 3.16 KB | pobster |
#10 | entity-views-area-translation-1744362-10.patch | 3.08 KB | pobster |
#9 | entity-views-area-translation-1744362-9.patch | 2.66 KB | pobster |
#4 | 1744362-4-entity-views-area-translation.patch | 2.63 KB | marcvangend |
Comments
Comment #1
couturier CreditAttribution: couturier commentedIs this person having your same problem? http://drupal.org/node/1744950
Comment #2
Marko B CreditAttribution: Marko B commentedNope, this is just a missing feature of Views how I described it, that could also be taken as bug.
Comment #3
dawehnerWell this entity is rendered by entity api, so views is somehow the wrong project.
As deepM said this is a feature request.
Comment #4
marcvangendHere is a patch to support translations for nodes. It adds a checkbox to the options form, so the user can choose to whether he wants to use the translation. When the entity is rendered, it will check if the option was enabled and if a translation is available. If so, the translation is loaded.
Thanks for reviewing and (hopefully) committing my patch.
Comment #5
lmeurs CreditAttribution: lmeurs commentedThanks marcvangend, the patch from #4 works great, though is based on an earlier version of the Entity API.
Main difference is in the
render_entity()
function where the newer version of the Entity API loads a single entity object usingentity_load_single()
instead of an array of entity objects usingentity_load()
.I manually applied this patch and am sorry I do not know how to generate a new diff file.
Comment #6
marcvangendThanks for the review, Laurens. Two minor updates have been released since I posted that patch, but it's good to hear the concept still works.
If you have git running on your development machine, this page contains all info you need to create a patch: https://drupal.org/project/entity/git-instructions.
Comment #7
lmeurs CreditAttribution: lmeurs commentedThank you for the info, will give it a try soon!
Comment #9
pobster CreditAttribution: pobster commentedUpdated for the single entity loading approach.
Thanks,
Pobster
Comment #10
pobster CreditAttribution: pobster commented...And if it's any use to anyone else, I've extended it further so that if there's no translation available then you can avoid the rendering completely. Note... This is inside the tnid if statement - so if shouldn't have any effect on non-translated nodes.
Thanks,
Pobster
Comment #11
pobster CreditAttribution: pobster commentedComment #12
pobster CreditAttribution: pobster commentedI figured if you were going to have an "obey language" button then it should work for source nodes which don't have translations too...
I think this is the last one, it doesn't make any sense tweaking this further.
Pobster
Comment #13
Chris Matthews CreditAttribution: Chris Matthews as a volunteer commentedThe 5 year old patch in #12 to entity_views_handler_area_entity.inc does not apply to the latest entity 7.x-1.x-dev and (if relevant) needs a reroll.
Comment #14
pobster CreditAttribution: pobster as a volunteer and at ArcadeGeek LTD for Rackspace commentedI think ... if it's been five years, then it probably isn't useful to anyone? Maybe this issue should be closed?
Comment #15
Chris Matthews CreditAttribution: Chris Matthews as a volunteer commentedComment #16
calbasiThis issue is still active and it's a real problem. Why it has not been commited when possible?
Possibly related with: 2289397