0
votes

I want to add some settings which the admin of the site can change.

First idea came to my mind is to create an N2 page called settings, and every property of this page is single setting, and each time I need to get the settings I have to search for the first N2 page of the type Settings.

The problem with this approach is that I can't control how many Settings page the admin can add, and may be he added more than one.

So another idea came to my mind. Create an independent controller and a class called settings and have a corresponding database table.

Does anyone have better ideas?

3

3 Answers

0
votes

I think your second idea might be best - a custom controller and table. That is if the 'settings' are not related to N2 itself. If they are, then I guess that N2 probably offers a way to do that.

But if the settings you'd like to offer to your user isn't related to how N2 works, then I wouldn't worry about it, and just create an independent controller, class and corresponding database table.

1
votes

Add properties on the start page. You'll always have only one start page.

0
votes

I would go with Settings tab on Root page. Benefits - you can get it in no time via N2.Find.Root, and it will apply to all start pages you might have. Please note that in latest recommended setup of N2, there is one StartPage per language, so your site settings should be definitely above these, applying to all language branches.

IMHO, separate table would be overkill for reasonable amount of settings.