Custom Page Type - Page name source field

Yang Wen asked on August 4, 2016 21:27

I'm creating a custom page type that describes a person. The idea is our content editors will create and manage a list of individuals via this custom page type.

In this page type, I have a field that is populated by a User Selector control. This will allow editor to select user from the cms.users table.

I want the page name source field to be User Selector field. However that doesn't seem to be possible in v8.1

As an alternative solution - Is it possible to set the default value (via macro) on the page type's name source field to match the User Selector field? If this is possible, then I imagine the default value on the name source field will have to be updated each time the User Selector field changes.

Correct Answer

Rui Wang answered on August 4, 2016 21:48

Hi Yang

I just did the test on my v8.1 and it is possible. To be able to map the field as the page name source field, make sure you check the field as "Required".

But the problem here is the User selector form control returns the user ID as the value, so you page name will be a number. Depend on how many user you have, you may want to use a Drop-Down List form control and use SQL query to query the cms.users table to generate the list. That way, you can use the first and last name as the value instead of the ID.

1 votesVote for this answer Unmark Correct answer

Recent Answers


Joshua Adams answered on August 4, 2016 21:36

You could try doing the username instead...obviously this isn't the best idea, but could fix your issue above. As long as usernames don't change, you shouldn't have a problem. Maybe do a dropdown list and sql query that pulls in the username field for the value.

1 votesVote for this answer Mark as a Correct answer

Yang Wen answered on August 4, 2016 21:45

I don't quite follow your suggested idea.

Now I'm looking into these flags on the field.. Has depending fields & Depends on another field.

These seem to do what I want.. but Kentico's documentation on them are poor.

0 votesVote for this answer Mark as a Correct answer

Yang Wen answered on August 4, 2016 21:51

Bingo! thanks!

0 votesVote for this answer Mark as a Correct answer

Yang Wen answered on August 9, 2016 00:03 (last edited on August 9, 2016 00:23)

Ok so I made required, then also set this field to be a dropdownlist that is populated by a SQL Query on the CMS_User table.

However I've realized that with close to 4000 rows in CMS_User, a dropdownlist is not user-friendly.

I've reverted back to using Kentico's User Selector form control. However this form control saves the UserID value to the row.

What I really need now is to create an accompanying computed field, that computes a value based on the value of the User Control field. Is it possible to configure a calculated/computed field to derive the FullName value for a given UserID value from another field?

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.