Jump to content

arjen

Members
  • Posts

    1,222
  • Joined

  • Last visited

  • Days Won

    8

Everything posted by arjen

  1. These days I would handle this issue with CSS: div:nth-of-type(even) { } div:nth-of-type(odd) { } But since it took me a while to understand this modulus operator stuff I'll give you an example: <?php $i = 1; foreach($page->repeater_field as $repeater) { $i++; // 2, 3, 4, 5, etc echo '<div class="' . ($i % 2 == 0 ? "odd-item" : "even-item") . '">'; // % is the modulus operator echo '</div>'; }
  2. Netcarver beat me An alternative: <?php if ($page->matches('id!=1021|1105')) { echo 'do stuff'; }
  3. Hey Tim, There are several options: Install a module like Protected Mode or Maintenance Mode. This way bots won't crawl into your website since you have to be logged in. Use a robots.txt or the meta tags as you describe. I prefer option 1 since it's a matter of keeping everyone out except clients with an username and password. The disadvantage of option 2 is that you will have to remember to remove both when deploying to live.
  4. I understand your frustration. Especially dealing with default fields like SEO. You could build something around the ProFields? You can group field over there. You can create a Textareas of Table field which makes it a lot easier to handle grouping of fields.
  5. You can sort multiple like this: $page->children("featured=1, sort=title, sort=timeon");
  6. First off: listen to BitPoet You want a different templates folder all together? Try this to use different templates folder. (hint)
  7. Hi Zeka, Removing these lines and I got the module running on 3.0.x.
  8. Also try Autocomplete which only fetches the populated pages instead of the whole list. This speeds things up too.
  9. Your markup doesn't seem like proper Markdown formatted. # Image ![Alt description here](http://plauclair.me/site/assets/files/1772/logo_processwire-1.421x0-is-hidpi.png) Also be sure to have the Markdown module installed and assigned/applied to the field.
  10. Hi dlen, I don't know to which particular post you are referring too, but in general: this is why. See our PHP Coding Style Guide for more information.
  11. Hi Günter, Whether PHP, ProcessWire or English: just keep add it and you'll improve, no doubt.
  12. Also look into the template switch based on your subdomain by Raymond.
  13. You can halt() like this: <?php if ($config->ajax) { // Do your stuff here echo 'Heard It Through The Grapevine'; // Call halt() to prevent further loading return $this->halt(); }
  14. Hi justb3a, thanks for your effort. A simple like didn't feel sufficient enough. I use soma's new version on several sites and didn't even consider creating a readme. Great work. edit: and soma too offcourse for creating the new version
  15. Regarding this business: next to payments the best feeling in the world
  16. Glad you got it working. You could check if the config.json file still exists in your /site/assets/config/ folder. And be sure to remove this code from your /site/config.php.
  17. What if you disable the config module and just use the /site/config.php? Have you entered the domains in both? Also, you might want to check if ProcessWire (or PHP) is able to get the proper hostname. I had one case (on a shady server, long time ago) where PHP didn't recieve the proper hostname so ProcessWire kept telling me that I needed to update the hostname.
  18. Hi adrianmark, would you be so kind to post your solution here for further reference?
  19. How about: $pageID = $sanitizer->int($id); or $pageID = (int) $id;
  20. When it comes to handle multilingual content ProcessWire really outperformes any other system I've ever seen.
  21. The genius here is I believe adamspruijt for creating languagefieldtabs
  22. We are using this function on PW3. However, when copying a module to the /site/modules/ folder there is no option to select which module you want to use. When placed in /site/modules/ the module appears in the Site tab. We've used it for example on the FieldtypeComments. Notice the filepath.
  23. Hey csaeum, If you are developing a site it's good practice to turn on debug mode. This will make sure that errors are sent to your screen. You can enable this in /site/config.php. By default, it is false. Change it to true. $config->debug = true; Remember to turn it off on a live site. Please post the error and we are here to help.
  24. Hi, it is pretty much impossible to 100% secure it since most stuff can be (easily) spoofed. If the content is publicly accessible it's possible to access it. That's the baseline rule of internet content security. You can of course build some barriers to make it harder. There are several options to throw up some barriers: JavaScript checking the parent hostname (this can be spoofed) Mess around with the referer stuff in .htaccess (can be spoofed too) Check how ProcessWire denies its access to other iframe My opinion: you can throw as many barriers as you like, but especially the people who want access are the people to know and overthrow the barriers you build. Do
×
×
  • Create New...