-
Posts
361 -
Joined
-
Last visited
Everything posted by mel47
-
Hello! I used this module to link images from different fields. It "kind-of" working. Meaning, thumbnails are well created. But some images are not saved. I realized that some images get renamed and have so many variations. Is it possible it's because I add images to imagefield on page 1065 and PW tries to create all versions again and again? How I can create an array of images that will not have this behavior? Hope it's clear... Thanks Mel $wire->addHookAfter('FieldtypeDynamicOptions::getSelectableOptions', function(HookEvent $event) { // The page being edited $page = $event->arguments(0); //if we need 2 image_selection make a condition for page // The Dynamic Options field $field = $event->arguments(1); //images on parameters page $par = $event->wire()->pages(1065)->images; //last image for webinars and adding them to previous images foreach ($event->wire()->pages(1042)->content_blocks->find("repeater_matrix_type=2") as $p) { $all = $par->add($p->images->last()); } // For a field if($field->name === 'image_selection') { $options = []; // Get Pageimages within the "images" field on the home page foreach($all as $image) { // Add an option for each Pageimage // When the key is a Pageimage URL the inputfield will automatically create a thumbnail // In this example the label includes the basename and the filesize /** @var Pageimage $image */ $options[$image->url] = "{$image->basename}<br>{$image->filesizeStr}"; } $event->return = $options; } });
-
I already have area and number separated. My issue is about the number only. We have to type without dashes, but since no one is normally doing that, some confusion arises and they always have an error (and they need to remove the dash they typed to get a valid answer). So yes, if the dash could be strip somehow, it will be ideal!
-
Hello Adrian, Just a quick question. I have set output to NorthAmericaDashes. I was wondering if I can set input to fit the output. I use the fieldtype in my FormBuilder and user complains that they don't know the format to use since it's not as usual. They want 123-4567 but we have to enter 1234567 to avoid errors. Is it possible to do that? Thanks again!
-
Thanks a lot! Works now!
-
Hum... Is it possible to have the same module not at the same version ? When I go to upgrades, for the first one, it's said it's not tracked by module directory. For the second, it's the latest version. BTW, I downloaded this module just yesterday.
-
Hi @Robin S I have a problem with your module. It detected links but the table is completely empty. Checking console, I got those errors : JQMIGRATE: Migrate is installed, version 1.4.1 jquery-migrate-quiet-1.4.1.min.js:2:552 La mise en page a été forcée avant le chargement complet de la page. Si les feuilles de style ne sont pas encore chargées, cela peut provoquer un flash de contenu non stylisé. JqueryCore.js:1:91295 Échec du chargement pour l’élément <script> dont la source est « https://XXX/site/modules/VerifyLinks/datatables/datatables.min.js?v=0.2.2 ». verify-links:93:102 Uncaught TypeError: $(...).DataTable is not a function <anonymous> https://XXX/site/modules/VerifyLinks/ProcessVerifyLinks.js?v=0.2.2-1727405204:7 jQuery 4 ProcessVerifyLinks.js:7:21 <anonyme> https://XXX/site/modules/VerifyLinks/ProcessVerifyLinks.js?v=0.2.2-1727405204:7 jQuery 4 Do I miss something to install? PW 3.0.241, VerifyLinks 0.2.2. Didn't work both on my computer (localhost) and online server. Mel
-
Hi, I read and re-read the page about lazycron but there is something I really don't understand. Where I should put this function? Does the hook and the function should be on the same page? Does the template should be a page related to the function? Or I should create a template specifically for this? But if so, I guess this template have to be published and visited? My goal is to send an email weekly. Thanks!
-
Hi, Thanks for this solution, that I was looking for. Are you aware if it have a limit of number of pictures? Or maybe it's my code which is not optimal but strictly talking the code is good. I just add a loop to get all images on all pages with template meetings. However I got fatal error (30s execution time). The original code searching on only 1 page (having 50 pictures) is fine. But on total, I have for now no more than 55 pictures for all my PageImages field. Is it a way to make it more efficient? Or I should just have many fields for the different meetings? Thanks Mel $wire->addHookAfter('FieldtypeDynamicOptions::getSelectableOptions', function(HookEvent $event) { // The page being edited $page = $event->arguments(0); // The Dynamic Options field $field = $event->arguments(1); // For a field named "select_images" if($field->name === 'image_selection') { $options = []; // Get Pageimages within the "images" field on the home page foreach($event->wire()->pages->find("template=meetings") as $p) { foreach($p->images as $image) { // Add an option for each Pageimage // When the key is a Pageimage URL the inputfield will automatically create a thumbnail // In this example the label includes the basename and the filesize /** @var Pageimage $image */ $options[$image->url] = "{$image->basename}<br>{$image->filesizeStr}"; } } $event->return = $options; } });
- 18 replies
-
- inputfield
- images
-
(and 2 more)
Tagged with:
-
Hi, I try to code something I've already done in another context, but since field is a text than a page, it seems to doesn't work exactly the same. foreach ($prize as $awardees) { $year = $awardees->year; //Problem is here; I got many times each year echo <h3>{$year}</h3>; //output : 2024 2023 2023 $allbyYear = wire('pages')->find("has_parent=1153, year=$year"); foreach ($allbyYear as $winner) { echo $winner->title; // output winner1 winner 2 winner 3 winner 2 winner 3 } } How I could only have 2024 and 2023? Thanks Melanie
-
Hello @Ade I can give you my opinion as a non-professional, building websites (now at the fourth, over 6-7years) on my free time for organizations I work as volunteer. As others said, you will definitely have to learn PHP but honestly my basic knowledge of loops and functions is quite enough to do get a pretty impressive result. For sure, you will need to invest time, way more than those experienced people. And code will not be as optimized, but it works... However I can't emphasize enough how helpful and kind are the people in this forum. If you show you did an effort, you will never receive those passive-aggressive "RTFM" answers as in my previous CMS forum... So if it's a project on which you want to invest time and efforts, you will get way better satisfaction than with a premade website builder (which apparently you already tried). PW is not dependent of a type of website (or doesn't have a big catalog of theme) and you can build whatever you want. Which is cool but could scary coding beginners as us. However, docs, forum and examples provided at download are quite enough to start your first structure and have a functional blog. I oversee however you may need help from community for some more advanced functions. Which is fine. I clearly see amelioration from my 1st website to the current one, so if you focus on only one project, chances are it will become quite good!! Good luck! Mel
-
Thanks, success! For the sake of ulterior reference : str_replace($short, '', $person->content);
-
Hi No success on forum unless I didn't have the good keywords... I created a short sentence using $short = sanitizer()->truncate($person->content, 150); But then I want to remove this sentence from the content. The usage is a accordion (clicking the sentence open the full text, but without repeating the same sentence again). Thanks! Mel
-
Hello, Sorry if it was not clear, I think it wasn't also in mind. After thinking again about it, I just switched everything to a RepeaterMatrix and it becomes way easier. Thanks, Mel PS but to answer questions : there is only one page (a basic-page) who should listed all members. And I realized I shouldn't use at all member template, since I don't want individual page for each member.
-
Hi @Robin S, Yes it works perfectly! It's wonderful, thanks so much!!!
-
Hello, That was my first guest, but it didn't work. However it finds the good page. But then, the field is not appearing. Image from page 1042 is without publication_date field : I'm not sure if I don't have the good syntax or if it's a limitation? Thanks.
-
Hello, I'm stuck since way too much time for something probably easy... I have those pages and (templates) -Home -> Existing page on website --About us (section) ---Committees (basic-page) -> Existing page on website ----Executive (section-admin) -----Member 1 (member) ---Awards (basic-page) -> Existing page on website ----Prize X (section-admin) -----Awardee 1 (awardee) I have main.php and basic-page using regions, it works. However I fight on how listing members on basic-page. Do I should use the member/awardee template and render in basic-page? Or you I should use section-admin template and then, by children type, do some different markup? Thanks
-
Hi, I want to show some custom fields from an image depending on the page id. However just a showIf = parent.id=1042 doesn't work. (1042 is the page, not the image) Is it possible by a different syntax? Thanks Mel
-
Thanks so much, problem solved.
-
Hi, From 3.0.126 Just realized I also have the date in english in backend (in lister for example). And also in another website (in backend but not frontend). Not sure if it was like this before since I never really have a date column in lister. This website in on a PHP7.4 version. Thanks
-
Hi, I updated recently to PW 3.0.233. My website is in french (default) and english. I realized all my dates became english on frontend. I didn't modify locale (fr_CA.UTF8) from languagesupport-module, neither anything from my template. Most used something like strftime('%A %d %b', $item->getUnformatted("date")). An important information is that my prod server is still on PHP 7.2, so it should not normally be deprecated. Does something change in PW? Or what do I should changed at this time? Thanks Mel
-
Hi, I used this module since long time and it worked fine. But I wanted to change an address today and I got an REQUEST DENIED error. I didn't change anything to my API key. I just check, and Geocoding API and Maps JavaScript API are enable. I updated to 3.0.0 module also recently, so I don't know if it's related or not. Thanks
-
Hi @thetuningspoon Thanks! I took 3.1.6 from GitHub, it doesn't seems to be push to PW modules repository. But anyway, it works perfectly now!
-
Hi, In readme it said that it have an automatic cleanup (I do have Lazy cron installed). How I can verify if it works (or in fact why it doesn't)? The list is growing and it doesn't seems to be deleted since I installed the module 3 years ago! Thanks Mel
-
Hi, I updated recently both PW version (to current dev 3.0.233) and module (from 3.1.2 to 3.1.5). I have a problem with interference within FormBuilder module. When I click to edit some PageFields, in my form, I get this message. Not for all fields though. And I don't have this issue in template, view and add new links works fine. Thanks. (I post here, since it seems related to this module, but I could transfer the message in FormBuilder forum if necessary).
-
OMG, thanks so much. Apparently I skip this (closed) option.