For field_collection_table I need to know if the item is being viewed standalone or as part of the parent entity.

Comments

tim.plunkett’s picture

Status: Active » Needs review
StatusFileSize
new1.01 KB

Attached.

damien tournoud’s picture

Status: Needs review » Needs work

See #1208864: Make the 'page' setting for entity view useful again. If it doesn't this module should use $page = TRUE when calling entity_view(). You will find a 'page' variable in the entity template.

tim.plunkett’s picture

field_collection doesn't call entity_view, but FieldCollectionItemEntity::view(), which doesn't implement EntityAPIControllerInterface, so it doesn't get to use $page?

I might have misread the other issue, but I'm certainly lost on this.

fago’s picture

Indeed, $page is missing for Entity::view(). See #1208864-9: Make the 'page' setting for entity view useful again.

Thus, we should make use of entity API's way to handle $page. As said you'll find the page boolean in your render array / template variables.

tim.plunkett’s picture

It's not 100% clear what needs to be done within this issue anymore. Even with the changes to Entity, view() is being called from field_collection with NO arguments, so I'm not sure what to pass to it.

Also, if the page boolean is present in hook_entity_view(), that's great, and this issue can be won't fixed.

fago’s picture

yep, we still need to call view() with the right $page argument.
Also we want to improve view() to support all view-modes the host-entity types have and by default use the same view-mode as the host, when shown on host-view. That's another issue though.

tim.plunkett’s picture

Status: Needs work » Needs review
StatusFileSize
new465 bytes

If we're pushing the view mode fixes to another issue (which I agree with), then I think this is all we need?

fago’s picture

Status: Needs review » Fixed

thanks, committed.

tim.plunkett’s picture

I don't see it here yet, did you push?
http://drupal.org/node/947174/commits

fago’s picture

yep, but a bit later. Sry for that.

Status: Fixed » Closed (fixed)

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