-
Posts
2,769 -
Joined
-
Last visited
-
Days Won
31
Everything posted by Martijn Geerts
-
Big thanks Horst Thats why I used a rectangular box in the Gist to control it.
-
Most likely a not closed braces } or something.
-
before: https://www.youtube.com/watch?v=cubV4nELOyk after:
-
I forgot hat one.
-
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.
-
or use: echo "<img src='{$config->urls->templates}bxsliderpics/{$file}'>"; // ??
-
Fatal error: Allowed memory size exhausted
Martijn Geerts replied to verdeandrea's topic in General Support
Also want to mention that 50 or 60 repeater items is huge regardless of the content of a repeater item. -
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...
-
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.
-
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)
-
Limit page children to specific template (as page option)
Martijn Geerts replied to MarcinP's topic in API & Templates
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; -
Somehow selector doesn't work in template
Martijn Geerts replied to LostKobrakai's topic in API & Templates
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. -
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.
-
Somehow selector doesn't work in template
Martijn Geerts replied to LostKobrakai's topic in API & Templates
$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. -
Somehow selector doesn't work in template
Martijn Geerts replied to LostKobrakai's topic in API & Templates
get will get it, regardless of state. -
@NorbertH, already tried it on 2.5? If not you should do
-
+1
-
4 minutes ago i liked this post and it's already indexed by Google
-
Nice one Nico but don't ask Horst ! (or you will be busy like hell the coming month)
-
Will Brackets and Atom give Sublime serious competition?
Martijn Geerts replied to Joss's topic in Dev Talk
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. -
Will Brackets and Atom give Sublime serious competition?
Martijn Geerts replied to Joss's topic in Dev Talk
Atom is my main editor. And as always BBEdit is open as powerful clipboard & regex find & replace thingy. -
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;
-
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.
-
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.
-
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>"; }