Hi, I'm wondering how to do the following:
- change labels on some fields (I just update the html file?)
- add fields that are already in the user table. Kurt, you mentioned this to me once. I want to use first name, last name, and username fields
- hide fields - I only want one or two fields in the Extended info tab
So, any ideas on if this is possible and how to do it?
Thanks John
- Labels are changed in settings.
- User data is in
__SELF__.user
variable in component. - Hiding fields - Edit partial by adding partial in CMS backend saved as "ExtendedInfo/extended-info.htm":
{% set epsettings = __SELF__.epsettings %}
<table>
<tr>
<td class="kurtjensen-profile-label">{{ epsettings.per_text_1.label }}: </td><td class="kurtjensen-profile-data"> {{ epsettings.per_text_1.value }}</td>
</tr>
</table>
{{ dump(epsettings) }}
{{ __SELF__.user.name }}
That should get you started.
Last updated
Hi, Kurt, thanks for your response and forgive my thickness, but...
- what settings? Where? I found httpdocs/plugins/kurtjensen/profile/models/settings/fields.yaml and edited the labels there but no effect on the form. Can't imagine it's a caching issue.
- Sorry, in which file do you mean? User data is there, and then what? I just want to show the surname field, for instance. It's in the user table but not defined on the first tab of the profile.
- Nope, that makes no sense to me either... "Edit partial by adding partial" And the settings won't be updated when I update the plugins? Even if I had any clue how to change the files. This is too confusing for me. I'll have to figure something else out. I'm just looking to do something simple here.
-
http://yourdomain.com/backend/system/settings/update/kurtjensen/profile/settings - in the Backend
- When you add the "ExtendedInfo" component to the page the user data is loaded and held in a variable so it can be output in the partial as:
{{ __SELF__.user.name }} {{ __SELF__.user.surname }}
- http://yourdomain.com/backend/cms - add a partial and save as "ExtendedInfo/extended-info.htm" See: https://octobercms.com/docs/cms/components#overriding-partials
Last updated
Amazingly enough, I got something working. I made a partial, a copy of both the display and update html files as such: /var/www/vhosts/site/httpdocs/themes/rainlab-vanilla/partials/ExtendedInfo/extendedupdate.htm /var/www/vhosts/site/httpdocs/themes/rainlab-vanilla/partials/ExtendedInfo/extended-info.htm
And on the display page, I just reference the component as such: {% component 'ExtendedInfo' %} and the component doesn't display, only the partial does. Great! But I only want one field to display from the extendedinfo component. What I really want is to rename, reorder, and hide some fields from the main user component. And I want both components merged together - not with 2 separate edit buttons. So, how do I rename, reorder, and hide some fields from the main user component? I tried the exact same thing as with the extendedInfo but it's not hiding the original component and showing the partial - it's ignoring the user partial when I use {% component 'MyInfo' %} . Any ideas? Many thanks in advance, John
1-6 of 6