Jump to content

Sergio

Members
  • Posts

    531
  • Joined

  • Last visited

  • Days Won

    11

Everything posted by Sergio

  1. Maybe this thread will help you:
  2. I liked it very much, @bcartier! Great job! One thing I'd like to suggest is to check the contrast ration between the light gray texts (tree items and breadcrumbs) and their background. Some people may find it harder to read. Edit: also check the menu links' contrast as well.
  3. I didn't have the chance to use it yet, but https://www.import.io/ seems like an excellent tool. Maybe it works!
  4. Take a look at auth0.com: https://auth0.com/docs/connections/passwordless/spa-email-link
  5. Jeffrey Way, from the excellent Laracasts.com, just published a free series for PHP beginners: https://laracasts.com/series/php-for-beginners From the website: Jeffrey is a great teacher so if you are learning PHP, no better place you'll find.
  6. Did someone try to use Auth0 for social and/or passwordless login in PW? And is there somebody interested in porting their Wordpress plugin (that looks awesome) to ProcessWire? https://wordpress.org/plugins/auth0/ I have not the resources right now but I can help testing it. This is how their plugin works: Regular flow There are three different scenarios that could take place. First, a user that not exists in WordPress and it does in your Auth0 account try to log in. A user access your site's login page. (s)he completes his credentials (it could be an existing user in your Auth0 account or a new signup). Auth0 will authenticate the user The plugin gets the user profile. The plugin check if there is a user in the WordPress database with his/her Auth0 user_id. It can't find any, so it will check if there is a user with the same email. It can't find ant, so it will create a new user and log him/her in. Second, a user that exists in WordPress (this user was created before you installed the plugin) and in your Auth0 account try to log in. A user access your site's login page. (s)he completes his credentials (it could be an existing user in your Auth0 account or a new signup). Auth0 will authenticate the user The plugin gets the user profile. The plugin check if there is a user in the WordPress database with his/her Auth0 user_id. It can't find any, so it will check if there is a user with the same email. There is a user with the same email. It checks if the Auth0 user has verified the email. If the user has not verified the email, the process end here with an error message If the email was verified, it will update the user with the Auth0 user_id and log the user in. Third, a user that exists in WordPress (this user was created in the scenario one, or updated in the scenario two) and in your Auth0 account try to log in. A user access your site's login page. (s)he completes his credentials (it could be an existing user in your Auth0 account or a new signup). Auth0 will authenticate the user The plugin gets the user profile. The plugin check if there is a user in the WordPress database with his/her Auth0 user_id. It finds the user, and logs him in. Data migration When data migration is enabled, the plugin will expose two secure endpoint to let Auth0 authenticate the users. This endpoints are secured with a secret token and only available to the Auth0 IPs. You can change this in the plugin advanced settings. The login flow is the following: A user access your site's login page. He has an account in your wordpress site so (s)he proceds to login using this credentials. Auth0 can't find a user with this credentials in your account, so proceds to call your migration endpoint. The plugin find a user with the same username/email and verifies the password. Auth0 creates the user in your account and authenticate the user successfully.
  7. Hi Macrura, any chance you've solved this? Any tips? Nevermind! I figured it out. $page->getUnformatted('body'); It works, now I just have to remove the "----- title xyz" shortcodes from the content.
  8. Sergio

    krafftstoff.de

    Very nice, Diogo! I liked very much the projects navigation buttons.
  9. Great! Oh yeah, there's a lot of examples here. Have in mind that importing different languages if just a matter of setting the language before importing the content, nothing more. Let's see, to begin, there's Ryan great case study on importing content from Wordpress And an example of mine, where I show how to import book contents in two languages (en and pt): <!DOCTYPE html> <html lang="en"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title>Import Books</title> </head> <body> <table border='1' width='100%'> <thead> <tr> <th>ID</th> <th>Title</th> </tr> </thead> <tbody> <?php // get access to WordPress wpautop() function //include("./wordpress/wp-includes/formatting.php"); $wpdb = new PDO("mysql:dbname=ricardo-wp4_db;host=localhost", "root", "root", array(PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES 'UTF8'")); $books = wire('pages')->get('/books/'); $sql = " SELECT * FROM wp_pods_books "; $query = $wpdb->prepare($sql); $query->execute(); while($row = $query->fetch(PDO::FETCH_ASSOC)) { $book = $books->child("wpid=$row[id]"); // do we already have this book? if(!$book->id) { // create a new post $book = new Page(); $book->template = 'book'; $book->parent = $books; echo "Creating new book...\n"; } $book->of(false); $book->wpid = $row['id']; $book->name = wire('sanitizer')->pageName($row['name'], true); $en = $languages->get("default"); $book->title->setLanguageValue($en, $row['name']); $book->body->setLanguageValue($en, $row['body']); $book->introduction->setLanguageValue($en, $row['intro']); //add more fields if needed $pt = $languages->get("pt"); $book->title->setLanguageValue($pt, $row['name_pt']); $book->body->setLanguageValue($pt, $markdown->convert($row['body_pt'])); $book->introduction->setLanguageValue($pt, $markdown->convert($row['intro'])); //We need to activate portuguese page so it will appear on the front-end $book->set("status$pt", 1); // give detailed report about this post echo "<tr>" . "<td>$row[id]</td>" . "<td>$book->title</td>" . "</tr>"; $book->save(); } ?> </tbody> </table> </body> </html> You can get the gist here. And last but no least, there's Adrian's Migrator module -> https://processwire.com/talk/topic/8660-migrator/?hl=migrator
  10. Does the translation system import which file type? json, xml, csv? You can export all the pages' contents to one of these formats and import them again after that. The only thing that will make it more or less hard is the 3rd party system.
  11. I think you should use the language alternate field approach instead: https://processwire.com/api/multi-language-support/multi-language-fields/#language-alternate-field-values Take a look and came back here to discuss. And for a url like http://www.domain.com/designing-respect/pt/home/ you can use URL segments to detect the language, in your template, and switch to the language fields.
  12. I think Emogrifier can be handy but should it be part of the module? Why not a different module, so it can work without latte too?
  13. A small contribution to the project readme: For Sublime Text 3 (should work on 2 too): Install Nette + Latte + Neon package Install Smarty package Set latte extension to open as smarty so you can keep the HTML code autcomplete working Bonus: install HTML-CSS-JS Prettify package and on its preferences add latte and smarty on allowed file extensions: "html": { "allowed_file_extensions": ["htm", "html", "xhtml", "shtml", "xml", "svg", "latte", "smarty"], I submitted a pull request editing the readme to add this warning: HTML Prettify may break lines on strings translations that have more than one word, for instance: {_'A technical book', 'Books'} May result in {_'A technical book', 'Books'} so it won't appear translated any more. You'll have to remove the line breaks manually (for now). I'll see if changing something on the package preference does the trick.
  14. Sergio

    designconcepts

    Very nice and clean, congratulations! My only suggestion, as you are already using https, is to enable http/2, it will be faster!
  15. Just upgraded it here, everything seems fine! Thank you!
  16. So, in my case, as I'm already using _x(), nothing do do, right?
  17. I'm also running it on Digital Ocean, using forge.laravel.com panel to config Let's Encrypt and everthing else #lazyweb So far so good. Didn't fully tested it yet because the project is in alpha state but it looks great so far on a quick webpagetest run. And yes, you must avoid concatenation of all files as your request will be bigger than it needs to be depending on your page. Basically, forget almost all you learned about http connection optimizations. Read: https://www.smashingmagazine.com/2016/02/getting-ready-for-http2/
  18. I checked the underscores multiple times, I really don't know what happened. I didn't try using plural yet, I'll let you know if I bump on any problem. Many thanks!
  19. Well, I installed a fresh copy of 3.0.17 and started all the steps again. At the first moment, it didn't work, but after I changed the lines on _strings.php to _x('Text to translate', 'General');instead of __('Text to translate'), the translations appeared! But I tried that on my current project and it didn't work, so I'm trying to figured it out here. I'll keep you posted. EDIT: It worked on my project as well! I was forgetting to set the context on one string. So everything is good now!
  20. This jQuery plugin is very nice and handle these issues: http://vadikom.github.io/smartmenus/src/demo/
  21. Hi @tpr! First of all, thank you for this module! I decide to use it instead of jade-php on my current project. The problem is, I can't get the translations on _string.php to work. I was getting an error when using v0.12 and i just saw that you released to 0.14. I download it, the error is gone but the translation won't appear, only the default text. I tried directly on the .latte: {_'text to translate'} And setting a $view->variable on the controller. Any hints? What am I missing? EDIT: I'm using the latest PW dev Thanks!
  22. Cool! I was thinking about it yesterday. Thanks!
  23. Fantastic!! Many thanks, Ryan!
  24. 1. it is possible. Are you imagining something like "example.com/2060/name-of-file"? Where 2060 is the page id. 2. Didn't get exactly what you want in this one. You mean bypass completely the local filesystem and only store the files on S3?
  25. It makes sense, but I think is a bit dangerous to have this kind of feature because of the risk of data corruption. Consider how PW's could handle a field that's have other fields depending on its information, for instance, if it's missing in the .json configuration for some reason, after a commit. With ProcessMigrator, you can export your fields in a json, edit this file in a editor and import it again. So you have control of are going to change. ---- But this scenario could you work, I wonder, if PW had something like Laravel's migrations, so you could rollback all the changes in the db to a previous state. But maybe I'm wrong and that's a way to do that like @bernhard is describing.
×
×
  • Create New...