Gabi Posted March 26, 2013 Share Posted March 26, 2013 Hi there, I started to convert a HTML template in a ProcessWire site and so far I'm delighted (I'm a MODx refugee also). Right now, my main problem is a psychological one: when I think "page" I see a rectangular piece of paper not doing much . Anyway, I created a checkboxes Page field like here and although weird at first, I already see some of the benefits for doing it that way. I wonder how to make the checkboxes checked when I edit a page using a template containing those checkboxes. My searches on this forum had no results. Best regards, Gabi 2 Link to comment Share on other sites More sharing options...
Pete Posted March 26, 2013 Share Posted March 26, 2013 Wow, that must be one of my first ever posts on the forums you've found there I know a little bit more about ProcessWire now Are you talking about editing a page with those checkboxes on, checking one of the boxes then saving the page and editing it later? If so the relevant box should be checked when you go back and edit the page, but I don't think that's what you mean. Link to comment Share on other sites More sharing options...
Gabi Posted March 27, 2013 Author Share Posted March 27, 2013 LOL, we're almost two years later, don't "I know a little bit more" me. You may make it look like it is difficult to learn . I was searching for a way to have the checkboxes checked by default instead of checking them manually, because their initial state is OFF/not checked. I needed that for a way to exclude certain pages from the navigation. Although I chose another route now (based on templates' group tags and/or template names), it would still be nice to know the answer. Link to comment Share on other sites More sharing options...
ryan Posted March 27, 2013 Share Posted March 27, 2013 Checkboxes can't be checked by default. This is to ensure you use scalable conventions in creating and maintaining your site. For instance, if you added a checkbox to an existing site that already had thousands of pages, and made the default "checked", then that would only apply to newly created pages from there … all of your thousands of existing pages would still be unchecked. Confusion, problems, and potentially a whole lot of work ensues. Whereas if you use checkboxes to toggle a non-default behavior, that is much more scalable and predictable. Link to comment Share on other sites More sharing options...
Pete Posted March 28, 2013 Share Posted March 28, 2013 LOL, we're almost two years later, don't "I know a little bit more" me. You may make it look like it is difficult to learn . Good point! Okay, so I know a lot more but didn't want to boast. I think the biggest hurdle I found when moving from MODx was un-learning the ways of doing things in that system and learning the way of doing things in ProcessWire (some of which seem odd to begin with, but genius when you get going with them). Back to your checkboxes, the way to do it is like ryan said and hopefully you can re-word the label to be the opposite as long as it still makes sense with the new label? Link to comment Share on other sites More sharing options...
Gabi Posted March 31, 2013 Author Share Posted March 31, 2013 Sure, Pete, I can name the checkbox "hidden from menus" and turn the logic around, no biggie. And Ryan, thank you for letting me know the reasoning behind this. 1 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