Jump to content

Create a field for selecting fields


enricob
 Share

Recommended Posts

Hi all,

I am trying to create a page field type that let the user choose a field among the list of the all the fields (to clarify: the list of fields under Setup > Fields), but I cannot make it work.

I tried this:

I created the field, I set the type to "Page", I went to Input tab and changed the attribute "Parent of selectable page (s)" : here I select "Home > Admin > Setup > Fields".

The problem is if I go to the page the new field is there but the dropdown is empty, there are not values in it.

Why? Is it because core pages like templates or fields are hidden by default?

Any help is appreciated. Thank you!

Link to comment
Share on other sites

adrian, you are a machine! Do you sleep?   :)

haha :)

Well to be honest, that hack of hani's module was about as easy as it gets - literally just a find/replace of "template" with "field" and it works :)

I am actually wondering if FieldtypeModules, FieldtypeTemplates, and now FieldtypeFields should become one module so that we can have one codebase to maintain, but the dev can choose whether modules, templates, or fields are what is available for selection. Of course this option would have to be from the field settings, and not the module config settings so it could be on a field by field basis. Do any users of FieldtypeModules or FieldtypeTemplates have any thoughts on this?

  • Like 5
Link to comment
Share on other sites

I am actually wondering if FieldtypeModules, FieldtypeTemplates, and now FieldtypeFields should become one module so that we can have one codebase to maintain, but the dev can choose whether modules, templates, or fields are what is available for selection. Of course this option would have to be from the field settings, and not the module config settings so it could be on a field by field basis. Do any users of FieldtypeModules or FieldtypeTemplates have any thoughts on this?

I'd support that. Just drys out the process. Especially if you need more than one type.

  • Like 3
Link to comment
Share on other sites

I actually believe separate modules is way to go. FieldtypeModules has quite a bit configuration already, bundling fields and templates there would make things complex where they doesn't need to be.

Also what would that field be called? FieldtypeNotPageRelation? :)

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...