Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 09/28/2018 in all areas

  1. Would be nice to have a timer that shows the time to auto-log out. This would prevent losing work when the user tries to save input while the session was terminated in between.
    5 points
  2. I would do this: Backgrounds Use media queries, as you are already doing. Images Use the picture element for art directed images with media queries. That is what its meant for. Content Output all versions of the content in your template and use media queries to show/hide the versions for different devices. If you are using a framework, there are components for this use case: UIkit: Visbility Bootstrap: Display I would strongly avoid user agent detection. ?
    5 points
  3. Hi, just found that we get new CSS framework W3.CSS (from w3Schools). Equality for all browsers: Chrome. Firefox Edge. IE. Safari. Opera. Equality for all devices: Desktop. Laptop. Tablet. Mobile. Standard CSS only (No jQuery or JavaScript library). Also interesting demo section (this, this etc...) Regards.
    5 points
  4. v0.1.3 released, with some new features thanks to a request from Adrian. Any override templates specified in the list items will be created if they don't already exist. You can also set allowed parent templates or allowed child templates for a template within a list item. See the readme or the "cheatsheet" field for the syntax.
    3 points
  5. I've added support for this in v0.2.0.
    3 points
  6. Imo language and country are different things. In Switzerland we have four official languages. Use the Browser's HTTP Accept-Language, if you want a language preset. Geolocation may be the right thing for country specific products or terms of conditions.
    3 points
  7. You don't even need className config()->urls->$this . 'scripts/test.js';
    3 points
  8. great! thx soma! this is also possible and imho the cleanest solution: config()->scripts->add(config()->urls($this) . 'scripts/test.js'); thx ?
    3 points
  9. Ouch! Let's keep fingers crossed that PW 3.0.115 "Cat bite" is not follewed by PW 3.0.116 "Emergency room" !!? IOW: get well soon!
    2 points
  10. I think most of the developers are lazy. That is the reason why I like Emmet. ? But Emmet can't rename the matching closing element, as far as I know. For that I use CMD + D or CTRL + Left Click on macOS for selecting the closing element. Thats a cool feature of the Auto Close extension. By the way, if you are not familiar with Emmet, I would recommend you to checkout the introduction. Especially for CSS it is a real time saver and easy to learn. Just type a few letters + tab. For example: bgc + tab = background-color. You can find all on the cheatsheet.
    2 points
  11. IMHO not without AJAX (which breaks SEO). The (first) request for the page's html happens before any information about screen sizes can be transferred. If it's just images you could: use placeholder images and delay load the correct images through js -> this runs the danger of multiple redraws of the page, which can get really ugly with slow connections or go in the direction adaptive images does by setting a cookie with the screen width (or a resolution indicator) and route all page image requests through a custom PHP script that determines the exact image to serve -> harder on the server and its memory and likely to break caching strategies I'm generally not happy with such approaches, as even screen width (not just browser width) is a dynamic value. The moment I rotate my phone/tablet/monitor, it changes. In the middle of browsing. So to me, adaptive content is mostly a client side problem that needs a client side solution. AJAX loading the relevant content is a possibility where SEO is not a goal (like in corporate intranets).
    2 points
  12. Just want to note that in case of multi-instance usage $this->wire("config")->paths->templates != config()->paths->templates So in modules developement you should avoid using function API.
    2 points
  13. @Robin S Wow, so fast! Thanks.
    2 points
  14. It's not linked to but: http://processwire.com/api/ref/urls/ I learned about this from a blog post: https://processwire.com/blog/posts/processwire-3.0.40-core-updates/#urls-and-paths Pity the docs are hidden. Also a shame there's no $paths equivalent.
    2 points
  15. wow. Thank you very much @adrian the ip service look very nice! I will study the cookie modulo and also probably will implement it on the sites. Thanks again for sharing your knowledge! Yes @theo, I have just find this post. I think will use the HTTP Accept-Language, it's a better way. For the country specific products I will use the geolocation service that suggested Adrian. I will Upload this post when I finish all the code. So, if some one will need in the future. ?
    2 points
  16. I make use of three different free services (in a fallback type scenario) in the Cookie Management Banner module: https://github.com/adrianbj/CookieManagementBanner/blob/945d406d227c821a27be972f3a63ce4c4d44c613/CookieManagementBanner.module#L62-L85 ip.nf geoip.nekudo.com ip.sb You can read a little about my conversation with the ip.nf folks here:
    2 points
  17. Or if you are only supporting recent'ish versions of PW: urls()->$this . 'script/test.js';
    2 points
  18. Some more keyboard shortcuts for the Console panel: CTRL + SHFT + PageUp | One less line in code pane CTRL + SHFT + PageDown | One more line in code pane Unlike the other pane resizing shortcuts, these two save the position of the divider so that it will restore to this position after a page reload. This matches the behavior when you drag the divider with the mouse.
    2 points
  19. Okay guys. This was very hard with much trial & error, but I finally got the solution (which is after all very simple). It is even worth an own blog post on my website: How to disable options in select elements that are already selected in another select element Here is a YouTube video of it in action
    2 points
  20. @Robin S As far as I see the module doesn't update connected fields when pages with "connected" fields are cloned via ProcessPageClone. Do you think is it possible to handle this scenario? P.S. Obviously, in this scenario "owner" operator is more suitable.
    2 points
  21. Updated the module to make sure the filepath exists. I also added an example in the readme how to set a background:
    2 points
  22. So if im in france ill see the french version and not understand anything and cant change it? Sorry happened to me and got really frustrated and simply left the service.
    2 points
  23. Hi all, Introducing a new GDPR Cookie Management Banner module. https://github.com/adrianbj/CookieManagementBanner https://modules.processwire.com/modules/cookie-management-banner/ This module was sponsored by VentureWeb in Squamish, BC, Canada. I converted a Drupal module written by Oliver Walker from VentureWeb into what you see here. The Drupal module requires jQuery so at the moment, this module also requires jQuery. I will probably remove this sometime soon. This module certainly has similarities to MarkupCookieConsent but provides the user with the following features: The user can accept all cookies or they can choose to not accept tracking/marketing cookies. Module config options allow you to: define all text and button labels (multi-language support) manually increment the cookie policy version which forces the user to review their consent again select whether users can manage their cookies, or just accept all option to limit display of banner to users only in European Union (by IP address) position selection (top or bottom overlay, or content pushed down from the top) It comes with basic default styling which is easily overwritten by site CSS The module sets various values to the dataLayer array which works together with Google Tag Manager - please read through the code in /assets/js/CookieManagementBanner.js to get a better idea of how this works and what is made available for GTM. You can wrap your tracking/marketing cookie code in a check for the localstorage key of: pwcmbAllowCookies if(localStorage.getItem('pwcmbAllowCookies') == 'y') You can also provide a link on your site (probably in the footer) like this that will allow the user to show the banner even after they have saved their preferences / accepted. <a href="#cookies" class="js-pwcmb-notice-toggle">Manage Your Cookies</a> Would love to hear feedback from anyone who gives this a go.
    1 point
  24. Last night my cat bit my hand for no apparent reason while he was sitting in my lap. He's a very friendly cat, but also very old and I think may be getting a little senile. It was a deep bite, though didn't seem like all that big of a deal. But this morning my hand was hurting pretty bad, then it swelled up, and then a swelling red line appeared on my skin that went from my hand to my shoulder. I went to the doctor and he said it was a bad one, and if I hadn't come in today I would have been in the hospital tomorrow. Apparently cats have some mean bacteria in their teeth and these kinds of cat bites can get pretty bad, quickly. They shot me with a bunch of antibiotics and now I've got to go see another doctor and get an x-ray because they think that there's a possibility the cat's tooth broke off and may be stuck inside my hand (I hope not!). If the antibiotics do their thing, all should be fine in a few days. I'd planned on writing a blog post today about ProcessWire 3.0.115, but it looks like that's not going to happen (and one of my hands doesn't work so well), so I'll write about it next week in combination with 3.0.116 updates. But if you want to see what's new in 3.0.115 before that, be sure to check out the dev branch commit log. Thanks for reading and have a great weekend!
    1 point
  25. I like the following intro to the picture element: http://web.simmons.edu/~grovesd/comm333/modules/responsive-media/srcset/#art-direction the article links to a simple but good responsive demo page: http://web.simmons.edu/~grovesd/comm333/demo/responsive-media/srcset/art-direction.html Try using CSS Grids if you are concerned that google thinks using display:none is bad for SEO. I've read articles which say it is OK to use them. It is a controversial topic, some say google will penalize the site, some say it does not matter.
    1 point
  26. My wishes for a speedy recovery Ryan.
    1 point
  27. Emmet works in php files with "emmet.triggerExpansionOnTab": true, but the built in Auto Close tags feature stops working in php files for some reason. I'm not sure, but I think I also had to add the following as well to my settings.json: // from https://caffeinecreations.ca/blog/craft-twig-cheatsheet-for-visual-studio-code/ // from https://code.visualstudio.com/docs/editor/emmet "emmet.includeLanguages": { "twig": "html", "php": "html", "javascript": "javascriptreact", "vue-html": "html" }, You can see the VSCode Auto Close tags feature by typing in an .html file <div>tab tab which expands it to <div></div>. In a php file this won't work in my setup at least.
    1 point
  28. Emmet defnitely works with PHP files too. How do you expand with Emmet? I recommend using tab for the expansions: Inside your PHP file you write for example div, then press tab and it opens and closes the HTML tag <div></div>. ?
    1 point
  29. Interesting thought. Maybe a notice similar to when one is editing the same page in two or more places.
    1 point
  30. It's linked to in the GitHub issue that szabesz mentioned, but in case you missed it, there is a hook here for preventing referenced pages from being trashed... ...and from being trashed or directly deleted...
    1 point
  31. Very nice set of classes and all that in only 23 kb ! Good find. Some nice templates too: https://www.w3schools.com/w3css/tryw3css_templates_portfolio.htm
    1 point
  32. Very nice and for sure the best solution ?? maybe you want to take the extra step and pack it into a module so that reusing/updating/improving is easier for you and others?
    1 point
  33. Feature request Can there be an option to redirect the user to another page if they land on a protected page (rather than showing them the login form)? Additionally, if there could be a field by which an admin can enter a custom message (or error) to $session->message("the message"); or $session->error("the message"); that would be really great.
    1 point
  34. Then you have to hook into something. If you want that referenced categories not to display the trash link, then you can hook into the tree render. Or, if you don't mind the display of the trash page link, then you can hook before pages::deleteReady. Alternatively, depending on who is administering the site, you can lock all your category pages and only unlock one you want to delete, at delete time :-). You can check if it is being referenced in a page field by going to the settings tab when editing the category page and scroll to 'What pages point to this one' section.
    1 point
  35. Weekly radio show with Hip Hop, Future Beats, R&B, Soul etc. ?
    1 point
  36. In my experience YouTube always feels a bit clunky in comparison to hml5 video with feels more instantaneos, but could be made to work (I've only got it to be responsive with some js though), I agree the most "slick" solution is to use native html5 video and a CDN. I have personally used AmazonS3/Cloudfront for this.
    1 point
  37. Or you can even use the class name too config()->scripts->add(config()->urls->{$this->className} . 'scripts/createInvoiceButton.js');
    1 point
  38. config()->scripts->add(config()->urls->RockCRM . 'scripts/createInvoiceButton.js');
    1 point
  39. Another snippet promoting the functions api ?
    1 point
  40. 1 point
  41. @joshuag Are there any updates on this awesome module already? Can't wait to try it.
    1 point
  42. I actually stumbled upon these two articles when I did some resarch on saturday and I think I'm getting your point. However I don't agree with all of the statements made there: On the flow chart on the far right it says “I'll just use refresh tokens" which he states couldn't be revoked – afaik usually you save the refresh token in the datebase of your Auth Server and everytime a user wants to refresh a token you check if it is still valid. So e.g. you could hand out short lived tokens (like 5-10 minutes) and everytime it expires the client has to obtain a new token via the refresh token if it's not revoked. In an upcoming project we might have multiple endpoints for different task, where it just sounded good to have an Auth Server which holds all the user information and hands out tokens, which the client uses on the other server to access something. On "Footnote: microservice architectures" of part 2 the autor suggests to use single use tokens to get a session on the other service, which I think means, If I want to revoke a session I need to do it on multiple places right? Aaaanyway, I did some tests with the API Module, sessions and a cross-origin client and it also works quite well, so with 0.0.3 you can choose your auth method in module settings between none / session / jwt
    1 point
  43. ProcessWire API Visual Studio Code Snippets Here is a Gist of all (?) ProcessWire public API snippets for VSC. This is generated from the ProcessWire Cheatsheet. Some stuff needed manual cleanup. I also removed the stuff from the selectors section. I could have missed something, please let me know. Please note this is a complete, well-formed JSON file. If you need to copy to your existing VSC snippets file (most likely your php.json), remember to remove the top and bottom outermost curly braces. One great thing about VSC is that it doesn't care much about typos; fuzzy search will find what you meant to type. E.g., 'cnf' will match 'config'. Maybe the JSON file is too long, I don't know, but sometimes the snippets' descriptions don't show up. The snippets are for use in a template file (i.e., no auto $this->), but you can still use it in a module and/or modify it to suit such needs. Hope you find it useful :-). Demo
    1 point
  44. I just had to do a site-wide replacement on a word this morning, so this may be of use to others in a similar situation (in my case a product name had to have a capital letter in the middle instead of lowercase). Stick at the top of your homepage template and be careful with this - always take a database backup before playing with anything that's potentially destructive. function searchReplace($page) { foreach ($page->children('include=all') as $child) { // Skip admin page if ($child->id != 2) { foreach ($child->template->fields as $field) { $child->{$field} = str_replace('search_word', 'replacement_word', $child->{$field}); } foreach ($child->children as $grandchild) { searchReplace($grandchild); } $child->setOutputFormatting(false); $child->save(); } } } searchReplace($pages->get('/'); exit; It essentially iterates every page under the homepage, goes through every field and replaces the search term with the replacement. It is case sensitive too. Comment out the code when you are done and see the changes live on your site. This might be a nice one for a quick module that only targets things like text, textarea and image/file descriptions as that's pretty much the only fieldtypes that are relevant I think. Settings could be added to skip certain pages (and therefore their children) entirely, but I don't have time for building a module at the moment.
    1 point
  45. Thank you! Happy to hear that and glad I could give something back to you, Reno - thanks for all your great contributions ?
    1 point
  46. Just had a small world experience. I have been emailing with Ueli at https://www.whatwedo.ch/ who are the folks who operate the https://ip.nf/ IP to country API service. He just mentioned that they are partners with https://novu.ch/ (built with PW) and that they use ProcessWire a lot. So anyway, he is keen to support this module and to make sure their service will be able to keep up with any requests made by it to their service ?
    1 point
  47. I think it's not possible, because different systems, use different salt algorithms... I think it's only possible when you hook the login, implement the login/salt system from the old system and after a successful login attempt with the old data - update the pw passwort with the entered and checked password ? (it's not so easy...)
    1 point
  48. You might use a simple code which check the HTTP_ACCEPT_LANGUAGE server variable like the following snippet : <?php $userLocale = locale_accept_from_http($_SERVER['HTTP_ACCEPT_LANGUAGE']); switch ($userLocale){ case "de": // deusth $session->redirect("http://de.mydomain.com"); break; case "en": // english $session->redirect("http://en.mydomain.com"); break; case "fr": // french $session->redirect("http://fr.mydomain.com"); break; default: // default locale/page : english $session->redirect("http://en.mydomain.com"); break; }
    1 point
  49. Your subdomains should point to the same document root where all the ProcessWire files are in (.htaccess, index.php, site, site-starter1 etc.), not to the site folders
    1 point
  50. Hi aren, I just committed an update to Custom Upload Names for you. It now has an option to generate a random string at a length of your specification. Please take a look and let me know if you need any assistance.
    1 point
×
×
  • Create New...