Skip to content
This repository was archived by the owner on Jun 22, 2020. It is now read-only.
Open
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
langcode: en
status: true
dependencies:
module:
- user
id: user.facebook_instant_articles_rss
label: 'Facebook Instant Articles: RSS'
targetEntityType: user
cache: true
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<a>{{ user.displayName }}</a>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we use a new viewmode for the user, shouldn't we then also render the full user?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The problem is, that in the default configuration, the User entity doesn't have any name associated. Only a picture and "Member for" would be displayed.

Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,8 @@ function thunder_fia_preprocess_views_view_row_fia(&$variables) {
}
}

// Change author name to "firstname lastname".
$owner = $node->getOwner();
$variables['options']['author'] = array(
'#markup' => '<a>' . $owner->first_name->value . ' ' . $owner->last_name->value . '</a>',
);
$render_controller = \Drupal::entityTypeManager()->getViewBuilder($node->getOwner()->getEntityTypeId());
$variables['options']['author'] = $render_controller->view($node->getOwner(), 'facebook_instant_articles_rss', NULL);
}
}

Expand Down