Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 01/31/2019 in all areas

  1. It's been some time since I read the blog-post, but I really need to ask if we need the magic functions for the sanitizer, especially the grouped ones. They're hard to document, harder to be used for automated setups – where used sanitizers are aggregated by some coded means – compared to having them as parameters and I would say they're hardly simpler for manual usage over proper parameters. Personally I'd really vote for one clear way instead of having even more ways to do the same. For me there's also the reason that I find it way cleaner to work with data a.k.a. an array of sanitizer names vs. some magic naming, but that may just be me, but I think we really need to be aware of the backdraws of having to many options to do a thing in general.
    4 points
  2. I used to be all about sending via SMTP, but it seems to be getting harder and harder to find a service that doesn't end up screwing you with limits at some point, or they decide you're spamming, or the deliverability is compromised. I have become a big fan of MailGun - should be free for your needs and the PW MailGun module works great - it's also faster than sending via SMTP. Be sure to grab @Macrura's new fork of the module from: http://github.com/outflux3/WireMailMailgun/
    4 points
  3. <div id="result">Ajax</div> <script type="text/javascript"> $('#result').click(function () { var ajaxUrl = "https://example.com/ajax-page-name"; //not template path $.ajax({ type: "GET", url: ajaxUrl, success : function(data){ var markup = $(data).find('#result'); $('#result').html(markup); } }); }); </script> You need to call the URL of the page itself, not its template path. ?
    3 points
  4. ElasticsearchFeeder This ElasticSearch module for ProcessWire will sync your page content to an ElasticSearch index, which provides you a convenient way to search it. Thanks to @jonathan-dart who created the first ES Module for PW and which influenced us a lot. Our approach was to create an a module where we can make for each template a flexible schema. You can define on you own which data ind which format should be transfered to ElasticSearch. Github Page: https://github.com/blue-tomato/ElasticsearchFeeder Module Page: https://modules.processwire.com/modules/elasticsearch-feeder/
    2 points
  5. Hey, I'm new and I created a simple module for tagging pages because I didn't found a module for it (sadly this is not a core feature). This module is licensed under the GPL3 and cames with absolutly no warranty at all. You should test the module before using it in production environments. Currently it's an alpha release. if you like the module or have ideas for improvements feel free to post a comment. Currently this fieldtype is only compatible with the Inputfield I've created to because I haven't found an Inputfield yet, that returns arrays from a single html input. Greetings Sebi2020 FieldtypeTags.zip.asc InputfieldTagify.zip InputfieldTagify.zip.asc FieldtypeTags.zip
    2 points
  6. Hello all, I've just pushed a rather alpha version of this module to a new branch on github. The localisation branch adds a few new features that might be of interest. Update default countries list (in English) with names from the country-list project. Use LibLocalisation (if installed) to localise country select lists in the Inputfield. Allow localisation of config and inputfield select lists to the language of the user's browser. Switch to storing ISOs in uppercase, can still handle stored lowercase ISO codes. Unify country list loading code. Detect changes to input address when saving page. Add compatibility with FormBuilder. You'll need to do a manual update from the new branch to try this out. Backup first please. I'm pushing this now in its alpha-state, as I've had a few health problems recently and don't want to hold off making this available any longer.
    2 points
  7. Damn, I hoped it's a new feature related to water, sugar and coffee beans ?
    2 points
  8. @MrSnoozles You could use this one: https://processwire.com/api/ref/sanitizer/page-name-translate/ Define Umlaut-Translations (ä = ae, ö = oe, ü = ue) here and it's done: uehttp://domain.tld/processwire.admin/module/edit?name=InputfieldPageName&collapse_info=1 I drink Jägerbombs would result in i-drink-jaegerbombs. Or do I get you wrong on this?
    2 points
  9. Something I've been wanting to add for a long time. Favicon server indicator badges. These show the first two letters from the subdomain / tld settings you have configured in the Tracy settings along with the configured colors. This is a new option available from the Server Type Indicator settings section: Just another attempt to help you from accidentally working on the wrong version of a site. Please let me know if you guys find any problems with it.
    2 points
  10. 2 points
  11. I'd simply combine the two options.
    2 points
  12. Hi @a-ok Take a look at this part of 3.0.87 blog post https://processwire.com/blog/posts/pw-3.0.87/#new-field-template-context-settings
    2 points
  13. After trying @wbmnfktr suggestion of turning off bluetooth (I also deleted wifi and re-set it up), the wifi seems to be working fine for the last couple of days.... fingers crossed. Although crossing fingers and hoping for the best is no substitute for it actually working like it should!
    2 points
  14. +1 These magic functions are "hard" to decode when reading, at least it is a syntax no one is used to, so when people come across things like this they will just get confused. Generally speaking, it is great to have options but if more and more ways are implemented to do very same thing, then when one is looking at someone else's source code it will become harder and harder to decode it if it was written in "another dialect" of the ProcessWire API than one is used to. If this trend continues, reading ProcessWire source code will become harder than it should be.
    1 point
  15. I also agree with @LostKobrakai
    1 point
  16. Probably a permissions issue with the site/assets/files folder - check that the owner and perms match what you had in the staging setup.
    1 point
  17. As first discussed here: https://processwire.com/talk/topic/20596-new-post-new-pw-website-ready/?do=findComment&amp;comment=178781 Here is the next version of the searching interface. You can see how it automatically populates the module class name in the field from the matches based on what you have typed. This is basically ready to go if Ryan is willing to incorporate. Now we just need to figure out a browsing/filtering interface to make it easy to discover modules base on categories and keywords.
    1 point
  18. Wow... thanks @adrian. This didn't show up on my radar but it's a big step forward and probably already the solution. I will definitely try this. The amount of 404 errors in this case is actually quite low (~100/month) and will not end in a performance issue. But you are correct. This could become an issue especially in the first time after moving a WP site over to ProcessWire. The optimization guide is great and I already had to dig into it once.
    1 point
  19. Not sure I really recommend it, but you could take a look at: http://modules.processwire.com/modules/process404-search/ It parses the URL from $_SERVER['REQUEST_URI'] and returns search results that match the url segment. Keep in mind that if anything, it is recommended to have a static 404 page, rather than one that does even more db queries: https://processwire.com/blog/posts/optimizing-404s-in-processwire/
    1 point
  20. Thanks @flydev ! Got it!
    1 point
  21. Hi and welcome ! Great first contribution ? FYI there is one similar field (I think) based on Chosen there : @Sergio https://github.com/sebi2020/InputfieldTagify https://yaireo.github.io/tagify/
    1 point
  22. Hi @Zeka... thank you, yes the problem was that doesn't show up the file in the list. But I found the solution just now: In the end on the page there is a button: "Refresh File List" Just press that button! ? I didn't before because look like with disable class but it works. Now the list it's update.
    1 point
  23. Or with AdminOnSteroids' FieldOverrides feature: https://github.com/rolandtoth/AdminOnSteroids/wiki/FieldOverrides
    1 point
  24. Fully agree with @LostKobrakai. I guess a well documented ->sanitize() method would do, I'd say those magic methods are more confusing than helpful. Also I originally came here to comment that a "slug" sanitizer method that also handles Umlauts would be an awesome addition too. "I drink Jägerbombs" -> "i-drink-jagerbombs"
    1 point
  25. Mailgun is really great, I love it. But if you want something to install on your server, try Sendy https://sendy.co/ with which you can use Amazon SES to send thousands of emails a year for pennies. But beware that you need to pay attention to your reputation on Amazon SES as Sendy do not track that, otherwise you can get your account disabled. It happened with a client, but it was Amazon's mistake and after a couple of emails explaining the situation, they enabled it back.
    1 point
  26. Holy shit! That was fast. Thank you very much, Robin!
    1 point
  27. I've added support for CKEditor within a Table field in v0.1.10.
    1 point
  28. Just a follow up in case anyone is interested. On a separate project I needed to get into grouped OR selectors and I decided the easiest way is to create a standard array and simply do an implode on it, eg: $selector = []; $selector[] = 'user_types='.$u->user_type; $selector[] = 'ages=(ages.count='.$pages->count('template=age').'), ages=(ages='.$u->age).')'; $selector[] = 'sexes=(sexes.count='.$pages->count('template=sex').'), sexes=(sexes='.$u->sex.')'; $selector = implode(', ', $selector); This is back to how I used to do things and I feel like this is almost as clean as the selector array approach and so much more flexible.
    1 point
  29. Yeah, this is a little painful. I use the same approach in Tracy. I think it might be better if Ryan replaces that json detection code with the following which seems to be the most common approach to problem. /** * is the provided string a valid json string? * * @param string $string * @return boolean */ public function isJson($string) { json_decode($string); return (json_last_error() == JSON_ERROR_NONE); } PS - actually maybe this isn't useful at all with this issue, but in general I think he should be using a function like this for determining if a string is JSON.
    1 point
  30. You have to make the ajax call with the url .. not the template file. Make sure you have created a page with that template. $.post('ajax.inc', function(e) {}); $.post('/path-to-ajax-page', function(e) {}); Example Ajax Template from different db: $mydb = new Database('host', 'username', 'password', 'db'); $result = $mydb->query("SELECT * FROM example"); from pw db: $query = $database->prepare("SELECT id, name FROM pages LIMIT 10"); $result = $database->execute($query); Your js $.ajax({ type: "GET", url: "/path-to-ajax-template", success : function(data){ var markup = $(data).find('#result'); $('#result').html(markup); } });
    1 point
  31. @Robin S Good point, I need to update that phpdoc in that file and will. I think it'll be more convenient for users if I keep it up to date with Sanitizer, rather than removing it completely. At least I like my code editor being able to recognize them as function calls rather than errors. As far as I know, there's not anything we can do phpdoc-wise to cover instruction methods (like text50_entities), since there's basically an infinite possible combination of them. Though will be translating the blog post into regular documentation for these new additions.
    1 point
  32. There is no reason for that. The TypeCover is way more durable than most other keyboards. I have had a linux sub-system installed. That did a great job. As I don't need CLI that often I removed it a while back and use the PowerShell if necessary.
    1 point
  33. Well set() sets a property to the data property which is PW specific. I think it's mostly used to make it distinct data for a module or object and set data to a WireData module which is used to save data to DB like module/class configurations, change tracking etc. Defining a property directly in the class body makes it just a normal class property which PW doesn't threat special and it won't be in the data array. protected $foo = "bar"; // standard class property - and then set foo using set() $this->set("foo", "baz"); // set data array only $this->foo = "bar2"; // set the class property - You'll end with two "foo" which are not the same $this->foo // bar2 $this->get("foo") // baz (from data array) But If you don't set a class property and only use data array or set(key, value) to define a PW data property $this->set("foo" , "bar"); $this->foo = "bar2"; is the same "foo" Just look a the WireData class
    1 point
  34. I do it usually as follows: 1.) Create a file /site/translations.php <?php namespace ProcessWire; /** * TRANSLATABLE STRINGS * Define globally available translatable strings * * USAGE * place this file under /site/translations.php * __("My translatable string", $ferry); * The wire property $ferry refers to the textdomain of this file * */ __("My translatable string"); 2.) Define a wire derived object and place it in /site/ready.php /** * TRANSLATABLE STRINGS * Include translatable strings * @see /site/translations.php * @var $ferry */ $this->wire('ferry', '/site/translations.php', true); output in any template /** * output in template */ echo __("My translatable string", $ferry); Now you need to translate it only once, by using the string in any template. Usecase: strings like "read more" etc. For strings specific to a template you can use simply: /** * output in template */ echo __("My translatable string");
    1 point
  35. $pages->addHookAfter('saveReady', function($event) { $pages = $event->object; $page = $event->arguments(0); //check if on template if($page->template == 'item') { //is the checkbox checked to add children if ($page->add_children == 1) { //get the values in the page field type field foreach ($page->page_assignment as $child) { //if selected pages have childen if ($child->numChildren > 0) { //loop through those children foreach ($child->children as $grandchild) { //set values. $page->page_assignment->add($grandchild); } } } } } I figured it out. Two things to change if anyone is looking to do the same. 1. Use the right hook. saveReady instead of save. 2. Add the page object. $page->page_assignment->add($grandchild);
    1 point
×
×
  • Create New...