Jump to content

kongondo

PW-Moderators
  • Posts

    7,379
  • Joined

  • Last visited

  • Days Won

    139

Everything posted by kongondo

  1. Saml, Thanks for sharing! You can edit the thread title as the thread starter ...Just click on edit, and choose 'more reply options', then use 'full editor' or something along those lines... Edit: You have a typo on your website's menu "room and princing" For such a nice hotel, they should consider getting a corporate email address
  2. You don't want to sanitize the password - you may end up changing someone's password! Instead, validate it against some rules you've set (most likely using Regex) - e.g. password length, allowed characters, etc....and alert user if it doesn't validate... Read more here: https://processwire.com/talk/topic/3543-register-users-and-add-page-same-as-username/?p=35151 https://processwire.com/talk/topic/5629-why-no-password-sanitization/
  3. @Horst, I use a similar approach in Google. If I remember some keywords from the post, I add them to the query including the names of people I knew commented... I use the omni bar if I know I have bookmarked something - shows my bookmarks... or use the extension searchmarks.
  4. Thanks Diogo! I like to search site:processwire.com rather than just the forums since there's some tutorials, instructions, examples, etc on the main site as well. Searching this way includes the forums as well, of course. However, in some cases, where I know something is in the forums, I search site:processwire.com/talk. Nice if you could add that, ta!
  5. I use a mixture of both - oops! I have come to love concatenating though. Using a text editor with syntax highlighting like ST, I can clearly see what is a string and what is a variable, unlike variables within curly braces within a string; these get the same colour as the string.
  6. If you just want to add a different colour to the module itself: https://processwire.com/talk/topic/4650-new-processwire-admin-theme-on-dev-branch/?p=54479 If you want to completely change the theme: Key word is 'module'. The new admin theme is a module. You should be able to copy the module, change its name (including the class name), install it as a normal module (/site/modules/) - and change the CSS (even HTML) as you wish
  7. I could also post all my PW bookmarks but that would probably break the forums! So, I leave you with my all time favourite treasure trove (OK, so they are not part of the forums but everything hinges on this) The PW API docs: http://processwire.com/api/ (especially $page, $pages, selectors and the cheatsheet)... Sorry if I am repeating myself!
  8. https://processwire.com/talk/topic/4173-grouped-forum-posts-links-articles-tutorials-code-snippets/
  9. Max, glad you got it sorted. Just wanted to point out that this head.inc/footer.inc being the PW way is a common misconception . That is not the PW way; there is no PW way . This is a source of joy for some (the-have-my-cake-and-eat-it-too crowd) and a source of frustration/confusion for others, especially those used to a CMS telling them how to do things (Joomla, WordPress, anyone?). In PW, different people use different approaches according to preference, practicality, etc. Hey, if you wanted, you could even have one massive HTML file with all the markup you need and keep on duplicating that across different template files with only slight modifications. Not very practical (and a lot of unnecessary work on your part) but it would work. The Blog Profile, the Skyscrapers Profile and the default install are good examples of various approaches. But the definitive post on different approaches are in this classic thread.
  10. Many times we miss the simple and obvious solutions right in front of our face; elegant solution Craig!
  11. Welcome to PW Michael! Hmm, you are right. Looks like you've found a bug? For output it works fine - time can be set to none...but not for input
  12. Charles, Soma's code above was just an example of how you can use the API to build a form, not a firm recommendation of how forms should be built. By all means, go ahead and build a normal HTML form, style it as you wish . PW will not get in your way at all. As someone new to PW, I'd encourage you to (atm) stay away from such advanced code and instead focus on the basics of PW. Later, once comfortable with the API, you can have a go at using more advanced features of the API. Once you've built your HTML form (or whichever other way you do it), the 3 vital things you need to do/think about are: 1. Where is the form input sent? - this needs to be a PHP file server side, waiting for that form button to be pressed 2. Grabbing and SANITIZING (am not shouting; just emphasising ) the data sent by the form 3. Doing something with the SANITIZED values - typically you will want to save them to a database. In between, there are other things like client-side validation of the form, form submission feedback, etc. Validation will also be done via 'sanitizing'. For #2, read the below thoroughly: http://processwire.com/api/variables/input/ http://processwire.com/api/variables/sanitizer/ Get your head round that first - it is probably the most important of the above 3. Clicking a form submit button is easy; what to do afterwards is the main work... Hope this helps!
  13. @Adrian, Yeah, but I'll need to get those tutorials at some point...
  14. Ah, Max, people, you embarrass me! Seriously though, thanks for the comments. This was my one-hit-wonder . There were days when you typed 'kongondo' in Google it would suggest 'Wayfinder'. I think this is because it had been downloaded so many times. I stopped counting when downloads hit 10,000. Even so, I still get PMs from the MODx forums - people asking me for help with Wayfinder! OK, enough chest thumping! @Max, it looks nice bound like that. I never got round to making one for myself. @Teppo: The reasons why the guide was 'massive' were: Detailed explanations about HTML, CSS, some MODx concepts, Wayfinder, code examples, etc plus I talk too much! It took me the better part of 6 months to finish! (IIRC)....The Susan mentioned above expressed similar sentiments to yours. @Adrian: As for a similar thing for PW, I don't know. But yes, PW is much easier. Everything is in the API! I think the alternative I have taken is to write tutorials instead.....if I can find the time for my website! . @Soma, you are partly to blame, hehe! . Your modules, code in the forums and in your Gists have inspired me to love and learn PW and PHP more and more...so very little time for tutorials Cheers
  15. But you can enforce that easily with the radio buttons (also similar to when changing a page's template in PW). If they do not select a radio button and click save, then you could pop-up a modal saying "you must select a minor or major" version before save. The page would not save until they did since no $post would be sent
  16. Pete, If I get you correctly, there's various approaches to this: Bind the save button event using jQuery to maybe return the dreaded false! Disable the save button similar to how PW disables page delete until you confirm by selecting the checkbox (the move to trash button). In your case, for selecting major or minor, I would use radio buttons instead. If you don't have to use a modal, could be like the drop down box used in Batcher actions. I think #2 is easiest. If I trace the code in PW that achieves that I'll post here. Edit: The more I think about this, the more I think a modal is not the better approach. Depending on the level of activity of the editors, opening a modal every time I want to save a record simply to click other buttons (minor/major) would eventually get on my nerves. I think I'd go for radio buttons + disable save combo....Having said that, I've been using modals myself About saving the incremented hidden fields, are those hidden fields part of the form? If they are, they will be sent in the $post even if hidden. I'm probably not getting that bit. If not, I would probably append them to the form as the page is rendered (jQuery?). Just thinking out loud here...
  17. @everfreecreative My bad; I didn't look at the whole code...
  18. Ah. I see. Doing it that way means the scripts are being loaded from a module. There can be various pitfalls/gotchas if you take this approach. As someone new to PW, I'd stick with loading my own scripts and css as per the example I showed you
  19. One way....if calling PHP within HTML... Note: there is no slash before 'scripts'. ProcessWire will add that <script src="<?php echo $config->urls->templates;?>scripts/fancybox/helpers/jquery.fancybox-thumbs.js"></script> Read about urls and paths here: http://processwire.com/api/variables/config/
  20. Tell me about it! I don't know what's happened to me but the last few days I have found CSS more difficult than even PHP! OK, I exaggerate, but maybe I am becoming more comfortable with PHP. Maybe PHP is more predictable and 'relatively easier' to debug. Maybe my CSS skills are just lousy. No matter, CSS has been driving me nuts the last few days....currently it tops my list of least favourite 'web languages' (if we can call it that)! I know it produces the beautiful web....but beauty comes at a cost <!-- Sorry to hijack your thread Nico.... -->
  21. @Charles....I see some MODx code left in there: [[~12]]. Won't output anything in PW . You need something like echo $page->url;
  22. Hmm...I can't actually remember, oops . I'll have to check my code and let you know...
  23. I think a discussion such as this one (I don't mean this topic but this posts) requires its own thread. Like Pete said, If this is an issue of what you want to hide and/or show in the Admin, PW, in various places and available API, already has various ways of limiting views. For example, the other day, Wanze showed us how the page tree can be hidden from view depending on 'role'. So, if we want this simplified in some module probably, we already have all the necessary tools. The main work (I say this naively) would be to unify these in some module. If we are interested in this, let's start a new thread and provide a list of the things we would like such a module to do in the one unified interface. I am writing this quickly - not sure I make sense
×
×
  • Create New...