Jump to content

diogo

Moderators
  • Posts

    4,314
  • Joined

  • Last visited

  • Days Won

    80

Everything posted by diogo

  1. Great to know Marc, but be aware that I don't consider this even nearly production ready. Did you try the first or the second version?
  2. hm? I think simply with $page->datetime edit: just define output to none
  3. Nikola, try this one (needs the DEV branch of PW because it uses render($filename)). Create a new template (can be named "customAdmin" for example) and put this on the template file: <?php $page->process = "ProcessAdminCustomPages2"; require($config->paths->adminTemplates . 'controller.php'); Create two fields and put them in the template: "render_file" (text field) "scripts_and_styles" (text area) Now, if you create a page under admin and assign this template to it, you can specify a file to render the page. To load scripts and styles add all the urls in each line (this is still a bit rough). To add custom fields to the page, just create a new template without file, and specify "customAdmin" as the alternate template filename. Use this one instead of the "customAdmin". Add the "render_file" field to it and, optionally the "scripts_and_styles" field. This version doesn't have configuration options
  4. Ryan, can I propose that the ProcessHome class has this public function ___execute() { $this->session->redirect($this->page->child->url); } instead of this? public function ___execute() { $this->session->redirect("page/"); }
  5. You can use the built in search in the admin. Just make sure to use "name" instead of "title body" in "Search in field(s):"
  6. No, completely different approach
  7. Create custom admin pages easily without having to build a Process Module especially for that. ☞ This module makes it easy to create simple admin pages but you can also create them in much more powerfull way without the need of a module. Have a look at this post written by Bernhard Baumrock to know how it's done https://processwire.com/blog/posts/building-custom-admin-pages-with-process-modules/ ------- I just updated the module, I kind of merged the two versions and now it works with both stable and dev versions of PW. Only difference is that with the stable version you still need to create the child pages and with dev version that is not needed. The instructions are on Github. Enjoy ---- Download or clone from Github https://github.com/ocorreiododiogo/pw-admin-custom-pages Module page is here http://modules.processwire.com/modules/process-admin-custom-pages/
  8. can you replace the entire tinymce module folder for a new one? Just for the case that something was not copied.
  9. This looks nice! http://learnlayout.com/ And it does end with listing some frameworks, although they state:
  10. Just want to notice how a question about layout became a discussion about frameworks. I rest my case
  11. diogo

    MariaDB

    This might be obvious since MariaDB should be totally compatible with mySQL, but just wanted to say that everything seems to be working fine with running pw with it after doing some selector tests.
  12. I'm posting this here, but I this problem maybe goes beyond the module itself. While using the selector test I was having some "Trying to get property of non-object" errors. I manage to track it down to, every time the selector test retrieves pages with an empty, single-page, radio field on their templates. I modified the radio to multiple, and the error stopped. I don't get the error while using the same selectors in the frontend, so It's some property that is being called on the fields inside the foreach made by the selectors test. To reproduce the error: Create a page field and set it to single page (choose whatever template or parent to populate it). Add it to a template. Create a page with that template without selecting any option for the page field. Go to Selector test and test for a selector that would retrieve that page.
  13. http://fourkitchens.com/blog/2013/04/24/one-less-jpg
  14. Yes to both questions
  15. I don't think that would be an easy task but you can rest assured that Ryan took very good measures to keep the PW folders as secure as they can be.
  16. @kongondo, for me there is a big difference between a php framework and a css framework, but this is maybe because I am a designer, and although I worry about the server side, the website design is my ultimate goal. Anyway, php is hidden, and if a framework gives you enough flexibility to achieve what you want while removing a lot of work from you, that's great! PW gives us exactly that, but honestly, I couldn't care less about how I achieve things in php, I just want things to work, and have a professional looking backend for my clients. As a designer, the frontend is what I'm selling to my clients and where I really want to make a difference. I don't want to start designing thinking of an imposed grid. I want to use a grid if it fits my design, but not to use it if it doesn't. Of course I keep some snippets of code, but I don't get too attached to them because every time I need to do something someone came up with an even nicer solution already, and it really doesn't take much time to look for things when you need. As for jQuery, I wouldn' also compare it with css frameworks, because it has more to do with how you write javascript then what you do with it. IMO the fair comparison would be with be with jQuery UI for instance. Anyway, I'm glad the frameworks are there, and that they make things easier when you need, I just don't think that it is possible that you choose one and become really good at it without becoming somehow dependent on the tool and without it influencing and limiting your designs. In the end, all comes to what you want to offer with your work, and I'm not saying that some choices are more valid than others.
  17. Maybe it would be interesting to submit pw to the webmatrix gallery. I'm not sure what would be needed to run on a windows server, but here is how to package and apply to be in the gallery http://www.iis.net/learn/develop/windows-web-application-gallery/package-an-application-for-the-windows-web-application-gallery
  18. I may have a completely wrong idea about frameworks, but I really enjoy building my websites from a blank state. It doesn't take much time to prepare a custom layout base from scratch, and it helps my design process that I'm completely naked of limitations. I just design, and leave the problem solving for later... I came to the conclusion the you can do everything you want, if not with css, then by adding some javascript. So, to answer the original questions: I have a different approach to each site, depending on what I came up on the design fase.
  19. You will still see the page if you are logged in as super user. Logout or access that url in the browser's private mode to check if it's visible to general public. For maintenance, besides Pete's module check also these tips of mine http://processwire.com/talk/topic/3324-maintenance-mode-message/?p=32769 http://processwire.com/talk/topic/2475-quick-tip-for-testing-on-live-website/
  20. If you have few variations of sort you could do it with a switch statement: switch ($get) { case "name DESC": $sort = -name; break; case "name ASC": $sort = -name; break; // and so on... } If there are more variations you can automate it like this: $sort = explode(" ", $get); $order = $sort[1] == "DESC" ? "-" : "" ; $value = $sort[0]; $pages->find("template=basic-page, limit=10, sort=$order$value");
  21. I don't have a clue about the answer, but you can post this here for sure. That's what the dev talk forum is here for!
  22. Sorry that you got no answer. I'm glad that you managed to solve it by yourself. Is this a multiple image field? Because I would expect it to be single. Anyway, for multiple images fields this has been recommended: if ($this->user->avatar->count() > 0) { But I think it would be better just to give limit 1 in the avatar field settings. -- What does this do? Is it only checking if the segment is a valid name? Didn't you mean to check it against the user name or something like that? $this->sanitizer->name($this->input->urlSegment2) == $user->name
  23. Find a regexp that matches comments and script tags and remove them with preg_replace() from all the bodytext fields. If you already imported everything to PW, you could do something like: foreach($mypages as $p){ $p->of(true); $p->body = preg_replace($pattern_for_script_tags,'', $p->body); $p->body = preg_replace($pattern_for_html_comments,'', $p->body); $p->save() }
×
×
  • Create New...