All Activity

This stream auto-updates     

  1. Past hour
  2. NorbertH

    I am looking for a way to add a full pagetree to select the path to redirect users to. It would enable us to redirect to FE pages too , and possibly to the profile page.... Does anybody know how to replace the standard selector whith a full pagetree to select a page in that module ?
  3. Dumping $event doesn't seem to do anything so perhaps InputfieldSelect::processInput isn't right? Should it be InputfieldWrapper::processInput?
  4. Thanks for your help, @bitpoet. It seems like adding 'InputfieldSelect::processInput' breaks it (doesn't return any options).
  5. bernhard

    I always have a dev-section in my config where this would perfectly fit into:
  6. Today
  7. Hi, I've successfully installed and used Language Support & Co. and Functional Fields modules so that I can translate almost all the strings of my website in English (default) and Italian. Now, in my template files I've "See also" strings that I would like to translate globally (not per template by using Functional Fields). How should I make this? I read the doc and maybe what I need is to use the textdomain, but I didn't understand how to use it. That is, what text/code should be in the file? any example? Also, in the admin area I have the menu items Default and Italian under Setup > Languages. Once accessed one of them, there is the field "Site Translation Files" with the description: "Use this field for translations specific to your site (like files in /site/templates/ for example)". Should I use this field (instead of textdomains) to set globally translated strings? If so, what text/code should be in the file? any example?
  8. Robin S

    It's the infinitely useful Console panel in Tracy Debugger: https://adrianbj.github.io/TracyDebugger/#/debug-bar?id=console
  9. Peter Knight

    Thanks Robin. These are new to me but I get the general mechanics. What is the console part of your screenshots ? A module?
  10. adrian

    I've modified that first post with a new update to link here. Let me know if you'd like anything changed.
  11. Robin S

    This seems like it could be reasonable solution: disable session fingerprint when a site is on localhost. That way when developing locally the user agent is allowed to change without causing a logout. In /site/config.php: if(in_array($_SERVER['SERVER_ADDR'], ['127.0.0.1', '::1'])) { $config->sessionFingerprint = false; }
  12. Yesterday
  13. Robin S

    Thanks, makes sense. So a couple of solutions would be: Use an incognito window when working with dev tools device mode. Or set $config->sessionFingerprint = false in /site/config.php These are okay but still kind of annoying. The incognito solution is a bit less convenient than working within the current browser window and easy to accidentally forget when opening view links from Page Edit / Page List. And I wouldn't want to forget the sessionFingerprint setting and leave it disabled as it reduces security a bit. I wonder if there is some way the PW session fingerprint feature could detect and allow for user agent changes that specifically come from the Chrome dev tools?
  14. louisstephens

    Just from the bit of reading I was doing, each device has a different HTTP_USER_AGENT and therefore the sessions no longer match (between chrome and the device agent). A solution someone came up with on stackoverflow was to store the user agent in the session and check against it once the switch has been made. Perhaps someone better than I could give a better way to handle it in a PW sense. https://stackoverflow.com/questions/45532678/chrome-toggle-different-devices-view-destroys-the-session
  15. For some reason enabling the device mode in the Chrome developer tools logs me out of the ProcessWire admin. I'm using Windows 10, Chrome 70.0.3538.102. Steps to reproduce: 1. Login to PW admin. 2. View the site frontend in a new tab (e.g. Home page). 3. Open the Chome dev tools, enable device mode, and reload the Home page: 4. Switch to the admin tab (where dev tools is not open) and reload - you are now logged out. Can anyone else confirm this? Is there a setting in the dev tools that would avoid this? Or is this logout behaviour something that could/should be fixed in the PW core?
  16. AndZyk

    Hello @spacemonkey95, sorry for not being helpful, but you could build your own logic with: Language API Multi-Language Field Values However I would recommend you not to do this. Having a translated website with no different URLs is bad for SEO and in my opinion a bad user experience, because the user always would have to switch first for having the right language. If you really want to do this, maybe someone else has experience with this. Regards, Andreas
  17. AndZyk

    Hello @felted, the translated name should show up, if you are on the translated page: $dataProtection = $pages->get("/datenschutz/"); // German on the default page echo $dataProtection->name; // danteschutz // English on the translated page echo $dataProtection->name; // data_protection If that doesn't work somehow, you could force this as mentioned with localName: // German echo $dataProection->localName("default"); // datenschutz // English echo $dataProtection->localName("english"); // data_protection Or you could try Multi-Language Field Values: $page->of(false); // turn off outputFormatting (if it's not already) // German echo $dataProtection->name->getLanguageValue("default"); // datenschutz // German echo $dataProtection->name->getLanguageValue("default"); // data_protection Important is to pass the language you are looking for. Regards, Andreas
  18. Robin S

    The item you want to give special treatment to is the last item in the WireArray, so you could use pop() to get that item and remove it from the WireArray: Alternatively here is a more flexible approach that you can use for any item in the WireArray:
  19. Hi, Firstly, I have looked through the whole Multi-Language Support forum for an answer to my problem but I haven't found anything that's quite what I'm trying to achieve, so apologies if I'm duplicating here. I have a website which is mostly viewed by guest users. I'm in the process of trying to add multi-language support so I can present text articles in English or French, depending upon the choice of the guest user. I have worked out how to use multi-language text fields in the backend Admin area, and I can manually switch between how these fields are displayed on the front end by editing the following line of code in my page: $user->language = $languages->get("english"); Switching "english" to "french" there correctly changes the fields which follow into French. My problem is this: I want guest users to be able to click a button to select the language in which they view the site, but I don't want to use /en/ or /fr/ in the URL to achieve this. Essentially, I want a button which changes the line of code as above. Can anyone talk me through the code I need to include to achieve this (assuming it's possible)? Oh, also I've read carefully through the Multi-Language Support API page and there's a paragraph which touches exactly on this area ("However, we are assuming you want to use language fields for the purpose of having multi-language versions of your site available to anonymous visitors. There are a large number of approaches you could take."), but unfortunately its link to examples of how to achieve it goes nowhere (https://processwire.com/api/multi-language-support/multi-language-fields/#examples). Thanks everyone
  20. <?php $Cats=$pages->find("parent=1086, id!=$page, sort=sort"); foreach($Cats as $Cat) { echo " I have a selector that pulls in 4 child pages of a parent and the order is set to reflect the order of the tree. My client has asked that instead of Cat 1 | Cat 2 | Cat 3 | Cat 4 we instead display Cat 4 | Cat 1 | Cat 2 | Cat 3 However, I can't change the sort order in the tree. Can anyone guide me on the correct approach here? Thanks
  21. felted

    The problem ist, that the site is a onesiter. The URL is always: http://xxx.biz/de/ for german and http://pw.xxx.biz/en/ for english. Any content i get with: $datenschutz_content = $pages->get('/datenschutz/'); <?php echo $datenschutz_content->title; ?> Output (title) for the URL http://xxx.biz/de/ is: datenschutz Output (title) for the URL http://xxx.biz/en/ is: data protection Everthing is fine. But now i need the name of the page datenschutz. If i unterstood correctly, the var $page contains only the content of the current page. So all the examples here are not working. Example: If the URL: http://xxx.biz/de/ I need the page name: datenschutz and if the URL: http://xxx.biz/en/ i need the page name: data_protection (importend is the underscore) I hope, it was a litte understandable Thanks, Detlef
  22. BrendonKoz

    Hi @Zeka, yes I'm developing (or trying to anyway ) a Fieldtype/Inputtype. I'll have to do some more testing with the columns to see what might be the issue I'm having (thanks for showing me your example). I'm also going to upgrade from Master to Dev to see if it makes a difference. I tried your version of the jQuery call and it worked - the first time the panel opened. Successive opens were not getting logged. So it seems I'm targetting the wrong element in my call (as your code example will run any time any panel is activated), but why it doesn't seem to run on all of the actual events is strange. (Edit: Firefox was kindly aggregating similar console.log results for me and I didn't notice.) Hopefully the Dev version will show further success.
  23. Normally this is what you should do: make sure templates are set to "HTTP or HTTPS" – which is the default – on the URLs tab and certainly not to "HTTP only" in .htaccess, uncomment the rules under "9. If you only want to allow HTTPS, uncomment the RewriteCond and RewriteRule lines below." and yes, a properly installed SSL is a must recommended: also make sure you do not have any hardwired or third party http URLs
  24. bernhard

    I've also been struggling with this: Thats because the $page you want to check is the first argument of the HookEvent, so you need to apply it there, not at the first part, which is the class (or object). You can also do this:
  25. dragan

    I didn't install this module, but here's a little hint: Try to remove the @ character on this line: https://github.com/ryancramerdesign/MarkupLoadRSS/blob/master/MarkupLoadRSS.module#L371 @ before a function in PHP suppresses error messages. When you do that change, you have to refresh modules. Or delete and re-install it.
  26. LostKobrakai

    So the conditional hooks (probably) work on the $event->object of the HookEvent passed to the hook. That's why ryan's examples only use Page(…)::…. Page does not have a function added (neither hookable nor unhookable), while Pages cannot be evaluated against a selector.
  27. louisstephens

    This might help you out in outputting page names in different languages. https://processwire.com/api/multi-language-support/multi-language-urls/#api
  28. Jonathan Lahijani

    Note: whether I use Page(template=mytemplate)::added or Pages(template=mytemplate)::added does not make a difference.
  1. Load more activity