Jump to content

tpr

Members
  • Posts

    2,321
  • Joined

  • Last visited

  • Days Won

    44

Everything posted by tpr

  1. This topic may help: https://processwire.com/talk/topic/3384-search-with-merged-pagearrays-pagination-not-working/?p=42994
  2. So your last query works ($newposts = ...), only pagination fails? What's your pagination code and how it fails exactly?
  3. Isn't your checkout page end with a slash? (yoursite.com/checkout/) If so, you may have a redirect so post values are lost (checkout -> checkout/), so you need to append a slash to the form action. Check it on the Dev Tools/Firebug Network tab.
  4. Nice! I wish I had modern projects like this. The only thing that bothers me is the big black frame, makes me feel "locked". But may it's just me.
  5. Wow, that's incredibly fast! Must be Wordpress
  6. Looks nice! It seems like a funny place to work: http://www.dojofuckingyeah.de/contact/ Btw, images on the bottom (JOBS section) have watermarks.
  7. Good tip, thanks. Just added the blog RSS to my feedreader. Another source of information is the ProcessWire Weekly news (by teppo), to which you can subscribe and get by email. Lurking around the forums is also beneficial.
  8. tpr

    Real estate site

    Nice catch, but no
  9. tpr

    Real estate site

    Nice Great job! Some parts are not that ugly. After all, adding a new skin is a minor thing compared to the whole development.
  10. Thanks for the site profile. This is golden! I will definitely try it in my next Bootstrap project (currently I'm more into Uikit).
  11. I usually listen to 90s dancefloor classics (DI.fm), and sometimes some Trance/Progressive channel, until it gets cheesy. If I feel like I need something harder I visit Gabber channel.
  12. Thanks, I will surely look into it, how you set up things. Now I'm fine with my current setup, until it works fine for me I'll use that. Perhaps Latte could be added to the implemented template engines in the future.
  13. Ok, a better solution: 1. _init.php: set new "$t" object to hold template variables 2. _main.php (set in config.php to automatically append): initialize Latte: require_once("../latte/latte.php"); require_once(__DIR__ . "/../latte/FakePresenter.php"); // (optional) auto-load default @layout.latte $presenter = new FakePresenter; $parameters = array( '_control' => $presenter, 'homepage' => $pages->get('/'), 'page' => $page, 'basePath' => rtrim($config->urls->root, '/'), 't' => $t ); $latte = new Latte\Engine; $latte->setTempDirectory('../cache-latte'); $latte->render('./views/' . $page->template . '.latte', $parameters);
  14. That's a good question, it bugged me all afternoon but I couldn't manage to get to my computer to check Apparently I added "require_once($page->template . '.php')" before rendering the template with Latte. The problem is that this way the template runs twice which is by far no optimal I guess I should I use an empty custom template file instead but I'm curious if this could be made without that.
  15. I was struggling to find an easy solution to templating and finally it seems I'm found the one that suits for me. The annoyances I have with the default PHP templating is string concatenation, too many php tags, quotes, etc. I was experimenting with output buffering and heredoc and though they worked, it felt a bit hackish. Installing a templating module would be another solution but I would have liked to avoid that if possible. I'm using Nette framework nowadays and its Latte templating system is very nice. Fortunately it can be used as a standalone component so I gave it a try, and I could make it work with minimum efforts. In short, it works this way: "_init.php" is autoloaded by PW so I initialize the Latte engine there. I'm adding a new "$t" object here to which later I can add properties that will be passed to the template file. PW loads default page template "basic-page.php" for example, so I use this file as a controller. It does nothing special, only adds extra variables the actual template needs. For example "$t->myPages = $pages->find(...)". "init.php" sets the current template file, which is named similarly to the $page->template, and loaded from the "views" subfolder: $latte->render('./views/' . $page->template . '.latte', $parameters); $parameters is an array of variables passed to the view file. It has $page and $t too I had to make a fake class to set the default "@layout.latte" layout file, so I don't need to set it in each view file (perhaps Latte will have this feature by default in the future) So far it works beautifully but of course the proof of the pudding is the eating. I feel I'm having the best of the two worlds
  16. Looks nice! I guess it's informative too but I can't understand a word in it Check the parent template's "Family" tab, there's a setting "Allowed template(s) for children" near the bottom.
  17. Nice! Dig the ladies & also the half-legged man in the middle
  18. I'm struggling with the same issue, whether to put 200-300 items in a select box or find a better solution. I may go with the selectbox but I'm thinking about implementing a lightbox where all the items are listed. Another solution could be Select2 (check the "Tagging support" example): https://select2.github.io/examples.html
  19. I would probably add a simple password protection (hpasswd for example).
  20. Thanks, great tips. I usually stop further optimizing when only "above the fold" issues left according to PageSpeed. Imo it doesn't worth the trouble. Recently I discovered http://fontello.com/ which allows subsetting icon fonts (plus picking icons from different fonts). This can be handy if you need only a few icons instead of the whole set, saving many kilobytes.
  21. Pretty awesome at first sight, and on afterwards too. I like the colors and the "big" feel. The effects are bit too much (I know that's their wish ).
  22. Thanks, I got it now. It was the Reno theme, it has to be installed first to use. Have to do some PW development soon to get back to PW basics
  23. Very nice, a must-have. Thanks! May I ask what admin theme was used on the screenshots? Looks pretty sharp but cannot find anywhere.
  24. tpr

    Search and Replace

    Replace in DB is not a way to go? Either with a query or using a dump.
  25. tpr

    Search and Replace

    Thanks, this can come in handy sometimes. Perhaps modifying hte searchReplace function to accept the search-replace words would be beneficial, like this: searchReplace($pages->get('/'), 'search_word', 'replacement_word'); Btw, your orignial searchReplace is missing one extra closing brackets I guess: searchReplace($pages->get('/'));
×
×
  • Create New...