Jump to content

Peter Knight

Members
  • Posts

    1,374
  • Joined

  • Last visited

  • Days Won

    5

Everything posted by Peter Knight

  1. I am trying to assign an incremental number to each image starting from 0 <li uk-slideshow-item="0"><img src="images/photo.jpg"></li> <li uk-slideshow-item="1"><img src="images/dark.jpg"></li> <li uk-slideshow-item="2"><img src="images/light.jpg"></li> The API docs mention I can use the following But when I apply it below, I get the following error Method Pageimage::eq does not exist or is not callable in this context Here's my usage foreach($item->images as $photo){ echo " <li uk-slideshow-item='{$photo->eq($n)}'><a href='#'><img src='{$photo->size(150,100)->url}' alt=''></a></li> ";} Thanks again P
  2. I have 2 repeater types working with the Repeater Matrix. To keep things simple, I have image gallery a downloads gallery. I can't quite figure out how to echo the contents from within a product_gallery. I can get the code below to display the text 'An image gallery' but not the bunch of images within this. I'm not sure though if it's my variable trail or my nested echo statement. <?php foreach($page->components as $item) { if($item->type == 'product_gallery') { echo " An image gallery..."; foreach($product_gallery->images as $photo) { echo " An image <image src='{$photo->url}'> "; } } else if($item->type == 'downloads') { echo " A download gallery... "; } } ?> Thanks P
  3. Glad you got it fixed. The causes of these things can be elusive?
  4. Agreed. I just need to add some custom widths to the pk-col-bod to make it mimic the previous layout etc.
  5. Thanks Tom. That largely works ok. I've yet to test it fully. The tricky part here is that the layouts across the site are using bespoke widths and stepping outside the normal UIKit columns widths etc. But that's a huge help and seems promising enough to start testing from.
  6. I'd say it's a PHP version issue. But otherwise, my approach would be to narrow it down by creating a few similar fields on the templates and seeing if they work/dont. etc
  7. Does it make any difference if you change the admin to use the latest UIKit?
  8. Is there anything showing in the Inspect console?
  9. Hi guys I know some of you are UIKit fans like me. I built a site recently using UIKit 3 and I'm having some layout issues on IE 11 and largest breakpoints. You have to set quite a big resolution or have a large monitor to experience this as it only happens on largest breakpoints. The main column in the above URL is successfully centered in most browsers except IE11. On IE 11, it shifts to the right. Basically it's a DIV using the uk-width-expand selector and then I have a custom max width and a margin in there to centre the content horizontally. Here's a simple CodeKit and JSFiddle of the issue https://codepen.io/edenstudios/pen/qvWpGo https://jsfiddle.net/EdenSt/auekfgqt/8/ Thanks P
  10. This is probably more a server issue with Plesk etc but relates to Processwire. I have a very long web form which takes the average user 3-5 minutes to complete. I know it's crazy but it's a client-driven thing. Occasionally, my client has been emailed by users that when they eventually his Submit, they get a general 500 server error. I did some research and looked at some logs and it seems to be some type of time-out issue. I guess that makes sense if the form takes minutes to complete as the first two fields of the web form are attachment uploads. I'm thinking that attaching files establishes some type of session but that session expires by the time the web form is actually submitted. Does that sound plausible enough? I plan to suggest moving the attachment fields to the end of the email, disabling the webform CSFR too and seeing if things improve. Does my theory about file uploads and session time outs sound plausible?
  11. It's primarily for a content editor so admin would be best.
  12. Idea: A way to push/pull or simply copy an image from Images field 01 to Images field 02 (or vice versa). I primarily need this for two image fields on the same page but I imagine some would find it useful for 2 images fields on different pages. Use Case Client has a general images field on every page of their site with all the images they need. We now need to create a second images field dedicated to a particular type of image. This image is based on an image already in the first images field. Being able to push/pull/copy would save them a heap or re-uploading etc I understand the flexibility of image tagging, croppingm using first() etc etc but we genuinley need a second images field and for it to be quicker (than re-uploading) to duplicate an image into this second field.
  13. I'm getting this too I have notifications turned on too. I wonder has @ryan any advice here if it is notifications. It's hard to replicate.
  14. Hi @adrian Does your fork have NoIndex and NoFollow fields by default? Cheers Peter
  15. I was having some issues logging into a site with PageProtector turned on using Chrome on Android. My users would hit login and either nothing would happen. occasionally, a 500 error would be displayed. In the end, I transpired that a setting called 'Data Saver' was enabled. Once you disable this, my logins worked. Alternatively, you can run your site over HTTPS to bypass this. I've yet to try it but if you're logging into sites etc then HTTPs should be the default anyway ?
  16. After trying various sort and reverse options, I saw you post, tried again and it's perfect now ? $does2 = $page->prevAll("template=a-practice-area")->reverse(); foreach($does2 as $do2)
  17. Actually I spoke too soon. Combining the two gives me 5,6,7(and then) 4,3,2,1 What I'd like to do is 5,6,7,1,2,3,4
  18. It doubles up on my code but certainly works. Thanks ?
  19. You're right - thank you. So I adapted my code to use page instead of pages and this modfied version works $items = $page->nextAll('template=a-practice-area'); foreach($items as $item) { echo " IE if you were on page 4, the output is5,6,7 Is there a method to restart the array after it reaches the end so that the output is 5,6,7,1,2,3,4
  20. Thanks for this. It looks promising but seems to apply to page instead of pages. Is there a pages equivalent?
  21. I have a selector which is pretty simple and just fetches a series of pages except for the current page. 1,2,3,4,5,6,7 When you're on page 1, the output is 2,3,4,5,6,7 When you're on page 2, the output is 1,3,4,5,6,7 $services=$pages->find("template=a-practice-area, id!=$page, sort=sort "); foreach($services as $service) { echo " <div>... Currently, the array (is that what it's called? starts from the first item (service) in the tree and continues. I'd now like to start the array from the next item in the array instead always starting at the first. IE if you were on page 2, the output is 3,4,5,6 IE if you were on page 4, the output is 5,6,7 Looking at the docs, a selector called 'start' is mentioned. I think this is what I need and have tried the following to no avail <?php $services=$pages->find("template=a-practice-area, id!=$page, sort=sort, start=$page"); Any tips?
  22. I have some width and height restrictions on my images field so the image gets uploaded and resized. In this case I'd assume anything specified in the gets applied. But i'm only guessing.
  23. Is there a way to make JPGs progressive by default via the API? I've added the following to my site/config.php file but user-uploaded images are often displayed as non progressive. $config->imageSizerOptions = array( 'upscaling' => true, // upscale if necessary to reach target size? 'cropping' => true, // crop if necessary to reach target size? 'autoRotation' => true, // automatically correct orientation? 'interlace' => true, // use interlaced JPEGs by default? (recommended) 'sharpening' => 'soft', // sharpening: none | soft | medium | strong 'quality' => 95, // quality: 1-100 where higher is better but bigger 'hidpiQuality' => 60, // Same as above quality setting, but specific to hidpi images 'defaultGamma' => 0.5, // defaultGamma: 0.5 to 4.0 or -1 to disable gamma correction (default=2.0) ); Thanks
  24. Lovely work as usual. Well done.
×
×
  • Create New...