Jump to content

Recently Updated Topics

Showing topics posted in for the last 7 days.

This stream auto-updates     

  1. Past hour
  2. Rusty newbie here... I have a template called MeetingEvent, to which I've added a file field to allow uploads of multiple PDFs. The field is called meeting_event_pdf_attachment. Users may attach any number of files to this field, and it's set to provide an array of items (for simplicity). I'm having trouble getting the filename and path out of the supplied data - surely I've forgotten some bit of PHP syntax here. If I do var_dump($page->meeting_event_pdf_attachment); I get something that looks like this: object(ProcessWire\Pagefiles)#415 (2) { ["count"]=>; int(1) ["items"]=>; array(1) { ["accessibility.pdf"]=>; string(17) "accessibility.pdf" } } (In this example, my attached file is called "accessibility.pdf") var_dump($page->meeting_event_pdf_attachment->count); outputs int(1) as expected. var_dump($page->meeting_event_pdf_attachment->items); outputs NULL. I was expecting ->items to be an array - it sure looks like one. I need to be able to walk through "items" and grab the URL for the things listed there, but with it being NULL, I'm kind of perplexed as to how to do that. Should I be using a repeater instead? Any advice appreciated.
  3. Hi all, I'm new. I've been trying to connect modules for a couple of days, but nothing works. The question is how to connect the modules? Can explain how to include them?
  4. @adrian - Thanks for reporting back to keep us updated!
  5. Chaining is based on the idea that your method returns a self-reference, i.e. "return $this", after which you can access another method from the returned object. In your example when you leave $value param of the text() method empty (so that it defaults to "null"), the method returns "$this->text" (which is a string or null) instead of an object – and you cannot use a string for chaining (it doesn't have any methods). In other words: even if "$this->text" had a non-null value, you still couldn't use it chaining, 'cause it would return a string and not a self-reference to the containing object Based on your code it looks like text() without a $value is supposed to work like a getter, returning the text (string), so technically this is how it's supposed to work. The most obvious option would be defining another method – perhaps something like setText(string $value = null) – that sets the value but always returns $this, and never the value itself. Or you could just modify the text() method so that it cannot be used as a getter for the value, i.e. make that always return $this. Hope this helps a bit
  6. Today
  7. Wow... I have actually never seen this before but for external links I use:
  8. You can post an issue on github, as Ryan may not see this here in the post. But he will see it on Github!
  9. The fields are created from the template tags! It's been a long time so I don't remember the complete process for a complex field (e.g. repeater type), but I do remember that setting up a text field is done this way. You write the tag in your code and it shows up in the backend. Not really my goal here! haha. But just today I was thinking how I could leverage on tools like Webflow (which I like a lot) but allow for better maintainability if you update your design. Anyway, just ideas Maybe this belongs to Dev Talk now that I think about it?
  10. Jon


    Nope Iam no longer sure, turned out to be 5.6 set in cpanel and 7.2 in whm. Thanks for your help
  11. Hi @Entil`zha. I am afraid this will not be possible. Earliest release date is late Autumn.
  12. @stuartsa, you can achieve a step setting for InputfieldInteger / InputfieldFloat / InputfieldDecimal by a couple of hooks in /site/ready.php: // Add a step setting to InputfieldInteger / InputfieldFloat / InputfieldDecimal $wire->addHookAfter('Inputfield(className=InputfieldInteger|InputfieldFloat|InputfieldDecimal)::getConfigInputfields', function(HookEvent $event) { $inputfield = $event->object; $field = $inputfield->hasField; if(!$field) return; /* @var InputfieldWrapper $wrapper */ $wrapper = $event->return; /* @var InputfieldText $f */ $f = $event->wire('modules')->InputfieldText; $f->name = 'step'; $f->label = 'Step'; $f->value = $field->step; $f->showIf = 'inputType=number'; $wrapper->add($f); }); // Add step attribute to InputfieldInteger / InputfieldFloat / InputfieldDecimal $wire->addHookBefore('Inputfield(className=InputfieldInteger|InputfieldFloat|InputfieldDecimal)::render', function(HookEvent $event) { /* @var Inputfield $inputfield */ $inputfield = $event->object; $field = $inputfield->hasField; if(!$field || !$field->step || $field->inputType !== 'number') return; $inputfield->attr('step', $field->step); });
  13. Saving only 200 items with the method in the previous post takes several minutes in production. How do we optimize this and where is the repeater api reference page ? Someone has a clue ?
  14. Hi. For some reason, without doing any changes on my part to the PW install over the last 2 years, the image extra field that I had set up disappeard just now from the edit page: I have setup the image field with a custom text input as follows: But I do not see this with the image when editing a page: In the database, the field is available and filled for all "old" pages that were created a while back: [Note: I have just now, after the issue occured, manually changed the default in the table from None to "" as it otherwise would not have allowed me to upload any new images] Did anyone encounter this before? How do I get the field back to show when editing pages? Any help would be highly appreciated! Best Lars
  15. Just did that. https://github.com/processwire/processwire-issues/issues/914
  16. Yesterday
  17. Hey gents. I've been asking myself this question for quite a while now and even though I've completed some projects purely and entirely out of PW core + free modules, I've been always envy of the simplicity in code and to minimize the database/website load. As it appears, in times when I had to revise some of the profiles code I was finding a better and simpler approach based on some shared recent or good old (but not forgotten) tricks by all the smart persons presenting this amazing ProcessWire community. The more I analyze the code, the more strong need I feel to get the ProFields module for several reasons: a.) All the advice and help that have lead me to my present skills were kindly given absolutely for free with no questions asked and no matter if the answer was helping me generate some revenue. I am 100% convinced that I "owe" back to the community and its major developers the support (my 5 cents back ) b.) Being a bit selfish - I would really like to spend less time on a project while still delivering the same if not much better and simpler solutions. To achieve all this, I would need the tools kindly included in the "ProcessWire toolbox" called ProFields. Initially my plan was to build a few profiles, generate some revenue and then spend some of the finance to purchase the tools needed, however most of the profiles I've built were for personal or close friends/relatives from which I did not generate much out of respect. But I've learned that with the proper tools, even when I am "working for pennies" I can complete the project faster/easier and move on to the next of kind. c.) As it was previously mentioned, everybody is in a need of a stable financial position as otherwise no matter how good is the will, everything seems to be doomed to an end of a failure. By buying the ProFields module, I would not only support the respectful development team, but also the community itself as the new releases, modules, tweaks etc. would keep on going. To me - this seems like a healthy recipe of success. d.) Not sure about others, but at least in Canada I am allowed to claim some work related expenses while working as a self employed, so I have a choice to either give/share my money with the developers team or to give them to the government in the form of taxes. Well, let's just say I got tired of paying taxes e.) The words: "free for life" or "use on as many websites you want" got me by surprise. Most of the platforms I am aware of are selling their licenses per user, per device, per website etc. but I have not seen a single one stating that I can use a bunch of modules to sell websites etc. and that can go on and on to as many users as I can convince of my skills. I have some pre-sale questions, but I am sure that everything is as well covered as it is with all the freebies so I will not pose some, wait for answers and waste more time on this. I am about to start working on a new project where I clearly stated that without the tools I need, I won't be participating so I am very much eager to start "playing" soon with all the masterpieces included in ProFields. I just wish that the price was in Canadian dollars or at least I've bought the license at the time when CAD to US was 1.04 to 1, but hey - it is an economy driven situation so there is no one to blame on this other than myself waiting for so long.
  18. According to here: https://www.php.net/manual/en/function.curl-setopt.php It does look like it's the same, those two dots at the end seem to indicate the password is coming, though stripe doesn't seem to need it.
  19. I've been working on this a looks like it WILL require a change, as it now requires you update your payment journey to use PaymentIntentions, e.g. setting a intent to pay at the beginning of any payment checkout before actually requesting card information, address, email etc etc... I'm currently having to do this for my clients and adding support for Stripe Elements. Love this to be robust butI'm simply not a very good backend dev so muddling through it. Will release what I have when it's done hopefully in a week.
  20. @Robin S 1. Yes, I am using a parent-child relationship and for the moment it would be enough even when a post can only be in one category. 2. The little snippet of Gideon if($page->path == "/categories/cars/") { Do your thing here. } is already totally fine and I do not need much more functionality. I only would need something like in (my own pseudocode comes now): if($page->path == "/categories/$variable/") { echo $variable->title; } If the url is /categories/cars the output should be all posts in category cars. If the url is /categories/airplanes the output should be all posts in category airplanes 3. There would be no problem at all with all my mentioned code above if I only knew which are categories I will need in the future but I don't know that becaus the end user will be allowed to drop new childrend under the parent "categories"
  21. Please note that I intend to post this on the other thread, which I see now. However, our current forum software does NOT allow deletion of replies.
  22. Thank you @Robin Sand @tpr for taking the time to respond. I tried Robin's solution and worked beautifully thanks. It's working well, I've enabled that option in one of my sites and I'm about to do it for all of them. Even though I had gone through the field options in the body field, I somehow missed the "Counter" option! [facepalm moment] I really appreciate this. I had no idea this feature was already in ProcessWire! So, no need to add it to wish list. Sorry! I will mark the thread as solved, and maybe a moderator would be kind enough to move it out of wishlist category... or is that something I can do myself? Anyway thank you both for solving the problem and hopefully anyone searching the forums will now see that this feature already exists.
  23. @dragan Thanks for the tip, I fixed this alongside with a couple of other issues. The tool was throwing JavaScript errors that I couldn't figure out. For some reason one of my non-Vue components wasn't being transpiled by babel at all, so Google had trouble with the syntax. I have now rewritten the component as a native Vue SFC and added some more polyfills. Now it's finally working for me, and the mobile-friendly checker shows the rendered page correctly ... Hopefully it will improve the indexing situation
  24. Nice module, but I would prefer push notifications dependent on used browser only instead of an additional push provider. It works with that demo cross browser (with system-worker web push api support). https://webpushdemo.azurewebsites.net/
  25. Last week
  26. @BitPoet's groupBy() hook is nice for this sort of thing. As with @teppo's suggestion, you'd have to do a bit more to get it working with infinite scroll (the limit might fall in the middle of a day, in which case you wouldn't want the day heading added again on the next pagination).
  27. Hi everyone! Reviving this. I have a PageArray with pages with two different templates, both with different date properties/fields which need to be used for sorting. Anyone got a suggestion for this? EDIT: Found this solution from @LostKobrakai which might work. I'd wonder if I could simply do the sorting right in the db like @LostKobrakai suggests.
  28. That trailer though is pretty epic.
  1. Load more activity
  • Create New...