You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Hippo CMS控制台创建用户:自定义属性配置求助

How to Add Custom User Attributes in Hippo CMS

Got it, let's work through adding those custom user attributes in Hippo CMS—this is a super common customization once you need to go beyond the default fields, so I’ll walk you through every step clearly.

1. Define a Custom User Node Type

Hippo stores user data as JCR nodes, with the default user type being hipposys:user. We’ll create a custom node type that inherits from this base type, then add your project-specific properties (phone number, city, user type).

  • Create a new CND (Content Node Definition) file (e.g., custom-user.cnd) in your project’s repository-data/configuration/nodetypes directory.
  • Add this content to define your custom type and properties—replace the namespace with your project’s unique one:
    <custom = 'http://your-project-domain.com/custom/nt/1.0'>
    [custom:user] > hipposys:user
      orderable
      - custom:phoneNumber (string)  // Stores phone number
      - custom:city (string)         // Stores user's city
      - custom:userType (string) < 'admin', 'editor', 'viewer'  // Enforce allowed user types
    
  • Deploy this change—Hippo will recognize the new node type when the repository starts up.

2. Update the Console User Edit Form

Next, we need to make these custom fields visible in the CMS console’s user creation/edit interface.

  • Navigate to your CMS webapp’s configuration folder, usually src/main/resources/META-INF/hst-assembly/overrides.
  • Create or edit org.hippoecm.frontend.plugins.cms.admin.users.UserEditorPlugin.properties to add your fields to the form:
    # List fields in the order you want them to appear
    fields=hipposys:username,hipposys:password,hipposys:passwordConfirm,custom:phoneNumber,custom:city,custom:userType
    # Add human-readable labels for each custom field
    custom:phoneNumber.label=Phone Number
    custom:city.label=City
    custom:userType.label=User Type
    
  • Optional: Add validation rules (like requiring a phone number) by creating a UserEditorPluginValidation.xml file in the same directory:
    <validations>
      <validation property="custom:phoneNumber">
        <validator name="required"/>
        <validator name="regexp">
          <param name="regexp">^\+?[0-9\s\-]+$</param>
          <param name="message">Please enter a valid phone number (e.g., +1 555-123-4567)</param>
        </validator>
      </validation>
    </validations>
    

3. Set Permissions for Custom Properties

Make sure console users have the right access to read and write these new attributes.

  • Update your repository’s security config (either via the Console’s Security section or repository-data/configuration/security/users files) to grant read and write permissions for custom:* properties to roles like cms-admin.

4. Test the Customization

  • Restart your Hippo CMS instance.
  • Head to the CMS Console > Users & Groups > Create User. You should see your custom fields alongside the default username/password fields.
  • Fill out the form and save, then verify the data is stored correctly: Use the Console’s JCR Explorer to check /hipposys/users/[your-new-user]—you’ll see the custom properties listed there.

If you need to search users by phone number, city, or user type, update the search index config:

  • Edit repository-data/configuration/indexes/hipposys/index-definition.xml and add your custom properties to the user index:
    <indexes>
      <index name="users">
        <nodeType>hipposys:user</nodeType>
        <property name="custom:phoneNumber" type="string"/>
        <property name="custom:city" type="string"/>
        <property name="custom:userType" type="string"/>
      </index>
    </indexes>
    

That’s all! You should now be able to manage your project-specific user attributes without relying on Hippo’s default fields.

内容的提问来源于stack exchange,提问作者Gaurav Mulay

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.09 13:12:39