Jump to content

thijs

Members
  • Content Count

    52
  • Joined

  • Last visited

Community Reputation

15 Good

About thijs

  • Rank
    Distinguished Member

Profile Information

  • Gender
    Not Telling
  • Location
    Amsterdam, The Netherlands

Recent Profile Visitors

2,470 profile views
  1. Ok, this works: {% for sibling in page.siblings('id!=' ~ page.id) %}
  2. Awesome module, much thanks for that. One question though, how would one accomplish the following in twig? (I’m trying to exclude the current page from it’s array of siblings) Vanilla PHP: foreach($page->siblings('id!='.$page->id){ This is my twig code: {% for sibling in page.siblings('id!=page.id') %} I understand that page.id will not be rendered as the page it’s id, since it’s a string etc. But what is the proper way to accomplish this? I’d need to do some string concatenation within the selector there. I know I can create a dataprovider to provide a proper wirearray with actual siblings, but it seems a bit overkill. Thanks in advance!
  3. Well, there was an error in my template code. That’s resolved now, but the behaviour still occurs, yet it is not consistent, sometimes it throws 404s, sometimes it just doesnt. I’m considering implementing my own published/unpublished mechanism (simple checkbox) to work around this, as it’s quite inconvenient...
  4. Think I figured out the cause; with debug mode on I figured out that PHP was throwing an error somewhere. But not sure how this lead to the actual 404.
  5. The production server has got suhosin installed (read something on this in a vaguely related thread). May be something server side..
  6. Hey, thanks for your reply. The template is public (guests can view it). The template permissions are set as follows: Publishing pages and then unpublishing them (from the cms, not the API) sometimes seems to do the trick. But it’s hard to pin it down. Thanks for your input though, I’ll give it another go. And is there a way to debug the process that happens before the actual 404 is thrown? May shed some light on the issue
  7. Hi all, I’ve been experiencing quite a mysterious issue; I’m running PW 2.4, and the following occurs; the client is not able to view unpublished pages but get’s a 404 served instead. It’s not a role/permission issue I think, as it happened for me (admin) as well. But it’s not consistent. When I log into my local install of the website, it does seem to work, and here comes the crazy; it then also works on the production site. What else; the page template renders it’s parent (it’s a backbone js app), but I’m not sure if this matters, thought I should mention it anyway. Any clues? I’m not sure how to debug this one. All the best, T – I did try to clear all sessions, and none of the websites pages are cached at the moment.
  8. It was this line of code: $this->message("$name = $value");
  9. Hey all – I’ve been using this FieldtypeImageExtra inputfield to create multi-language captions for a repeater that contains multiple image instances. It is working well so far. Only thing is, I get flooded with notifications after saving a page, it looks like this: Is there any way to disable this? Will definitely make my client happier
  10. Hey all, I’ve run into the same problem, moved a site to another server (php 5.3.2.) but with an extra hurdle, when I try to reset the password through the API, it throws me a 500 Internal Server Error, which is logged as: Error: Exception: Unable to generate password hash (in /var/www/vhosts/stage.vandejong.nl/httpdocs/depit/wire/core/Password.php line 270) Edit: Radek’s fix (adjusting Password.php) did the trick.
  11. Thanks so much for your extensive answer, and for making this module. And indeed, relying on ip for getting someones location is definitely not airtight, but all we’ve got. I’m not using it for a security feature, just to show/hide content that is (ir)relevant to that specific group. For now I’ve stripped down your module quite a bit. It now first checks if if the session variable is set, if not it will iterate through the list of ip’s / ip-ranges. It sets the variable to true if it has found a match, or sets it to false if it has not found a match. Regarding the caching, thanks for your insights. I think Markup cache would be the best way to go, too bad I cant use the default caching, which is something that has been working well for me so far. If Pro cache could help me out that would be awesome, but I cannot rely on people entering the website on a single url. Now that I read about the PageRenderNoCache (good one!), would it be possible to serve a cached version of the page if the session variable from above has been set, and if it has not been, not to serve the cache page? That would be real great. I’m not sure what code is being executed and what not when a cached page is being served, is it just the template output that is being cached? In other words; do modules run/execute also when serving cached pages? – And many thanks again
  12. Hey all, For a project I’m working on I need a specific section of the website to be visible only for visitors from one country, visitors from all other countries should not be able to view this menu item and page. I think I can bend the Page Render IP-restriction module to set a $page->variable indicating if the visitor is from that country or not. But I’ve got some questions Caching the IP-restriction action Would it be advisable to save this variable in the user’s session so the site doesnt have to go through all ip-ranges to check up on this for every page load? Caching the website pages This is the tricky one (I think). Can I still cache the website pages when not all visitors should be served the same page content? I think I’d need two versions of each cached page, but wouldnt really know if that is possible? Thanks for reading and your insights are very welcome!
  13. Hi apeisa, Thanks for your reply! These are the changes I needed to do in order to make it work: Comment out this line in FieldtypeCropImage.module if ($this->w < 1 || $this->h < 1) { throw new WireException(sprintf($this->_("Width and/or height not found for thumb: %s"), $thumb)); return; } And I’ve changed the if / condition in ProcessCropImage.module: if (!$prefix || $targetWidth == 0 || $targetHeight == 0) { $targetHeight = (int) $crop['h']; $targetWidth = (int) $crop['w']; } Not sure if this is the proper way to do it, I guess a second set of eyes would be good before I propose to merge anything!
  14. Hi apeisa, Thanks for your reply! These are the changes I needed to do in order to make it work: Comment out this line in FieldtypeCropImage.module if ($this->w < 1 || $this->h < 1) { throw new WireException(sprintf($this->_("Width and/or height not found for thumb: %s"), $thumb)); return; } And I’ve changed the if / condition in ProcessCropImage.module: if (!$prefix || $targetWidth == 0 || $targetHeight == 0) { $targetHeight = (int) $crop['h']; $targetWidth = (int) $crop['w']; } Not sure if this is the proper way to do it, I guess a second set of eyes would be good before I propose to merge anything!
  15. Found it, it’s in here: (FieldtypeCropImage.module) if ($this->w < 1 || $this->h < 1) { throw new WireException(sprintf($this->_("Width and/or height not found for thumb: %s"), $thumb)); return; } I’ll see if I can rewrite this to check for the presence of the values and not for them to be smaller than 1. I think this piece of code casts an empty value (no dimensions entered in config) to 0 $this->w = (int) $crop[1]; $this->h = (int) $crop[2]; So I can’t use is_numeric or is_empty to check if there is a value present. And even if I work around this for the time being (by commeting out the width/height check), the crop I make is not being saved.
×
×
  • Create New...