-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Display profile data on layouts #12
Comments
I believe this is not possible at the moment, as Profiles are custom entities. I'm pretty sure Layouts don't support custom entities as contexts, and therefore it's not possible to access their properties, or fields attached to them. I also need this feature for my own custom entities, so I will (at some point) try creating a contrib module to expose these. I'll keep you posted (or perhaps you beat me to it? :) |
Hi @oadaeh did you mean the whole profile as a block or individual fields from the Profile? We can expose Profiles as blocks using relationships, and could likely do same with Profile fields, but I'm feeling like exposing every Profile field might be a lot of fields blocks. Or maybe not. What would be most in demand though? |
@oadaeh, a workaround to show Profile fields in blocks is:
That will display that field from the main profile. If you have created other profile types, then you'll need to use All that thanks to the magic of Entity Tokens and Token Block! |
Version 1.1.1 of Profile has been released, which incorporates both patches in Step 1 above. With this release, the workaround described in the previous comment meets the need of this issue, but that approach (adding 3 contrib modules) is not at all obvious to the average user, so I'm wondering if we should add @argiepiano's prescription to the "Usage" section of this module's README. Thoughts? |
I had a branch that enables a Profile block in any layout with a User context. We could incorporate this or provide a separate module. Any thoughts? I had paused to ask the question above, which is do we want individual Profile fields or entire Profiles as a block (the latter is what I've got so far). |
Adding the entire Profile as a block would be a great addition (and for large profiles, much easier than lots of tokens). |
I've pushed the Profile block branch. To test create a layout for |
This looks great, @docwilmot - thanks for providing. I do have a suggestion: it would be helpful to add some configuration to the block, so that the user chooses which display mode to use for displaying the profile. And then use that option to build the view of the entity using To get a list of all defined view modes, you can use You can even consider letting the user choose between the default language or another installed language in the settings ui, and then pass that as the 3rd parameter of |
Good points |
Wow! You all carried on without me. I totally forgot I even created this issue. |
That commit was me incorrectly adding a 12, instead of a 20, to my branch name, comment, etc. for this issue instead of issue #20. |
Issue #12: Display profile data on layouts
Is it possible to add profile fields to a layout, and if so, how?
I've been playing with it for a few hours, even creating a LayoutRelationship handler, but the data only displays on the normal user page.
The text was updated successfully, but these errors were encountered: