Jump to content

Joachim

Members
  • Posts

    14
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

Joachim's Achievements

Jr. Member

Jr. Member (3/6)

4

Reputation

  1. Trying that out (using $pages->get("/home/landing")->introimg_field instead of $item->introimg_field) : <?php foreach($pages->get("/home/landing")->introimg_field as $intro_image): ?> <a href="<?php echo $intro_image->page_picker->url; ?>"> <h3><?php echo $intro_image->title; ?></h3> <img src="<?php echo $intro_image->image->url; ?>" alt="<?php echo $intro_image->description; ?>"> </a> <?php endforeach; ?> It shows up in Firefox, but not in Edge. If I revert back to $item->introimg_field, it keeps working. For now.
  2. Thanks Markus, and apologies for the delay. After some trial and error I got it to work one time, and hoping it was finally solved, I tried it in another browser. But it behaves exactly the same as before, even though I now refer to the specific module page. Every other module is working fine, but this one isn't. I'm wondering, could it be because its main component is a Repeater field? That perhaps while it refers to the Repeater field as $modulePage->field (where $modulePage refers to the specific module page), the different repeater fields (e.g. repeaterField->title) are still read as $page->repeaterField->title, and - since it can't find such a field on the main page - nothing gets rendered? As a side note: could the fact that wireRenderFile is delayed output explain that sometimes the module does load; that the parsing order could depend on server response time and/or load times?
  3. var_dump($page->introimg_field) gives: object(ProcessWire\RepeaterPageArray)#258 (5) { ["field"]=> array(4) { ["id"]=> int(111) ["name"]=> string(14) "introimg_field" ["label"]=> string(13) "Landing image" ["type"]=> string(17) "FieldtypeRepeater" } ["forPage"]=> array(6) { ["id"]=> int(1027) ["name"]=> string(7) "landing" ["parent"]=> string(6) "/home/" ["template"]=> string(16) "module_introImgs" ["title"]=> string(7) "landing" ["text"]=> string(0) "" } ["count"]=> int(0) ["items"]=> array(0) {} ["selectors"]=> string(0) "" } (I've never used this function, so I'm not entirely sure how to interpret this. Maybe ["count"]=> int(0) ["items"]=> array(0)count"=> int(0) is a bad sign?) It seems no matter what I do, the foreach function isn't working—until for some reason the images load, apparently randomly, after which the function works after every reload, suggesting a cache issue, I'm guessing (this is also why I tried loading the images in the main CSS file). EDIT: I am loading children pages as modules into the main pages. Take the following structure, for example: HOME - text - images - marquee - text2 The subordinate pages are loaded into the Home page using echo wireRenderFile(). Could it simply be that I'm referencing $page (in foreach($page->introimg_field as $intro_image), so it is looking for my Repeater Fields in the Home page, while in actuality they are on a child page?
  4. Right, I had hoped loading them through CSS would fix the problem somehow, but forgot about that 😬 That explains that part, thank you, Markus! Locally the page always loaded correctly, but I have sanitised the code a bit and perhaps introduced a mistake, although sometimes the pictures do load fine. I'll try your suggestions and get back to you.
  5. I have the following code on a website: <?php namespace ProcessWire; ?> <section id="<?php echo $page->title ?>" class="module"> <?php echo "{$page->text}"; ?> <div class="landing_images"> <?php foreach($page->introimg_field as $intro_image){ echo " <a href='{$intro_image->page_picker->url}'> <h3> {$intro_image->title} </h3> <img src='{$intro_image->image->url}' alt='{$intro_image->description}'> </a>"; }; ?> </div> </section> For some reason, most of the time this code doesn't seem to get executed. The strange thing is, that the referenced images (the $intro_image fields) are being pulled, as they appear in the console: As you can see from the turtle icons, the server response times are very slow (around 650 ms), but then again, the code above is rendered client-side as: <section id="landing" class="module"> <div class="landing_images"> </div> </section> So the $intro_image fields inside the code are read, but the code surrounding it, i.e. within .landing_images, is not rendered at all. Does anyone know what could be the problem here?
  6. Thank you, Andy. The steps were slightly different through my provider, but it seems ZIP was enabled anyway. I tried again to enable debugging in config.php, and for some reason it worked now. Could it be a caching problem somewhere, maybe, as I had just updated ProcessWire before posting my initial message here?
  7. Thank you, Simi, but it was explicitly about manually installing "Zip and ZipLib in PHP".
  8. Hi Simi, Can you explain how to do this? Thank you in advance!
  9. I just started writing a blog post. I have a 'blog_entry' template with both a 'body' and 'images' field. The 'body' field is of the Textarea (Multi-language) type using the CKEditor 'Inputfield Type'. The 'images' field is simply of the Images type. Within the 'blog_entry' template, I (obviously?) need to upload images to the 'images' field in order to be able to insert them into my CKEditor field (using the Insert image button). However, whenever I insert an image, everything else within the text editor is removed or replaced. Does anyone know why this would happen, or can anyone help figuring it out? NB I have just updated ProcessWire, which didn't help this matter, but am currently not able to update any other modules (same issue as mentioned here). Maybe that will eventually solve things, but for now I figured it more productive to raise this issue independently. (P.S. This is likely unrelated, but it might be worth mentioning anyway: I just tried the text editor again, and now it is completely blank, so apparently there is more going on. Even before updating ProcessWire I had installed the AdminOnSteroids module to see if that would solve things, and had configured it to use the LightWire layout for the CKEditor. Initially this worked (but didn't solve the issue), but now — possibly since updating PW — the entire CKEditor is missing/text editor field is blank. On page load I am able to discern in a flash how the editor with the contents is loaded, so apparently something is drawing over it. Upon inspection, it seems the html <textarea> class with an id of 'Inputfield_body' has its visibility set to 'hidden', so maybe there's a script not running properly?)
  10. I just ran into the same problem: after updating ProcessWire (3.0.162 -> 3.0.201) and setting 'debug' to 'true', I am unable to update any modules (using the Upgrades page) - PW still gives me that same error Claus mentioned. But I have too little knowledge of the backend mechanics to know what I should do based on the comments here: what is the PHP-zip, how do install or update it, or how and/or where do I change owner settings of the folders the updates need to access? Can anyone elucidate?
  11. Ah, that explains a lot! So this hasn't even anything to do with ProcessWire ? I had looked at the red text in the source file as Firefox presents it, but saw how in the example pages at times more than plain text was used, so didn't think it would be problematic. Still, it was probably only PHP outputting plain text.. Thank you for the concise explanation!
  12. Update: Apparently the only reason I get that result is because it is wrapped in a <p> element. Is my setup to blame or is this a (known) bug?
  13. Long time user and huge fan of PW, but this time I can't find an answer to my question this time: For my social media buttons, I have a Repeater field called var_link_web with two fields: one is for the URL, and the other is an Images field containing two images that are used as a background-image for a <div>, of which the second is the ':hover' version (although activated through JavaScript here). There are four instances of this Repeater, of which two are 'turned off'. I use the following PHP in my _main.php to call them, wrapped in <p><?php == ?></p>: $s_m_button = $variables->var_link_web; foreach($s_m_button as $button){ $button_image = $button->var_link_image->first->height(80); $button_image2 = $button->var_link_image->eq(1)->height(80); echo " <a href='$button->var_link_url'> <div class='image_link' style='background-image:url({$button_image->url})' onMouseOver='this.style.backgroundImage=url({$button_image2->url})' onMouseOut='this.style.backgroundImage=url({$button_image->url})'> </div> </a>"; }; ($variables leads to an unpublished page with several fields I want to have easy access to, and is defined in _init.php.) However, this gives me the following result: I have no idea where the extra <p>'s come from. The URL field has the 'HTML Entity Encoder' turned on. What's even weirder is that the HTML source file seemingly renders correctly: <p> <a href='https://www.facebook.com/'> <div class='image_link' style='background-image:url(/site/assets/files/1045/icons-facebook-square.0x80.png)' onMouseOver='this.style.backgroundImage="url(/site/assets/files/1045/icons-facebook-square2.0x80.png)"' onMouseOut='this.style.backgroundImage="url(/site/assets/files/1045/icons-facebook-square.0x80.png)"'> </div> </a> <a href='https://www.instagram.com/'> <div class='image_link' style='background-image:url(/site/assets/files/1046/icons-instagram-square.0x80.png)' onMouseOver='this.style.backgroundImage="url(/site/assets/files/1046/icons-instagram-square2.0x80.png)"' onMouseOut='this.style.backgroundImage="url(/site/assets/files/1046/icons-instagram-square.0x80.png)"'> </div> </a> </p> Removing the JavaScript has no effect. I'm probably missing something obvious, but am at a loss here. Thank you in advance!
  14. Hi Blynx, thanks for the great plugin! Is it possible to exclude an image from the generated gallery, but still include it in the lightbox? I have set echo $pwpswp->renderGallery($page->images->slice(1)), in order to prevent the first image in the $page->images field from being repeated in the gallery (it's shown individually at the top of the page). I have tried using an 'items' array in $galleryOptions (as can be seen halfway down this PhotoSwipe documentation page), but nothing changes (I was able to change the indexIndicatorSep var, so it's not my code, methinks). Do you know of any way to accomplish this? Thanks in advance!
×
×
  • Create New...