Skip to content
This repository has been archived by the owner on Jun 22, 2020. It is now read-only.

Render author using a view mode specific template #162

Open
wants to merge 9 commits into
base: 8.x-2.x
Choose a base branch
from
Open

Render author using a view mode specific template #162

wants to merge 9 commits into from

Conversation

freudenberg
Copy link

No description provided.

@chrfritsch chrfritsch changed the base branch from 8.x-1.x to hotfix/next November 21, 2016 11:50
@chrfritsch chrfritsch closed this Nov 21, 2016
@chrfritsch chrfritsch reopened this Nov 21, 2016
Copy link
Member

@chrfritsch chrfritsch left a comment

Choose a reason for hiding this comment

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

We need an update hook to install the view mode on existing sites. An example can be found in thunder_update_8006

@@ -0,0 +1 @@
<a>{{ content.field_forename|render|trim }} {{ content.field_surname|render|trim }}</a>
Copy link
Member

Choose a reason for hiding this comment

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

There are no field_forename and field_surname fields in Thunder. Please use just the username

@dbosen dbosen closed this Dec 2, 2016
@freudenberg
Copy link
Author

Why has this been closed? It's important.

@dbosen
Copy link
Member

dbosen commented Jan 11, 2017

This was an automatic close from github, when the base branch was merged, please reopen it against the 8.x-1.x branch.
As @chrfritsch already stated, we still need an update hook for this.

@chrfritsch chrfritsch changed the base branch from hotfix/next to master January 16, 2017 14:18
@chrfritsch chrfritsch reopened this Jan 16, 2017
@tjwelde tjwelde changed the base branch from master to 8.x-1.x January 31, 2017 14:42
@@ -0,0 +1 @@
<a>{{ user.displayName }}</a>
Copy link
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
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.

@tjwelde
Copy link
Contributor

tjwelde commented Jan 31, 2017

Another option would be to keep the user.displayName and implement a hook to modify it: https://api.drupal.org/api/drupal/core!modules!user!user.api.php/function/hook_user_format_name_alter/8.2.x

Copy link
Member

@dbosen dbosen left a comment

Choose a reason for hiding this comment

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

We need an update hook which imports the new configuration into the active configuration.
This should be done with 'config_update.config_update' service.
For examples on how to do this take a look here: https://github.com/BurdaMagazinOrg/thunder-distribution/blob/a84286911131c685173222378c79b7b59eb2e138/modules/thunder_media/thunder_media.install in function thunder_media_update_8102()

@dbosen dbosen changed the base branch from 8.x-1.x to develop February 2, 2017 11:59
@freudenberg
Copy link
Author

Please check the last commit.

@chrfritsch
Copy link
Member

There are Coding Style issues. You can see them in the travis log https://travis-ci.org/BurdaMagazinOrg/thunder-distribution/jobs/199575911

@dbosen dbosen changed the base branch from develop to 8.x-2.x April 4, 2018 11:23
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
4 participants