Jump to content

horst

PW-Moderators
  • Content Count

    3,676
  • Joined

  • Last visited

  • Days Won

    78

Everything posted by horst

  1. Hi @elabx, thanks for the suggestion. I finally came up with a solution combining the hook and special names in the template flags. So with my example from above, I add a tag with the name allowedonly4-basic-b to the template that should be allowed only in the sub directory of basic-b, but not in other sub directories. $wire->addHookAfter('ProcessPageAdd::getAllowedTemplates', function($event) { $pages = wire()->pages; $parent = 'sub' == $pages->get(wire('input')->get->parent_id)->template->name ? $pages->get(wire('input')->get->parent_id)->parent() : new NullPage(); if(0 == $parent->id) return; $templates = $event->return; foreach($event->return as $template) { foreach(explode(' ', $template->tags) as $tag) { if('allowedonly4-' == substr($tag, 0, 13) && substr($tag, 13) != $parent->template->name && isset($templates[$template->id])) { unset($templates[$template->id]); } } } $event->return = $templates; }); With this combination I now can create templates allowed only for one or two defined sub directories.
  2. This is weird. Please can you post an issue on GitHub with this, so that Ryan gets informed about it?
  3. Have you also tried this: $page->image->width(1280)->webp()->url
  4. If you only need a single word, whats about $session->forceLogin('aSingleWord')? The you need to present a single input type text in the front end, check if the typed word matches a harcoded one an then use forceLogin().
  5. @antpre is it not possible to use one generic username? I know sites with download sections for press and they have a user named press with a good human readable password.
  6. horst

    WireMailSmtp

    Not both! - either TLS or SSL
  7. Hi, PIM doesn't have webP support. It was written years before webP support comes into core, and it needs to be completly rewritten. (I also have started 2-3 times, but far from finishing. No time for it 😞 ) You may use a (clumpsy) workaround. First create a watermark image with 100% quality an sharpening = none, and then finally pass it through the core width() or size() function. This way you can use what ever webp strategy you like as it is always delegated to the core image handling. Downside is one additional (intermediate) variation in the chain. $options = ['sharpening'=>'none', 'quality'=>100]; $image_intermediate = $prop->images->eq(0)->pim2Load("wtm",true, $options)->height(480)->watermarkLogo($watermark, $position='center', $padding=2)->pimSave(); $image_url = $image_intermediate->height($image_intermediate->height)->url; // saves the image with 480px height, but with all default settings for quality, sharpening, webP, etc.
  8. Hi, I have a situation where I use settings in my templates that only ONE template sitewide can exist, or (via a module) for some templates I select only "One Per Parent". But this is not enough for me. πŸ™‚ home-| |-basic-a-| | |-sub-| | | | |-basic-b | |-sub-| | |-specialOnlyOne-And-inSubFrom-basic-b | |-basic-c | |-sub-| | | | This page-tree above is my setup: basic-a, basic-b, basic-c are different. SUB is all the same. Is it possible to create a specialTemplate, that is allowed only One page sitewide, but also should NOT available in the template DropDownSelect for new pages, if the page is not a child from sub under basic-b?
  9. Better then trying to repair a crashed table is hopefully having a backup and restore it? And before start trying to repair, I would dump another snapshot.
  10. Ok, when you want to hide the merge or collision handling away from the editors, you have to make the auto process aware of opened pages, and maybe the opened one should be excluded or queued for later processing. Or: Is it right that the auto process modifies not the same fields that editors do? If so, maybe it is possible to hook into those page saves and then only save content to fields allowed by user roles? Foreach allowed field setAndSave (Sorry, on mobile)πŸ˜‰
  11. In the documentation or somewhere else bound to the User Activity module you can read that the core Notification System already has some bare features available, like detecting multiple users or tabs with the same opened pages. Maybe looking into it can reveal some useful bits. ??
  12. @Crowdland Technology Many thanks. I have fixed it in the Github Repo.
  13. ... and I thought that we in Germany are already tortured with extreme detail. πŸ™‚ Thanks for sharing the explanations!
  14. The wire and wires cookies are simple session-cookies. They are allowed without permission of visitors. Besides no OptIn is needed, we also do not have to provide an OptOut.
  15. For me that looks like a perfect fit. I use a lot different cheap hosting services, whereas the costs of them are between 4€ to 6€ per month.
  16. Hi @michelangelo, what's about pagination? As you mentioned the skyscraper site, if I remember right, it also uses pagination. And besides pagination you should use caching. If possible, you should use ProCache. But there is also template caching and more available.
  17. horst

    WireMailSmtp

    Have you debugged $config->admin_site? What is it? Your PW instance object? What debug output does it show when you call $config->admin_site->wire('config')? Also I had understand that your WireMailSmtp is installed and configured in the website-instance, not the admin-instance? Can you clarify that, please? Which instance is the current started (running)? I thought the admin_instance, is this right? Where is the WireMailSmtp installed and configured? I thought in the website_instance, is this right?
  18. horst

    WireMailSmtp

    Yep, there are these line(s): if (isset($_GET["submit"])) { //...... $mail = wireMail(); This is very unspecific. You need to call explicitly a WireMail object from your desired instance! For example, if you are starting in your admin_instance, how do you fetch up your website_instance? You need to check if you really have an own instance of your $website_instance in your $admin_instance. If yes, pick up the $website_instance at that point above in the code and call the mail function of that instance: https://processwire.com/api/ref/wire-mail-tools/ As pseudo code: if (isset($_GET["submit"])) { //...... $myMailHandler = $myWebsiteInstance->wire('mail'); // or something like that Also, in your code above you are using and overwriting(!) the predefined $mail variable, what should be omitted. Instead use your own name for that special instance mailhandler.
  19. Best bet is that the DollarSign and the following character was interpreted as a PHP variable. Try also paswords like: MyNiceStringStopsHere!$andNotHere Or test with 'single-quotes' surrounding the password, if it currently has "Double Quotes". πŸ™‚
  20. horst

    WireMailSmtp

    @MarkE, it is not necessary for me to know what and which forms you are using and how you have organized this. πŸ™‚ I only want to know where and how you call the WireMail object. Is it in the runtime markup field? Where and how do you call it?
  21. horst

    WireMailSmtp

    Can you give concrete examples to the following? Are you able, and if so, how do you create your instances instance_A and instance_B, and which one is called from where? You have to be aware that WireMailSmtp supports PW Versions up from 2.4.1 until now. There wasn't any multi instance available and it can be that it is not easily possible to implement it into the module. But it can be possible to find a simple to use and easy to maintainable way. Therefor, I need to know how you are using it, how the code snippets look like. Where is your instance_A, where your instance_B, how do you create the second instance, where and how do you call the wireMail object?
  22. In the Pro Modules Support Forums, namely or mostly in the first post of the threads?
  23. If you really have in your final PW site pages that do have complete content for a secondary language, but an empty default language, you may try the following: For the default language only populate the title field with a indicator string like "onlySecondary" or what you find useful here. Than populate all secondary language fields with your content and let all default ones empty. If this is possible, what it should be, if you not have flagged any fields as required, you can simply filter with one addition to your selectors, that exclude pages with the indicator string in the title field. SO also hacky, but maybe acceptable regarding of the format and amount of your content and languages. $mySelector = 'YOUR PREVIOUS SELECTOR FOR PAGES HERE' . ', title!=onlySecondary'; The only field(s) every page (in default language) needs is the title field and the name field what gets auto created from the title field.
Γ—
Γ—
  • Create New...