1

I'm currently setting up a site. One routine operation there is to 1) create a category group and 2) create a 'Categories' field for it to attach to a section later.

Now for safety's sake I'm giving different handle names to the category group and the related field. For example, a category group has a handle called genre and the field — genre_field, just to ensure that no clashes between them would happen.

But is it actually a possible situation that handles of two different entities (here, fields and cat/groups, but it could be sections and fields as well and so on) could conflict?

2

No, having a field and a category group (or a section and a user group etc) share handles isn't dangerous at all.

Being specific and semantic with handles in general can be a huge boon for keeping things easily memorable and templates and other source code readable, though – so for example you might want to have handles like genre (for the category group) and selectedGenres (for the categories field), instead of both using genre. Though technically, both can be named genre, no worries.

| improve this answer | |
  • A thank you for a nice and clear answer from the grateful user of your Reasons plugin! – certainlyakey Aug 7 '16 at 16:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.