Jump to content

kongondo

PW-Moderators
  • Posts

    7,487
  • Joined

  • Last visited

  • Days Won

    147

Everything posted by kongondo

  1. It works for me like this (just like yours) $checked = 1; $chx = $this->modules->get('InputfieldCheckbox'); $chx->attr('id+name', 'delete'); $chx->attr('checked', ($checked === 1 ? 'checked' : ''));//works also with simple == $chx->label = $this->_('Delete'); //more code then render... $m->attr('value', $chx->render());//$m = InputfieldMarkup //output <input type="checkbox" id="delete" name="delete" value="1" checked="checked"> If the checked attribute is blank (i.e. if it does not evaluate to 1) then checked attribute is not output in the resulting markup. Is that what is biting you? if your fname returning false? Edited: to add checking $checked variable; to show (newbies) the markup output
  2. Just to add (I feel like typing today!)... You don't need to create a module unless you want something portable (or cool! ). I had a feeling you wanted to hide your "themes" page from other users maybe...there you go, Joss gave you an answer... I must admit I was very tempted to quickly rustle up a PW-Zen-garden-like site to show you how easy it is to do what you requested ...
  3. Yeah, there's Mary and a number of others. Hopefully she'll find time to write some tuts. I "see" her here every now and then. I think she's really busy with clients and stuff.....
  4. I'm not sure I follow what you mean by being more scalable...I also don't get what you mean by admin config page. Are you talking about creating a module for this? One that can be configured in admin/modules/ like the admin themes in PW 2.4?
  5. Hey Max! Welcome to PW...Nice to see you in these neck of the woods! I hope you find PW to your satisfaction... . Like with all systems, you will need to know the basics of PW in order to use it, which means getting to know the very basics of the PW API and some (very limited) knowledge of PHP to get you started (as I explain in the thread linked to above). I hope these don't put you off. We (the forum) will also be here to help you every step of the way. Whatever you choose at the end of the day, it's nice to "see" you again and wishing all the best with your sites! Edit: Oh yes, PW is light and nimble - yes fast - very fast - and packs a very mean punch
  6. I'm answering this quickly without thinking this through properly..... Changing themes could mean either different HTML or different CSS or both....Whichever way, you can do it either manually (admin makes change) or automatically. Automated: Seasons start and end on specific months/dates. PHP can tell what time/date/month/year it is. Hence, the process can be automated. If it is just CSS, you can have a conditional in your template file that checks the date and includes the right CSS for that season, e.g. if month is June, include this CSS, else....blah blah. Or use a switch statement + offer a default. This is quite easy to do. But, someone will have to at least visit the website for the change to be effected (or you can automate with a cron job) Manually: There are a couple of ways of doing this manually. 1. Set up a single page reference field which will only allow selection of child pages from one parent page called, e.g. "seasons". "season" child pages would be, the seasons - "summer", "winter", "autumn", "spring" - or however many seasons you have . Select a season and save. In your template file, you could do several things, e.g. have a conditional or an include like this .....include....path/to/your/{$seasonpagefield} . css....as an example, where $seasonpagefield returns the name of the selected season child page (which matches the name of your CSS file). Or, if changing the markup too, you could include "summer.inc" or "spring.inc"...etc...you get the idea. 2. Use radio fields instead...The rest is the same..... If doing it manually, you could even even set up a script to send admin an email to remind them to change the theme when the season changes... Just some quick ideas but this should be very easy to do, I think....
  7. Let's just say "localhost" has bitten him once or twice before.... . It's somewhere here in the forums...
  8. No worries.....oh, you've given me a new name too @Teppo: I know what you are thinking......
  9. In your site config.php... Remove localhost from the array here $config->httpHosts But add yours like so... $config->httpHosts = array('domain.com', 'www.domain.com'); //Replace domain.com with the hostname(s) your site runs from. This is a new recommended security feature in PW2.4
  10. This sums it up for me...'nuff said!
  11. I'm not sure which bit ticked me off more: 1. Really...seriously? 2. All of PW is classes [OOP]. What does this mean -> 3. Please... And why would we want this?
  12. He obviously doesn't know what he's talking about....I did all I could to restrain myself from responding....
  13. https://processwire.com/talk/topic/3067-basic-website-tutorial/?p=58269
  14. Ah, now I see. Sorry, I didn't read your OP clearly and visit that website.
  15. @Diogo, That's what caribou said in his edit (top of the OP)....he changed to double quotes
  16. What do you mean exactly by a webapp? As for CRUD, are you talking about this in the frontend then? Are you talking about a members only type of site, where you have to log in to edit your own page. Are you talking a social network site?....CRUD is possible but difficult to give you a more concrete answer unless we know the use case.
  17. http://processwire.com/blogtest/tags/ http://mods.pw/2M
  18. What other CMS would that be? Just curious...or maybe you've already mentioned this and I missed it ...
  19. IDs are handled uniquely (as in Primary index) and incrementally (like in all other CMS)....once it's taken, poof! it's gone... ...don't worry too much about pretty IDs....the DB doesn't care
  20. Something like this could probably work.... $x = $pages->get(1412);//necessarily verbose - could have done this in foreach foreach ($x->myPageField as $f) { if ($f->name == 'example') {//set your condition $x->of(false); $x->myPageField->remove($f); $x->save(); } }
  21. Would that be the 100 tabs you have open at any one time...?
  22. That's what I said...that tutorial is not really what you want...it was a btw...Dynamic population of dropdown lists is another matter altogether which I haven't the faintest clue about (i.e. in the Admin) save for that it will require some Ajax.... Sorry, I can't be of help...
  23. Have a read here.... https://processwire.com/talk/topic/3579-tutorial-approaches-to-categorising-site-content/ It is not really what you want, but may answer questions about relating pages...
×
×
  • Create New...