Jump to content

Falk

Members
  • Posts

    30
  • Joined

  • Last visited

Everything posted by Falk

  1. Hi all, I'm trying to display a users profile image in a comments list and am not able to resize it. The site is used as an intranet, so there are no guest-users allowed, all users are registered with a role "staff" and have a mandatory imagefield. Using a multi-file image field, I tried the following code inside a function: // who's the author? $cite = $comment->getFormatted('cite'); // get the author and display profile picure (first in set) $userImage = wire('users')->get($cite)->getUnformatted('images')->eq(0)->size(100,100)->url; Without resizing, everything is fine: // get the first image $userImage = wire('users')->get($cite)->getUnformatted('images')->eq(0)->url; // get the second image $userImage = wire('users')->get($cite)->getUnformatted('images')->eq(1)->url; works as expected. I also tried a single-file field but without success either: getting the original image URL works fine, resizing the image doesn’t. Any ideas on that?
  2. Hi Zeka, ahh, I missed the purifier! Thanks for this solution. After messing around with regex, I found out that this is working too: $content = preg_replace('/<figure[^>]*>([\s\S]*?)<\/figure[^>]*>/', '', $page->body); $text = $sanitizer->truncate($content, [ 'type' => 'sentence', 'maxLength' => 400, 'visible' => true ]); echo '<p>' . $text . '</p>'; Thanks again!
  3. Hi Forum! I have the following content in a ckeditor body-field: <figure class="align_right"><img alt="some random alt text" src="path/to/image-file" /> <figcaption>some random caption text</figcaption> </figure> <p>some random text</p> I use $text = $sanitizer->truncate($page->body, [ 'type' => 'sentence', 'maxLength' => 400, 'visible' => true ]); $content = "<p>"; $content .= $text; $content .= "</p>"; echo $content; to output the body-field in my template, which results in… <p>some random caption text some random text</p> Is there any way to tell $sanitizer->truncate to skip/remove/ignore anything that’s inside a <figure> Tag, so that I get rid of the part "some random caption text"?
  4. I can confirm this problem with: PW 3.0.165 CK Editor 4.14.0 Safari 11.1.2
  5. Hi! After temporarily using Module Image Extra, which I completely removed, I had some troubles with my imagefield (unused table columns). So I just imported a previous version of this column via PHPmyAdmin, which worked pretty well. Anyways, in Processwire Backend all image tags are gone, although they are OK in the database. Other image related things work (thumbnail, title etc are OK). Is there any way to recreate all the images or something? Or may this be an cache-related issue? Thanks in advance ?
  6. Thanks tpr! That was quick ?
  7. Hi! I have lots of blogposts in my pagetree and I want the pagelabel to include the value of the post’s datefield (only the year). Adding date | title in the template settings results in something like… 1536012000 | my blogpost title Is it possible to convert the timestamp to a readable date?
  8. Thank you so much for this solution! Just had the same issue and solved it by reordering the modules cache entry. I would never have thought of that.
  9. I just tested Client-side resizing on a fresh pw installation without success. Again I see a greyed thumbnail with a spinner, but nothing happens. I tested with firefox 52.0.2 and safari 9.1.3 Any ideas?
  10. Additional Modules are RepeaterMatrix and MarkupSimpleNavigation. I will give it a try with a fresh installation as soon as possible.
  11. Somehow it’s not working for me… I see a thumbnail of the image with a grey overlay and a spinner, but it’s not uploading. Tested with Safari, Chrome and Firefox without success. I also tested different settings for the image field, cleared cache and cookies… The upload process works for images that are smaller than specified. Attached you see a screenshot of the field settings, do I miss something?
  12. Oh my god… Obviously this was the most stupid question ever. Sorry for that, and thanks for answering anyway
  13. Hi folks! I have a little problem with some language-alternate filefields file and file_en inside a repeaterfield. Some repeaters only contain geman files, others only contain english files. Looking at the german version, everything is fine, you see only german files. But looking at the english version, you see both english and german files because the default value is displayed if file_en is empty. Is there a way to not display the default value if file_en is empty? Regards, Falk
  14. I have a similar problem with a website I just finished. Images appear in the correct directory (I see them with FTP), but they won’t get cropped or scaled and they won’t show up in frontend and backend. I tried some of the tips I found in the forum but nothing worked… Uploading PDF Files works fine, so I think it might be a problem with Scaling/Cropping images.
×
×
  • Create New...