Robin S Posted June 26, 2017 Share Posted June 26, 2017 In a situation where you need some options for an inputfield and it's unlikely that any subfields will ever need to be added to those options, is there any reason to prefer a Page Reference field over an Options field or vice versa? I'm not concerned about the setup time for either (probably Options is a little faster but there's not a lot in it) - just if one is perhaps more performant than the other or there is some catch with one of them that isn't obvious at first. I've always used Page Reference fields so far. Link to comment Share on other sites More sharing options...
monchu Posted June 26, 2017 Share Posted June 26, 2017 I still prefer the Page Reference because the flexibility to get more values from the page itself 1 Link to comment Share on other sites More sharing options...
szabesz Posted June 26, 2017 Share Posted June 26, 2017 I think there are good examples when page references are overkill, such as simple form options (list of countries, list of contact types in a simple contact form, etc...) As a rule of thumb I use this reasoning: am I absolutely sure I do NOT WANT more than simple options? If in doubt, I use page references just to make things extendable in the future. 4 Link to comment Share on other sites More sharing options...
cstevensjr Posted June 26, 2017 Share Posted June 26, 2017 3 hours ago, szabesz said: As a rule of thumb I use this reasoning: am I absolutely sure I do NOT WANT more than simple options? If in doubt, I use page references just to make things extendable in the future. +1 2 Link to comment Share on other sites More sharing options...
Robin S Posted June 27, 2017 Author Share Posted June 27, 2017 Thanks for the replies. I remembered a downside of the Options fieldtype and that is awkwardness of adding selectable options to the field via the API: I think I will stick with Page Reference fields for the most part. Link to comment Share on other sites More sharing options...
Macrura Posted June 27, 2017 Share Posted June 27, 2017 i mainly use the options fieldtype for non relational type selects with huge numbers of options, such as countries, cities, states, and such where i just don't want those things showing up as pages.. 2 Link to comment Share on other sites More sharing options...
Robin S Posted June 27, 2017 Author Share Posted June 27, 2017 27 minutes ago, Macrura said: where i just don't want those things showing up as pages Yeah, when I first started working with pages simply as options for a Page Reference field I thought that their presence in the page tree might be confusing for editors, but nobody has ever mentioned it so I don't worry about it now. Another thing that probably works but that I haven't tried is storing such pages under the Admin branch of the tree. Does anyone do this and does it work okay? Link to comment Share on other sites More sharing options...
cstevensjr Posted June 27, 2017 Share Posted June 27, 2017 24 minutes ago, Robin S said: Yeah, when I first started working with pages simply as options for a Page Reference field I thought that their presence in the page tree might be confusing for editors, but nobody has ever mentioned it so I don't worry about it now. I normally store my page references in a section of the main website page tree. I give this section a name that contains the word "Configuration ". I also store the results of Page Tables in this section. 4 Link to comment Share on other sites More sharing options...
Robin S Posted June 27, 2017 Author Share Posted June 27, 2017 @cstevensjr, wow, I did not know that unpublishing a page had the effect that the page and its children are hidden to site editors. Great tip! Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now