Leaderboard
Popular Content
Showing content with the highest reputation on 02/21/2018 in all areas
-
Not a question, but just something I discovered that I wanted to share on the forum since I haven't seen it discussed anywhere. If you are familiar with the "autojoin" option on individual ProcessWire fields, enabling this feature means that every time a page with that field on it is loaded into memory, the field will be included with it immediately. (Normally just the page's name and meta data is included, and getting a specific field from the page requires a separate trip to the database. This is to conserve memory) Normally this is fine and it keeps things simple, but occasionally you may be loading a lot of data in a consistent fashion (for, example, to populate a table) and know exactly which fields you need. With the autojoin option on fields, you would have to enable autojoin for all pages at all times, which you probably don't want. With the following code, you can do a $pages->find() and specify exactly which fields you want to autojoin with it: $pages->find("template=whatever", ['loadOptions' => ['joinFields' => ['filed1','field2','field3']]] ); I tested out in debug mode on one of my projects, and it seemed to significantly reduce the number of SQL queries required for an html data table I was building. Hope that helps someone!5 points
-
2 points
-
If these models/artists need to be able to edit their information then they must be created as PW users so they can log in. You can use an "Approved" checkbox field in the user template, or alternatively create an "Approved" role that may be added to the user, to determine which users are approved. The Login Register module could help with this project. See the blog post that introduced it. You'll probably want to customise Login Register (with hooks or whatever) for things like: 1. Show different fields in the register form depending on if Model or Artist is selected. 2. Maybe apply different role to new user depending on if Model or Artist is selected. 3. Show different fields in profile edit form depending on if Model or Artist is selected. If you get stuck on any of these things I'm sure you'll find help here in the forums. I haven't used Login Register myself. If information from the user profile is shown publicly on the front-end you could explore the possibility of using a different parent for users. Or you could use a single page for all profiles, pulling in the data for the relevant user via a Url Segment. I'd probably go for the latter myself. If all the users are stored under the Admin > Access > Users (as they are by default) then your client will be approving/activating Models and Artists via the Users lister. You can add a filter to the lister to make it easy to find unapproved users. Or maybe use Lister Pro to create a custom users lister showing unapproved users.2 points
-
Yep, well took a bit longer reading the doco, experimenting etc and my site was already live. Now I know how to do it, will only take 15 minutes next time. Steps: Create your icons. I only had up to 256x256px. That's old hat. Now you need up to 1024x1024px. Decided to go with my existing website/app icon set anyway. Go to http://www.manifoldjs.com/generator and fill in the blanks Generate the files, download the kit, edit the files and/or your PW template(s) required and upload to the root directory, not /site/ directory, of your ProcessWire site Woohoo!!! Works great with a couple of provisos: The online builder does not work for Mac, iOS and Windows 10 devices, only everything else. Found it somewhat ironic it lacks Windows 10 support as this is a Microsoft product. No surprises there! For Mac, iOS and Win10 you have to use the PWABuilder CLI, almost formerly ManifoldJS CLI as it's going through a name change. Would be ever so grateful to anyone who can tell me how to do that. Followed the instructions to the letter, and also multiple variations, and could not get the CLI version to install/work and I definitely have the latest versions of Node and npm. PWABuilder delivers a manifest.json file and a couple of basic service workers, without all the fuss associated with SPAs, REST APIs etc, for small, informational websites. Watched a video recently that amongst other things, stressed PWA != SPA. Took me a while to get that. (Tip: skip the ads) While not yet perfect, PWABuilder was a good introduction for me to PWAs for ProcessWire.1 point
-
You could use another field, login via email or title, but even then there is the problem: User 1 has password: 123456 User 2 has password: 123456 If you search the same name/email at login and loop with the password on found users, then user 2 could login into user 1 account. This would be bad. The possibility is there to have the same password, and you can login into the wrong user account.1 point
-
Not out of the box, I don't think so. A user is a page like any other page. They share the same parent, Users (ID 29). You cannot have more than one page with the same name under the same parent in ProcessWire.1 point
-
Three options to get the discussion going Bootstrap either ProcessWire or your eCommerce App. The one being bootstrapped stores the user data REST API: The eCommerce App can request and receive user data using REST or similar (@see ProcessWireGraphQL) Invest in the native ProcessWire eCommerce app, Padloper .1 point
-
That's added by InputfieldPage.js here. It's so that there isn't an option pre-selected in the inputfield, which is a good thing normally. If you want to remind users that they need to select an option for this field you can make the field required. I guess you could add some custom JS to remove the empty option if you really don't want it.1 point
-
The suggestion here worked for me. If your CKEditor field is named "formula", create a file "config-formula.js" in /site/modules/InputfieldCKEditor/ with contents: CKEDITOR.editorConfig = function( config ) { config.keystrokes = [ [ 13 /* Enter */, 'blur'], [ CKEDITOR.SHIFT + 13 /* Shift + Enter */, 'blur' ] ]; };1 point
-
Nice tip! You can also turn autojoin on and off for selected fields whenever you need via API methods $field->addFlag(Field::flagAutojoin) and $field->removeFlag(Field::flagAutojoin).1 point
-
Maybe you can find some useful hint in this thread: Page reference field selection based on another field1 point
-
@adrian Could you try this updated JS file? rrule-gui.js1 point
-
This worked for me. See the changes in getLanguageValue(); The echo's were too much for me ; I substituted them for $out (code be made even cleaner, but this is a start). function createArticle($el){ $out = ''; //$el->setOutputFormatting(false); $title = $el->getLanguageValue('default', 'title'); $titleFR = ($el->getLanguageValue('fr', 'title') ? $el->getLanguageValue('fr', 'title') : $title); $titleNL = ($el->getLanguageValue('nl', 'title') ? $el->getLanguageValue('nl', 'title') : $title); $out .= ' <div class="close closeArticle"><span>×</span></div>'; //$out .= ($el->title ? '<h2>'. $el->title .'</h2>' : ''); $out .= ($el->title ? '<h2>'. $titleFR .'</h2>' : '');// @note: just for testing $out .= ($el->sous_titre ? '<h3>'. $el->sous_titre .'</h3>' : ''); $out .= '<div class="dates">'; $out .= ($el->date_debut ? '<h4 class="dateDebut"><span></span> ' . $el->date_debut . ' </h4>' : ''); $out .= ($el->date_fin ? '<h4 class="dateFin"> <span> ⤑ </span> ' . $el->date_fin . '</h4><br>' : ''); $out .= ($el->vernissage ? '<h4 class="vernissage"> <span>vernissage : </span>' . $el->vernissage . '</h4>' : ''); $out .= '</div>'; $out .= ($el->images ? '<img src="' . $el->images->first()->url . '" alt="" />' : '' ); $out .= '<div class="content">'; $out .= ($el->contenu ? $el->contenu : '' ); $out .= '</div>'; $out .= ($el->en_savoir_plus ? '<p class="savoirPlus">' : '' ); $out .= ($el->en_savoir_plus ? '<a href="' . $el->en_savoir_plus . '" target="_blank">En savoir plus</a>' : '' ); $out .= ($el->en_savoir_plus ? '</p>' : '' ); return $out; } I have not looked at the rest of your code in detail...1 point
-
There is no timeStart in the data since I am saving the date+timeStart as a Unix timestamp.1 point
-
I would probably strip any extra p tags with a hook. It looks like all MathJax blocks create something like this: <p><span class="math-tex">...</span></p> It would be quite easy to just render the very first p tag which has the above span class .math-tex inside, and delete everything else. I'm sure as time goes by, authors won't even try to add more than one line anymore I also quickly tried some cheap CSS hacks, but they don't really work... e.g. restricting the RTE height: height: 62px; resize: none; overflow: hidden;1 point
-
1 point
-
Hmmm. That is very strange that you can’t save. Do you have any js errors? Looks like it's ok now - I changed the date to something else, then saved and now it's working. Not sure if it was some change tracking issue or what. I did try several times before, but seems ok now - I'll keep an eye on it and let you know. Let me know if you have troubles reproducing the results table issue. Also, would you consider changing the behavior of the code icon - I see that it's a tooltip for the RRule, but it might be nice if there was no target, because I thought it was clickable and the # target directs me to the top of the page and makes me think the link is broken. I actually think it might be nice if clicking it showed the RRule below, like the results table shows. This question is not really specific to this module, but I am wondering if there is a standard way to handle multiday events that have different start/end times on different days, like a concert or conference. I am guessing these just need to be single separate events, otherwise it's not really a recurring event?1 point
-
Thanks for the getting to these issues @joshuag 1) It looks like the UiKit theme issues are fixed 2) I can't seem to save a non all day event. I uncheck "all day" and enter a start and end time, but when I save the page, the "all day" is checked and the end time isn't saved. 3) The results seem to be off by a day - note 15/16 vs 14/15 in the results.1 point
-
Hi Guys, Here is an updated version of Recurme. I would appreciate any testing/feedback. ## [1.0.2] - 2018-02-21 ### changed - Fixed Skipping Month Issue for months with more days (ie. Jan 31) - Fixed Broken $options[RenderEvent] options (see this post) - Fixed Non-repeating event data - Non-repeating events display without setting repeat to x1. - Added timeStart field. - Added timeEnd field. $event->timeEnd - Added “All Day” toggle - Fixed Install notice $template->id - UIKIT theme compatibility Fixes InputfieldRecur.1.0.2.zip1 point
-
there is, but it requires using admin custom files and AdminOnSteroids... see here: the js goes in the ProcessPageEdit.js, which goes inside the /templates/AdminCustomFiles/ folder (change the fieldnames to match your fields) and the css goes ProcessPageEdit.css, same folder1 point
-
@adrian I never resolve this because it was not a bug. I was pasting some html code inside a Ckeditor field (from another project) that had src img tags with absolute path, so I think when Processwire evaluates the html code in a ckeditor field tries to match the img tag to images uploaded to the image field. Removing the src img path fixed the problem.1 point
-
New version: 1) Adds a new option to "Allow Letters in Input" which is to support companies who like to publicize their phone number using letters, like: 1800-CALLNOW - the default is for this to be off so validation still checks that all are digits, but with this on, you can also enter letters. 2) Has some tweaks to prevent a component suffix from displaying if there is no value for the next component.1 point
-
Tips for anyone using PWABuilder: If you upload the manifest.json and js files to the root directory, change all relative urls in the pwabuilder js files to absolute https://yourdomain.com/ urls otherwise the files won't be found in pages lower down the page tree Ditto for the image file URLS in manifest.json, or at least './site/wheveryouhaveyouricons' Minimise the js and manifest.json files so Google won't penalise the site in page speed insights If you don't want to use an index.html file for offline remove references to it from the pwabuilder js files otherwise the service worker registration may fail The pwabuilder js & json files could probably be put in your templates dir providing all scripts & meta links pointed to them correctly. Haven't tried that yet1 point
-
@dragan The tool gives you some choices about what you want to store offline and if you want an offline.html for content that's not saved locally. Worked for me on mac. Dragged the URL to the desktop, turned off all internet connections, opened the link** with Chrome and Firefox. All worked and any pages I hadn't visited online displayed my offline.html message. ** icon showed Safari even though it's not my default browser, not my PWA icon - an Apple thing? Also, link did not work when opened with Safari which gets back to Apple's lack of support for service workers I guess.1 point
-
Thanks for sharing. I watched the entire video (no ads though... don't you use ad-blockers?). So... if you say that tool installs a couple of basic service workers. What exactly do they do? Enabling offline mode? Push notifications? "add to homescreen"?1 point
-
When $config->debug is true, you can read all fieldnames when hovering the arrow in the top right of every field. This is possible with plain PW.1 point
-
There are some points you're missing. ProcessWire does not (really) deny access to php files in the templates folder, it just denies direct access to those php files, because they would most likely not work correctly. You can however use any of those php files in that folder if you have a template using it as well as a page using the template. Just use the page's url in your js file and the linked php file will be called. Only by accessing a page instead of the file directly ProcessWire is bootstrapped before the php (template) file is executed and all your api variables are available. But you could also use a custom php file, without the need to have a template and page set up. You can also manually have ProcessWire bootstrapped by including it like it's described here: https://processwire.com/api/include/1 point
-
Hi guys. We just launched our most recent work https://www.the-weekender.com/ This is a really nice and carefully crafted magazine! Worth buying, especially for German speakers -- The site is responsive as always, and prepared for two languages, although only German is available at the launching. And most importantly, this is our first Padloper powered web shop. Thanks Antii! Besides Padloper, we used Soma's color picker for the coloured backgrounds and the Multiplier Profield for all the listings. If you notice anything wrong in any browser, please tell. Suggestions are welcomed, as usual1 point
-
Hi dupalski I think the problem is that whichever system you use, the minute you want to change the layout a bit you are still looking at code of one sort or another. Whether you're editing a snippet that comes with a MODx module (I forget exactly how it works) or you're writing one of Martijn's simple examples above you will see some form of code at some point. The thing is to not be afraid of the fact that in MODx it's abstracted away behind {{curly braces}} or [!other things]] whilst ProcessWire throws real PHP your way - they're both equally as simple to break, but it's infinitely easier in ProcessWire to do what you want out of the box (with a little learning - there's a learning curve with both so why not learn some actual PHP rather than abstract code ). I would recommend downloading and installing ProcessWire, and then looking at some of the tutorials - this is probably the most concise example that gets you going quickly with a guides through templates, fields and pages and if you understand those basics by the end then you'll have begun to unlock some of the power of ProcessWire and hopefully be eager for more! Some of the docs can look a little scary, but honestly if you know HTML and CSS then that's half of the battle - the tutorials can help you with a lot of the rest and doing it in ProcessWire you're not restricted to what the modules output for you in terms of HTML - as you can see in Martijn's example above of outputting images from a page that's pretty simple and you can apply whatever HTML and CSS you like around it without worrying about modules not getting update by their authors or things like that (disclaimer: they're all pretty up to date here, but I'd wager that not all of Wordpress' 1,355 gallery plugins are up to date - just an extreme example from another system there ). Following on from that disclaimer in the paragraph above, that example actually highlights how the number of modules doesn't necessarily mean much either if there are lots of the same thing or, as Martijn says, they are things that can be done in so little code in ProcessWire that they're not worth writing a whole module for. Every plugin/module in any system actually adds some overhead, whether it's parsing CMS-specific tags in other systems or getting basic information - it all adds a little to the server load or page load times. That said, using plain HTML will always be faster than using any CMS so there is always a trade-off no matter what you do. I think I might need to take a breath now Anyway, my suggestion would be to follow a tutorial, have a play and ask on the forums if you still have questions after that.1 point
-
0 points