-
Posts
361 -
Joined
-
Last visited
Profile Information
-
Location
Montréal, Canada
Recent Profile Visitors
5,177 profile views
mel47's Achievements
Sr. Member (5/6)
98
Reputation
-
mel47 started following Visibility for custom fields of images [SOLVED] , Dynamic Options , How to use lazycron? and 2 others
-
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.