Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 03/04/2018 in all areas

  1. Just made it optional in v1.8.0. Also the built-in asmSelect placeholder is now kept when asmSearchbox is enabled, eg. the fieldselector on editing a template now retains the placeholder value after adding a field.
    3 points
  2. Yeah, I have been using it here and works great for hiding certain user fields from non-superusers.
    3 points
  3. Great. I have applied your suggested change in the latest version.
    2 points
  4. ConnectPageFields Allows the connecting of two related Page fields so that changing one updates the other. Purpose of module An example: suppose your website is about movies. You have a template "movie" with Page field "actors". For each movie you add the actors that appear in the movie. All good, but what if you want to find results like... the 10 actors who have appeared in the most movies actors who haven't appeared in any movies since 1990 You cannot retrieve these pages with a single efficient $pages->find() query, and must load a large PageArray into memory in order to iterate or filter it. For the sake of making these types of queries more efficient you could structure your templates/fields so that movies are added to actors instead, but this may be a less comfortable workflow and can run into equivalent problems (e.g. "find the 10 movies with the largest cast"). The solution is to have a two-way relationship so that movie pages have an "actors" Page field and actor pages have a "movies" Page field. This module will keep these two Page fields in sync so that adding "Ryan Gosling" to "Drive" automatically adds "Drive" to "Ryan Gosling". Also, you can select the same Page field in both Page field A and Page field B. For example, create a "Related" Page field for related pages. Choose "Related" for both fields in a pair in the module config. Now when you add "Orange buffoon" to Related for "Donald Trump", "Donald Trump" is automatically added to Related for "Orange buffoon". Usage Install the ConnectPageFields module. If you haven't already done so, create the two Page fields you want to connect and add them to templates. In the module config select the two Page fields in a "Connected field pair" row as Page field A and Page field B. You can add rows as needed using the "Add another row" button. Troubleshooting Make sure you have set the "Selectable Pages" settings for each Page field correctly: The settings for Page field A should allow pages using the template(s) that Page field B has been added to. The settings for Page field B should allow pages using the template(s) that Page field A has been added to. http://modules.processwire.com/modules/connect-page-fields/ https://github.com/Toutouwai/ConnectPageFields Module config: Demo showing how changing one Page field updates the other:
    1 point
  5. No idea - just the observation that the result is the same when you use $pages->find() with the $options parameter like this: $options = array('findIDs'=>1); $homes=$pages->find("has_parent=1", $options); echo $pages->get($homes[0])->name; //returns 'home'
    1 point
  6. I don't think you need a full webshop system such as Padloper or Snipcart for 4 products. Make it easy on yourself and use PayPal buttons - your work will be finished in 30 minutes.
    1 point
  7. It's not hard. You can find the instructions here plus when you buy the module you will get access to the Padloper Support section here on forum so in case you're having any trouble you can post there.
    1 point
  8. A couple of suggestions: On top of that I'm a big fan of Snipcart (here a tutorial specific for PW, with a very basic but interesting example).
    1 point
  9. You can buy @apeisa's module Padloper.
    1 point
  10. Couldn't you just use radio selects, with two options (with whatever labels you need), make it required and have one of the radios selected by default?
    1 point
  11. Just as a heads up if someone needs database testing: I am trying a different approach at the moment: I simply added a database configuration to the config.php which is used if PW is called from PHPUnit. in config.php if(isset($_ENV['UNITTEST']) && $_ENV['UNITTEST'] == true) { $config->dbHost = 'localhost'; $config->dbName = 'db-test'; $config->dbUser = '...'; $config->dbPass = '...'; $config->dbPort = '3306'; $config->httpHosts = array('localhost'); } and my PHPUnit configuration.xml looks like this <phpunit ... some settings here ... > <php> <env name="UNITTEST" value="true" /> </php> </phpunit> maybe this will save someone a headache in the future
    1 point
  12. +1 for selectable default value and yes/no switcher with custom labels
    1 point
  13. I disagree, Horst. It seems, that the most participants in this thread are convinced, that the installer (and that's what I like to talk about) has the best functionality, which is possible. In my humble opinion an installer should protect the superuser from warning after the installation. I think the usability of an installation process around language issues is ideal, when during the installation process the user has to decide about that. Example: We recognize, that your computer is located in Germany. 1 Do you like to use the language [German] (menu to choose another) for the GUI of the backend? [OK] 2 Do you like to use the language settings of PHP for [German] (menu to choose another)? [OK] * 3 Do you like to use the language [German] (menu to choose another) in your first website? [OK] That's all I suggest. That behaviour is good practice in many software I installed in the past. I hope you regard my arguments not at all as an "ungratefulness" from a newbie. The contrary is true. Because I appreciate the project a lot, I think is worth to be honest and give a constructive criticism. *Of course the questions 2 and 3 could be written in that language which has been choosed in question 1. But of course only than, when the project has enough resources for translation work.
    1 point
  14. PS - Wow - the translation really was super easy
    1 point
  15. @adrian, I just pushed another update in v0.1.5 that will allow the dropdown label in the toolbar to adapt its width to the length of the text (in the case that it is translated).
    1 point
  16. You would need to install the LanguageSupport module but I don't think there's any inefficiency in doing that. You don't need to actually create any additional languages - you just edit the default language to override whatever strings you want. I believe that's the standard PW way for customising strings so I wouldn't want to reinvent the wheel and create configurable fields for every string.
    1 point
  17. Hi @adrian, I just pushed an update that makes those strings translatable within the module file. As for the other issue, if your tag name is long it can overflow the standard width that CKEditor applies to combo panels (I don't set any explicit width in this module). I could make a config field for panel width but I'd rather not because I think the default width is suitable in most cases and to get a dynamic value from PHP it would mean putting the CSS inline which is kinda ugly. Maybe you could just set your own width for the panel in some custom admin CSS? .cke_combopanel__hannadropdown { width:300px !important; }
    1 point
  18. Super useful module @thetuningspoon and @Macrura - any chance we could have the option for each page reference field whether the links should open in a modal, or straight into the current tab - I am wanting this as more of a navigation tool. Would this be easy enough to implement? Thanks!
    1 point
  19. Hey Robin, I went to use this on the User template without success. Do you see any reason that can't be enabled with: if($this->page->process !== 'ProcessPageEdit' && $this->page->process !== 'ProcessUser') return; in the evaluateCustomDependencies() method?
    1 point
  20. Two modules that could help with this... Fieldtype Dropdown Dynamic: probably the easier alternative if you only need to select a single option. Fieldtype Select External Option: the alternative to go for if you need to select multiple options.
    1 point
  21. https://processwire.com/talk/topic/13759-tagging-multiple-images/#comment-123851
    1 point
  22. I'll make optional to keep the list open.
    1 point
  23. One question regarding the ASM tweaks - I would like there to be an option to lose focus on the search box after choosing an option. At the moment you need to hit ESC or click off to see the selection. I understand that if you are making lots of selections the current behavior is more efficient, but I think some site editors might be confused. Or maybe I am overthinking it? Any thoughts?
    1 point
  24. Thanks! I've read that page and this one: https://www.rebelytics.com/hreflang-annotations/#step5 In the website I mentioned, I have the homepage as "/" and hreflang of "en". So I'll add a third hreflang tag with x-default value. The other language it "/pt". The user is not redirect upon arrival, he/she must select the language. <link rel='alternate' hreflang='x-default' href='http://example.com/' /> <link rel='alternate' hreflang='en' href='http://example.com/' /> <link rel='alternate' hreflang='pt' href='http://example.com/pt/' /> Actually, after reading it again, in this case I think I should have only to values: <link rel='alternate' hreflang='x-default' href='http://example.com/' /> <!-- default language is english for all users --> <link rel='alternate' hreflang='pt' href='http://example.com/pt/' />
    1 point
  25. Thanks to all that have been helping us to wrap up issue reports on GitHub in preparation for the next master version of the ProcessWire core. Unless any major issues surface, most likely 3.0.95 (next week) will be the next master version. Like last week's version 3.0.93, this week's version 3.0.94 continues along the same path in clearing up new and existing issue reports, and fine tuning little details for the master branch. If you come across any new significant issues please submit them in the issues repository. Or if you opened an issue awhile ago and we haven't fixed it yet, please check that the issue is still applicable and reply to let us know. No blog post this week because I don't have anything else new or interesting to write about other than this. But I am definitely getting excited about having a new master version ready. There's no doubt, this is a really nice upgrade relative to the current master 3.0.62. Have a great weekend!
    1 point
  26. I think checkboxes are sometimes confusing to users and replacing them with an on/off switch can go a long way to making it more obvious. For example, a Yes/No button is more obvious/clear than the assumption that "if this is checked it means yes, and if this is not checked it means no"; For example i'm using this library (incorporated and initialized on some checkbox inputs): https://github.com/olance/jQuery-switchButton Here is my initialized checkbox in PW admin: This still doesn't solve the conundrum of where you want to have it checked by default... the checkbox reversed module is a clever way to solve that...other than js to set the checked attrib..
    1 point
  27. It depends on your webserver and its configuration... With my old hoster, there was no problem with the standard htaccess file, but with my new - i have to uncomment the lines # 1. Don't show directory indexes, but do follow symbolic links # 500 NOTE: Some cloud hosting companies don't allow +FollowSymLinks. # Uncomment +SymLinksifOwnerMatch and comment +FollowSymLinks if you have 500 errors. # If that doesn't resolve the error, then set it back to +FollowSymLinks.
    1 point
  28. Hi, A) it is not a problem that PW has. Every one with this meaning should have a closer look to the screen that you have posted to dropbox: The software is running without problems. It informs you, the superuser, about something language related, at a stage where it cannot know what you want to do with the site. B) It is not a bug, it is a warning or information to the superuser which is the admin. These sort of informations are never displayed to users, only to superuser(s). Superusers are some sort of bus drivers, right? They need to know how much fuel is available and if the tire pressure is to low or not. The other users don't need to know all that informations, they are not driving the bus. C) If you use a default english windows system, bought as a german in germany, and it has no de_locale settings, is this a bug? Or is it disrespectful, that it doesn't assume that the most clients may be germans and may want to use german language with german dates and german float numbers? I don't want to become nitpicking here. If a user has no knowledge of the nature of default PHP installations, how should he know that it is set for EN-locale and not DE? Does the hosting company welcome you in english or in german on their websites? (If they do in german, it is a clear sign for me that they assume you are a german person.) Maybe one can say that both ways have their pros and cons? If a PC-software informs you about a configuration of your system, that has potential to be not correct for your usage, it is one way that may help users with no knowledge about a special fact. But other then a hosting company in a special country, PW cannot "assume" the most used language there, PW is installed around the world. IMO, a hosting company may assume this, but also don't need to act upon it! It is like with a car dealer, he can buy you a car or ten cars, without to care if you can drive or have a driver licence. Should he do care? An example: If a person with no knowledge uses something two years long, without to get confronted with some facts that may need recognition or a decision, the person will have the same level of knowledge in this regard after the two years. If a person gets confronted with those facts and get pushed a bit to start to look behind the scenes of some things, he/she will have more knowledge after the two years. Is more knowledge usefull or obstructive? (You see, we are now on the floor called philosophy. ) As another example, take your own current situation: You don't understand exactly what this locale thing is or means. Is it a bug, is it an information, is it related to PHP, to PW, to something else? You are sitting between all chairs of your friend, a hosting company and some PW lovers. Not as comfortable as it could be. If you would have get some knowledge about that thing in the past, you simply would know all relevant facts about it on your own and you now already would have done some experiments with building your site. You already would have made your hands dirty with coding. IMHO, its PWs philosophy to force the (super)users into a bit more knowledge. But it is up to you, the superuser (or bus driver), which route you want to follow. Do you want to take the red pil or the blue pil? https://youtu.be/OuJ87X9YX3c?t=57 Maybe you know the SELFHTML project in germany? It's slogan was or is: Die Energie des Verstehens (The energy of understanding). It was my ever goto reference since I started with webstuff in 1998/1999. (Now you know the time when I decided to take the red one ) To sum up: Neither the hosting company is wrong, not to assume a default language, nor PW is. It's only my personal opinion when I said that it could be more by the hosting company to assume a default language, than it could be by PW. But neither the web host is buggy nor PW is in this regard. PS: Also, for me it is not a question which pil is yours. Only question for me is: Do you already have taken it, or are you just in the moment before it?
    1 point
  29. Hi @fermion, willkommen in der wunderbaren Welt und der hilfreichen Community von ProcessWire. Wir schreiben hier meistens in Englisch, damit es alle verstehen können. Ich hoffe du verstehst was die meisten hier schreiben. Now I will continue in english: Regarding your question about a risk for setting the locale. I would recommend to set the locale and date format to the corresponding language. Here is the code I use on a large website in my _init.php: $lang = $user->language->name; if ($lang == "default") $lang = "de"; $date_lang = array(); switch ($lang) { case 'en': setlocale(LC_ALL, 'english_gbr', 'english_britain', 'english_england', 'english_great britain', 'english_uk', 'english_united kingdom', 'english_united-kingdom'); $date_lang[0] = "%A %B %dth %Y at %I:%M %p"; $date_lang[1] = "%B %dth %Y"; $date_lang[2] = "%I:%M %p"; $date_lang[3] = "%A"; break; case 'nl': setlocale(LC_ALL, 'english_gbr', 'english_britain', 'english_england', 'english_great britain', 'english_uk', 'english_united kingdom', 'english_united-kingdom'); $date_lang[0] = "%A %B %dth %Y at %I:%M %p"; $date_lang[1] = "%B %dth %Y"; $date_lang[2] = "%I:%M %p"; $date_lang[3] = "%A"; break; case 'fr': setlocale(LC_ALL, "fr_FR", "fra", "fr_FR.UTF8", "French_France"); $date_lang[0] = "%A %d %B %Y à %kh%M"; $date_lang[1] = "%d %B %Y"; $date_lang[2] = "%kh%M"; $date_lang[3] = "%A"; break; default: setlocale(LC_ALL, 'de_DE.UTF8', 'de_DE@euro', 'de_DE', 'deu_deu', 'German_Germany.1252'); $date_lang[0] = "%A, den %d. %B %Y um %k.%Mh"; $date_lang[1] = "%d. %B %Y"; $date_lang[2] = "%k.%Mh"; $date_lang[3] = "%A"; break; } Yes, normally your content is embedded in "fields" in ProcessWire. Then in your template file you output the content of the field in a HTML structure you like, for example a div or a metatag. I agree, that there are not much german tutorials that cover ProcessWire, but I think this is because almost the whole developer community is used to speak and understand english. Anyways: Here is a nice tutorial in german (there are more in the same channel) You will find a nice blog post "Warum ProcessWire die beste Wahl für Ihre Website ist (nicht immer, aber in den meisten Fällen)" on my website, which isn't a tutorial, but an explanation, why and when to use ProcessWire.
    1 point
  30. Done, 318 Having almost finished my first ProcessWire project I can honestly say its been a pleasure. A site / service built out of the PW admin, custom modules etc (theres no frontend at all) to help manage a manufacturing setup. Has been a great fit and shows how flexible PW is. Even with learning about PW and not being the strongest PHP coder out there I've manage to get things done in a fraction of the time. Heres to PW, glass raised
    1 point
  31. I was also just looking for this. I'm using a checkbox where I want it checked for "make all images standard width" which is the default. Changing the text to "make all images non-standard width" would of course be the easy solution, but doesn't make sense to me - the default is they're standard-width, therefore that's the default state, so ON in my mind. Ticking a box to turn it OFF doesn't feel right even if I can wrangle the wording to make it make a little more sense. @ryan please can this be revisited as per the reasons posted since your last reply? Sometimes the wording can just make more sense to the customer using the system, which is who we're building the sites for at the end of the day
    1 point
  32. Just wanted to add that it's not just PHP that treats 0 as False and 1 as True. You'll find most (traditional) languages will do the same (at least the ones I've come across). There are some exceptions like Ruby & Lisp which treats 0 as true, AFAIK. If you're wondering why 0s & 1s ... well I don't have a definite answer myself as it's one of those topics that will divide opinion. IMHO I side with the view that it originates from Electronics & Boolean Algebra. But it certainly sounds like a question for Quora
    1 point
  33. Ah, good find, thanks. Fixed in v0.0.8.
    1 point
  34. How is that you have a path to a file (the $filename argument in your function) that exists in a field on a page without any information about the page and field? Where does $filename come from?
    1 point
×
×
  • Create New...