Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 01/12/2023 in all areas

  1. @MarkE, besides the autojoin setting in admin that's mentioned in Ryan's post, you can also set autojoin programmatically when you get one or multiple pages. For multiple pages ("find") see the blog post: https://processwire.com/blog/posts/find-faster-and-more-efficiently/ And if you only want a single page ("get") then you can use "joinFields" in the $options argument, e.g. Edit: it seems you can use the "field=" syntax described in the blog post with $pages->get() and $pages->findOne() too...
    3 points
  2. 140 commits, 55 resolved issues, dozens of new features, eight contributors, and five new pull requests make yet another great new version of ProcessWire. This week I’m happy to announce another new main/master branch version of ProcessWire, version 3.0.210. Like most main release versions, there is a lot here. This post covers some of the most notable additions and improvements— https://processwire.com/blog/posts/pw-3.0.210/
    2 points
  3. @bernhard shows us how to do this with Custom Page Classes here:
    2 points
  4. You can use your free Gmail account with the free module WireMailSmtp by @horst First make sure you have enabled 2-Step Verification on your Google account. Then create an App password (you gonna need it for WireMailSmtp). Check the screenshot below: Next on WireMailSmtp settings make sure to add the following: Local Hostname: yourdomain.com SMTP Hostname: smtp.gmail.com SMTP Port: 587 SMTP User: youremail@gmail.com SMTP Password: the app password you created on Google account (NOT your Google password) Use START-TLS: Checked Select a crypto method for TLS: STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT Sender Email Address: youremail@gmail.com Sender Name: Your Name I tested the above few months ago and worked fine with a free Gmail account, then I bought Google Workspace so I can use my custom domain instead of @gmail.com.
    2 points
  5. Thanks for educating me on how I should develop my free and open source modules 🙂 I hope you don't mind that I went a different route and added a check if RockFrontend is installed or not. Everything works without RockFrontend now as of v.1.0.6 Thx for spotting and reporting that issue.
    2 points
  6. Field values for a page are loaded from the database on demand (i.e. as you request them) unless you have set them to be "autojoined":
    2 points
  7. I have been using this module for a long time and it's been incredibly useful so I thought it was time to share. It's great for fields where you want to instruct content creators to reference something about a the page, its template, or its parent, or grand parent, etc Specify fields/properties of the page in your field's Description or Notes content, eg: [page.parent.url] [page.title] [page.template.label] You can also define a str_replace to be performed on the returned value, eg: [page.name.(-|_)] which will return the page name with the dashes replaced with underscores. An option to allow raw HTML is available. You can also use hanna codes within your description and notes fields - big thanks to @Robin S for this idea. http://modules.processwire.com/modules/dynamic-description-notes/ https://github.com/adrianbj/DynamicDescriptionNotes/ Hope you find it useful.
    1 point
  8. Yes I know about the aliases but I don't prefer that method because: If your recipient uses Outlook or another mail service, they might see something like, "From yourname@gmail.com on behalf of othername@otherdomain.com." Your recipients might also see your original @gmail.com address if you: Set up an out of office reply Create a filter with automated response Have a full mailbox, and your recipient gets notified Info taken from the Google.
    1 point
  9. Hi @bernhard, I'm not 100% sure if it's correct to assign it to RockFrontend – today I found a strange one: I'm using a field FieldtypeOptions v0.0.2 with value and title as entries. It's config is radios = only single value. I'm used to call it as noted in the api example: // Ausgabe einer einzelnen Auswahl: echo '<h2>' . $page->test_options->title . '</h2>'; // Ausgabe mehrerer Auswahlen: foreach($page->test_options as $item) { echo '<li>' . $item->title . '</li>'; } Actually it's output is different in context with RockFrontend and its renderLayout() function. One has to use the ->first() call to get the title, otherwise the page-title gets rendered instead. This is the case in any template file, if it's a section.latte or main.php … same thing - please see attached screenshot. Any ideas what's going on? It's not a big thing, but it took me some time to figure it out and maybe worth fixing it with regard to compatibility. The field settings: 'test_options' => [ 'label' => 'test-options', 'flags' => 0, 'type' => 'FieldtypeOptions', 'inputfieldClass' => 'InputfieldRadios', 'optionsLang' => [ 'default' => [ 1 => 'a|ONE', 2 => 'b|TWO', 3 => 'c|THREE', ], ], ] 2023-01-12_18-28-41.pdf
    1 point
  10. May someone else finds this helpful. I wanted to create comments (using built-in comments fieldtype module) via API, as I needed this is for an easy migration from an existing site. I figured following does the job: <?php // get the page that you want to add comment(s), contains a "comment" fieldtype $p = $wire->pages->get("/guestbook/"); // create new Comment object $c = new Comment(); // fill the object with values $c->text = "Hello World!"; $c->cite = "John Average"; $c->created = time(); // timestamp, if you got to migrate a existing datetime you can convert using strtotime("2011-04-09 15:14:51") $c->email = "john@average.com"; $c->ip = "..."; // not needed (only for akismet) $c->user_agent = "..."; // not needed (only for akismet) $c->created_users_id = "..."; // not needed, automaticly set by pw // set status (Spam = -2; Pending = 0; Approved = 1; ) $c->status = 1; // add new comment object to the page "mycomments" field $p->mycomments->add = $c; // save page $p->save(); ?>
    1 point
  11. @elabx - I found the same as you that the only way was to do a direct SQL update. Just looking and this problem seems to be around forever based on this really old code: https://github.com/adrianbj/ProcessMigrator/blob/master/ProcessMigrator.module#L1707-L1714
    1 point
  12. Since it wasn't working, I've uninstalled AdminStyleRock and followed the instructions from here. You should mention somewhere on AdminStyleRock module or it's page that specific field to work requires the RockFrontend module to prevent confusion.
    1 point
  13. https://www.mailersend.com/ is also a good option and you can have a look at https://github.com/baumrock/RockMailerSend (no docs at the moment and not officially released yet)
    1 point
  14. Looks like there is an exitIf node now 😉 But it seems there will be no include with condition and only one template 😞 {if $foo == 'bar'}{include 'somefile.latte'}{/if}
    1 point
  15. I just found this today and started implementing it; but alas it is dead without the new license. I too would love something. Anything.
    1 point
  16. This is a s lightly obscure issue, but hopefully very easy to deal with. If a page only has one child, then the child doesn't necessarily have a sort attribute. In this case, BatchChildEditor will add a sort attribute and save the page. This seems to me to be unnecessary (and is causing a small problem with a module of mine). Is it possible and reasonable to not set the sort if there is only one child? The relevant code is at the end of the saveChildren() method: $cp->sort = $i; if($cp->isChanged()) { $cp->of(false); $cp->save(); } I think it would need something like: if($this->wire('input')->post->individualChildTitles->count() > 1) { $cp->sort = $i; } if($cp->isChanged()) { $cp->of(false); $cp->save(); } but maybe there is a better solution?
    1 point
  17. @teppo - new hook, eval replaced, and composer support added in the latest version. Thanks for the feedback!
    1 point
  18. One more thing: I'm wondering if there's some use case where current way of getting properties via eval is necessary? I don't see anything technically wrong with that, but would feel better not using eval at all, and it tends to get flagged by security audits etc. This seems to achieve largely similar results, at least in latest PW version: $replacement = $p->get(implode('.', $properties)); Again my use case for this module is very limited for now, so may be missing something important.
    1 point
  19. Hey @adrian! Might be a strange use case (considering that it doesn't seem to be supported yet), but I'd like to use this module for a field that's locked (non-editable). Looks like hooking into Inputfield::render won't work in this case, while Inputfield::renderReadyHook does work. To be honest I'm not sure what else that might change/break 🙂 I've made that change locally since this is indeed something I need, and so far it seems to work (though not much testing done yet). Also... have you considered updating the module to PW3? I mean adding the namespace, mainly, so that module compile wouldn't be needed. And it would be great to have this module installable via Composer. Food for thought 🙏😄
    1 point
  20. That's awesome. I hope to have time tomorrow to check it out.
    1 point
  21. Everything that offers SMTP would fit here. In case you don't send hundreds of mails a week you could just send it from your server, or setup a very own mail account on your hosting and send mails - with WireMailSMTP of course. With WireMailSMTP you could use a lot of services via SMTP - even Mailgun. Some others would be Mailjet, Sendinblue, Sendgrid and some others. Some are easier to configure than others. I personally use Mailjet's free tier on small or personal projects. The limits are totally fine with 6,000 emails/month or 200 emails per day. In client projects I most often stay with Mailjet but on a paid plan starting at around 15 EUR/month.
    1 point
  22. Hi, just wanted to add, that hyphenation is also possible via CSS, so adding a class (via a custom entry in Styles) might also be an option. Here's a good intro: All you need to know about hyphenation in CSS | by Richard Rutter | Clearleft Thinking | Medium
    1 point
  23. Today I realised that one of my sites has around 13k rows in the caches db table (20MB in size): The site is powered by RockMigrations automatic deployment so the folder structure on the server looks like this: According to @adrian this issue has nothing to do with TracyDebugger, so I wonder if anybody of you has seen a similar problem before and can help me debug/fix this? Thx! PS: Is it maybe as easy as deleting all FileCompiler_ rows on each RockMigrations deployment? PPS: Seems like a possible solution, or does anybody see a problem with doing this on every deploy? PPPS: Ok found the other bad guy: ProcessJumplinks 😄 Before: 20MB Removed FileCompiler Cache: 10MB Removed Jumplinks Module: 3MB 😎
    1 point
  24. Okay so I published the update fixing the issues. And for your case @wbmnfktr I added an option where you can disable the minification if it's messing your layout. By default MJML adds a lot of clutter (whitespaces) in the code and my module is pretty agressive (dumb?) in the way it handles this. So in such case, this option will help out, though you'll get a heavier code (better this way than a non-working one heh). Please let me know if you notice any other issue.
    1 point
  25. When I started Joomla was still called Mambo. At that time it was quite easy to modify the code to get the desired result; the examples were freely available. That changed with time. Joomla became more and more complicated and the extensions more and more commercial. Seblod was a breath of fresh air. With that you could make what you wanted if you were willing to spend a lot of time searching and studying. I only used the forum to search existing posts. With Joomla 4 it's all done with freedom and joy. Seblod has collapsed and the owners of Joomla-Seblod websites have nowhere to go. At least that's how it seems. Until I came across Processwire after a lot of searching. It takes time to understand the structure and to get used to the simplicity, but it is easy to do with the different profiles. Yes, Seblod is dead and so is Joomla for me. I've been thinking about posting on the Seblod forum about Processwire. Something stopped me: many users means many hackers. And yet..... this message also goes to the forum of Seblod.
    1 point
  26. Happy New Year! This week we've got ProcessWire 3.0.209 released on the dev branch. Consider this version a release candidate (RC1) for the master/main branch. Relative to 3.0.208, this version contains primarily issue resolutions and minor improvements (commit log). If you have a chance to test it, please let us know if you run into any major issues by reporting them here. So long as no new major issues surface, by this time next week my hope is that we'll have the dev branch merged to the master/main branch for version 3.0.210. This week one of my clients pointed me to https://chat.openai.com/ which is really quite interesting. It's an artificial intelligence that you can chat with, and it knows quite a lot about ProcessWire and how to code in ProcessWire. Though it knows a lot about a lot of different APIs, and actually a lot about everything, not just development related stuff. But I mention it here because of how it appears it's been trained fairly well in ProcessWire. When I asked it for examples of what CMSs it knows how to code for it told me WordPress, Joomla, Drupal and ProcessWire. I'd encourage you to get an OpenAI account to try it out, it can blow your mind. Ask it questions like how to develop a ProcessWire module, how to build a search engine in ProcessWire, how to use pagination in ProcessWire, or anything you can think of. It seems to have an answer for everything. The client that told me about it is currently using it to write AWS scripts for him, and he said it's saving him a lot of development time. What I also find interesting is not just how it seems to have an answer for everything, and that it knows how to code, but also that it makes mistakes pretty regularly, and recognizes those mistakes when you point them out... and apparently learns from them. That's basically how we work. For example, I asked it how to resize an image in ProcessWire and it explained through text and code examples how to use the size() method on image fields. But it also told me that I could use the $options argument to specify the type of resize interpolation (bicubic, linear, nearest, etc.) and ProcessWire has no such option. When I told it that, it apologized and corrected its code example, and also explained more details about the size() method's $options argument. There was another instance where it made a mistake (trying to do a PHP math operation within a string) and I explained that PHP doesn't support that. It essentially said "I know that, but my example doesn't do that". Then I asked it to double check its example because it didn't look right to me, and then it replied (paraphrased) "Oops, sorry, you are right, here's a corrected version." Anyway, it's just kind of funny to me that I'm talking to a computer with these kinds of interactions, and how it seems to "think" and learn a lot like we do. It will be interesting to see where this technology leads. Currently it is a free research preview, where I suppose we are helping to test the AI and help it learn, but it's very interesting and engaging just to talk with it. Also worth noting is that it does not have internet access (other than to chat with people). So it can't go and hunt down information from websites, actually making it that much more impressive in my mind.
    1 point
  27. Use the "Custom find" or "Selector string" options to define the selectable pages for the field, and specify a "sort" in the selector, e.g. "sort=title".
    1 point
  28. Thanks for sharing Adrian! Is it possible to display values from an other language than the default? I would like to inject [page.url] and its counterparts from the other languages into the Title description of a blog page (just what we see in red on the Settings tab, but) it could be a good overview to see something like: /blog/my-nice-article/ /es/blog/mi-buen-articulo/ I'm willing to hardcode the language IDs into it... Another question: what about "custom" php? Or is it out of the scope of the module, because if it is "custom", why not implement it from scratch in the first place?
    1 point
×
×
  • Create New...