Exemple #1
0
        public override void RegisterDefinition(IContentRegistration <StartPage> register)
        {
            register.ControlledBy <Controllers.StartPageController>();

            register.Page(title: "Start Page", description: "The topmost node of a site. This can be placed below a language intersection to also represent a language");
            register.IconClass("n2-icon-globe");
            register.Definition.Installer = N2.Installation.InstallerHint.PreferredStartPage;
            register.RestrictParents(typeof(IRootPage), typeof(LanguageIntersection));

            using (register.RecursiveContainer("SiteContainer", headingFormat: null).Allow(Permission.Administer).Begin())
            {
                using (register.TabContainer(Defaults.Containers.Site, "Site").Begin())
                {
                    register.On(sp => sp.Theme).ThemeSelection().Configure(ets => ets.EnablePreview = true);
                    register.On(sp => sp.LanguageCode).Languages();
                    register.On(sp => sp.FooterText).FreeText("Footer text")
                    .WithTokens();
                    register.On(sp => sp.Logotype).ImageUpload();
                    register.On(sp => sp.HostName).Text("Site host name (DNS)")
                    .Help("Sets a host name for this site/language. The web server must be configured to accept this host name for this to work.");
                }
            }

            using (register.WithinContainer(Defaults.Containers.Metadata))
            {
                register.RegisterEditable(new WithEditableTemplateSelectionAttribute());
                register.On(sp => sp.Author).Meta();
                register.On(sp => sp.Keywords).Meta();
                register.On(sp => sp.Description).Meta();
            }
        }
Exemple #2
0
        public override void RegisterDefinition(IContentRegistration <FreeForm> register)
        {
            register.Part(title: "Free form",
                          description: "A form that can be sumitted and sent to an email address or viewed online.");

            register.ControlledBy <FreeFormController>();

            register.Definition.SortOrder = 250;
            register.Icon("{IconsUrl}/report.png");

            register.On(ff => ff.Form).FreeText("Form (with tokens)").Configure(eft =>
            {
                eft.HelpTitle = "This text supports tokens";
                eft.HelpText  =
                    "{{FormCheckbox}}, {{FormFile}}, {{FormInput}}, {{FormRadio}}, {{FormSelect}}, {{FormSubmit}}, {{FormTextarea}}";
            }).WithTokens();
            register.On(ff => ff.SubmitText).FreeText("Thank you text");

            using (register.FieldSetContainer("Email", "Email").Begin())
            {
                register.On(ff => ff.MailFrom).Text("Mail from").Placeholder("*****@*****.**");
                register.On(ff => ff.MailTo).Text("Mail to").Placeholder("*****@*****.**");
                register.On(ff => ff.MailSubject).Text("Mail subject").Placeholder("Mail title");
                register.On(ff => ff.MailBody).Text("Mail intro text").Placeholder("Mail text before form answers")
                .Configure(et => et.TextMode = TextBoxMode.MultiLine);
            }
        }