Jump to content

Martijn Geerts

PW-Moderators
  • Posts

    2,769
  • Joined

  • Last visited

  • Days Won

    31

Everything posted by Martijn Geerts

  1. Big thanks Horst Thats why I used a rectangular box in the Gist to control it.
  2. Most likely a not closed braces } or something.
  3. before: https://www.youtube.com/watch?v=cubV4nELOyk after:
  4. When there are 6 simultaneous requests a browser can handle, 160 requests for a slider is just insane, thumbnail or original. I would say go for Horst's way and for front-end: AJAX to the rescue. Or don't do it at all.
  5. or use: echo "<img src='{$config->urls->templates}bxsliderpics/{$file}'>"; // ??
  6. Also want to mention that 50 or 60 repeater items is huge regardless of the content of a repeater item.
  7. if ($handle = opendir($dir)) { while (($file = readdir($handle)) !== false) { if (strpos($file, '.') === 0) continue; // <-- add this echo '<li>'; echo '<img src="' . $dir . $file . '" />'; echo '</li>'; } ..... etc.... There's nothing wrong with the code, it's just how folders work.You could use strpos($file)as there's no need to include any files starting with a dot...
  8. Yep that is what it does and yes that's a bad name. Logo was just a name to explain the method the best I guess.
  9. Hi Horst, Many times I need to output a lot of logo's. Those logo's need to have the same visual weight. Some logo's need to be wider others need to be higher. May I purpose a new method 'logo' or something ? Pia is dancing nicely with crop contain and cover, but could you let her swing with logo ? I have a starting point here that works great (used it many times)
  10. a bit related: I use InputfieldSelectFile and then select the custom 'template' in the page. In the example below, I have a /site/templates/includes/ folder with PHP files in it. I now can select a file and use that as a template. So no need for additional templates. $tpl = new TemplateFile($config->paths->templates . "includes/" . $page->select_file); $tpl->set('current', $page); $markup = $tpl->render(); echo $markup;
  11. Actually I have been in the same situation but then in the context of inputfield Page. (Not showing pages for loggedin users except root). It was a real question for me then, but it makes sense after you get the concept.
  12. I always start with the data part. Paper & pen. (maybe most important step) Draw site tree. Assign templates to site tree Per template write down where the data comes from. from fields from relations services etc. Build all needed fields Create all templates and assign the fields (Don't specify the family settings, don't set no fields required) Create basic page structure Go back to each template, and specify family settings and set some fields required. ppfff, your data structure is ready. Template level: Build a view file ( I always use some kind of delegate solution ) Add menu structure, and edit links. ( Not able to navigate on front-end is hugely annoying ) Start other stuff, no predefined order, really depends on project and where the data comes from.
  13. $pages->get will not use check_access: $pages->get("template=shop-cart, user=40, session=6b53ec96ea298445183c269bf0d51d54, cart.product=1035, include=all, check_access=0")->id So sounds expected behaviour to me, as cart.product=1035 performs a find in the scope of the current user. And that find isn't allowed due to access rights. little note: When you do a find (not get) and use include=all there's no need to call check_access=0 as that is assumed by that.
  14. @NorbertH, already tried it on 2.5? If not you should do
  15. 4 minutes ago i liked this post and it's already indexed by Google
  16. Nice one Nico but don't ask Horst ! (or you will be busy like hell the coming month)
  17. I use transmit, then mount the FTP server on my desktop as it is a local drive. Then you can work with FTP just as you would have done on your local drive. Edit an image on FTP, no problem, just open the file in Photoshop and press save. Want to edit a MS Word file on FTP, browse to the file, open it, edit and press save. You get the idea.
  18. Atom is my main editor. And as always BBEdit is open as powerful clipboard & regex find & replace thingy.
  19. I prefer to do it this way: this, another, that & those $out = ''; $count = count($update->client_location); foreach ($update->client_location as $key => $geo) { $div = ($key + 1 === $count) ? ($count === 1 ? '' : ' & ') : ($key === 0 ? '' : ', '); $out .= $div . $geo->title; } echo $out;
  20. I'm sorry i'm unable to reproduce the error. That's weird, I don't expect scheme changes, what I would expect is field deletion.
  21. Hi LostKobrakai, When does that error show is that front-end or back-end? What version of PW do you running? Could you please make a step by step for me so that I could make it reproducible.
  22. It's expected behaviour of the Pageimages (array) You're trying to set a pixel size to an array of images. Pageimages (array of images) doesn't have a size, because it is an array. You need to go 1 step deeper, get the image, then set the size to an individual image. If you run the code below, what does it say ? if ($page->header_image instanceof Pageimage) { echo "(Pageimage) - Single image, yeah, you can use size.<br>"; } elseif ($page->header_image instanceof Pageimages) { echo "(Pageimages) - Array of images, can't use size.<br>"; }
×
×
  • Create New...