Leaderboard
Popular Content
Showing content with the highest reputation on 01/17/2018 in all areas
-
New dedicated documentation website is up at https://adrianbj.github.io/TracyDebugger It's very early days still, but finally there is a home for doing a good job on the docs. It's easy to navigate with a top navbar and sidebar menu and a search term option. Once I get the key Debug Bar and Configuration settings added, I really want to do a good job on the "Tips" section because I there are a lot of users out there who are a little lost on all the things that can be achieved. Hopefully lots of updates coming in the next few days! PS - if you're more artistic than I am and you hate the logo, please let me know8 points
-
Hey thmsnhl, I'm using ProcessWire for a few projects at work as well as for my personal projects. Originally coming from Ruby On Rails I also encountered problems with our database synchronization when it comes to team development on a single project. Depending on the project we solved this using Field/Template Export/Import while also only working on certain parts of the page. Most projects are already finished in terms of template/field structure so there is no need to have an always up-to-date local database snapshot. If the project is not finished in terms of template/field structure we usually sit together and draft a "this-solves-everything"-kind of template/field and synchronize this to our local databases once and then just code ahead. Other frameworks solve this by using Migrations and although ProcessWire does not support Migrations in the core (as of now) you can use this module: https://modules.processwire.com/modules/migrations/ (Here are a few code samples and documentation: https://lostkobrakai.github.io/Migrations/). This module does not directly add tables and columns to the database like RoR migrations do but instead allows you to do nearly everything you can do in the Admin UI using code. You can for example create templates, move fields around, install modules, setup users etc. It can be a bit tedious at first to learn all the new APIs this module offers but the benefits, especially for large projects, speak for themselves. These migrations can be safely checked into your git repository and whenever one of your teammates encounters a problem with his out-to-date database he can simply run the migrations files. So instead of adding templates and fields on production you write them in code and deploy your changes to production, then you migrate either using the CLI utility or the admin backend. You can also integrate this into your build toolchain (like Amazon CodeStar). Check this code example I bet it feels quite familiar: <?php class Migration_2018_01_16_12_32 extends Migration { public static $description = "Add postalcode to a hotel"; public function update() { $this->insertIntoTemplate('hotel', 'postalcode', 'title'); $this->editInTemplateContext('home', 'postalcode', function($f){ $f->label = "Hotel Postalcode"; $f->columnWidth = 50; }); } public function downgrade() { $t = $this->templates->get('hotel'); $t->fieldgroup->remove('postalcode'); $t->fieldgroup->save(); } } This adds a `postalcode` field right after the title field to the hotel template. And it removes this field when you rollback your migration. This is how we tackle this problem.7 points
-
I would like to add something else to this already great discussion, and this is about the rate of new features and changes introduced in ProcessWire. While the last few year's new features are impressive, they keep introducing so many minor issues that – while they are truly minor – they have already accumulated to the point where I cannot see how each of them will get sorted out in the future. Leaving these issues behind in the dust will make ProcessWire less robust in the long run. Do not get me wrong, I do no think ProcessWire is in any sort of trouble just yet but recently I stopped updating to new dev versions fearing that I might break a site. The last stable is v3.0.62 from May 5, 2017. I would love to see a feature freeze so that a new stable and somewhat tested version can be released.5 points
-
I agree. While I do like new features, I like even more fixing the old issues and making PW stable. Those minor things and issues that are open for days/months/years make me/us creating and maintaining workarounds, like extra css/js files, using "small" modules, putting hooks in ready.php and you never know when and how these mods will affect the next release. When some time ago new repositories for PW was made (issues/requests) I hoped this will make PW issues solving more consistent (with the help of PW members, I think lostkobrakai and isellsoap), but it looks like nothing much has changed. As Ryan said: "The focus often depends on what resources are available in any given week, and what the most immediate needs are for current projects and clients." I understand that but still... I would love that too. Let's stop requesting new features so Ryan could focus on making the stable release.4 points
-
Hi everybody, we started our first Processwire driven project in my new company and for the first time, I was working on one site with more than 2 colleagues on the same site. It didn't take long for us to stumble across some problems when multiple developers work at the same time, conflicts with updating the database on vagrant machines, like duplicate entries for page IDs, errors when setting up fields and stuff like this. We ended up working on a dedicated database server, that we linked to our vagrant machines and most of the problems were gone, but the performance of this constellation is really bad compared to our first approach with database running on vagrant machines. I already tried to find a solution in the forums but I couldn't find anyone with problems like this. So I was wondering: how do you manage projects with multiple developers on vagrant machines in a git-based workflow?3 points
-
Try wrapping in curly braces: <a href='{$download->download_pdf->first()->url}'>3 points
-
I completely forgot about the dev/staging/live workflow too. +1 for that That's a great source of inspiration. I particularly like the detail and options within that Addon such as 1. Pre-saved migration profiles 2. Push / Pull and Export options 3. Push / Pull site URL and secret keys etc etc I found a few more such as Craft Migration Manager and MODX Cloud have a very easy site inject service although it doesn't give you many options re. which tables, fields etc to import. Just a small point about GIT. I know many of you guys are very comfortable interacting with the CLI and GitHub. Some of us here wouldn't be as strong in that regard so it'd be great to see integration with GIT but not so great if the Module depended on it etc.3 points
-
2 points
-
In the upcoming 1.7.4 version there will be a new tweak for the Logs page. The helpers field on top can be expanded by default, and the select box of Actions replaced with radios. I don't really get why the actions are in a select, radios are easier to use. I've requested this change in the core on GitHub (and got a few likes there too) but so far there's no response.2 points
-
It's documented here. From twig's point of view, you're simply accessing objects and their properties.2 points
-
Hi @LAPS try the following : In ready.php put the following code : $captchaobj = null; wire()->addHookProperty('LoginRegister::captcha', function ($event) { $event->return = wire('modules')->get("MarkupGoogleRecaptcha"); }); wire()->addHookAfter('LoginRegister::buildLoginForm', function ($event) { /* @var $form InputfieldForm */ $obj = $event->object; $form = $event->return; $form->description = false; // remove the description $f = new InputfieldMarkup(); $f->markupText = $obj->captcha->render(); foreach ($form->children as $field) { if ($field instanceof InputfieldSubmit) { // find the submit button $form->insertBefore($f, $field); // insert reCAPTCHA before the submit button } } $event->return = $form; }); wire()->addHookBefore('LoginRegister::processLoginForm', function ($event) use (&$captchaobj) { $obj = $event->object; $captchaobj = $obj->captcha; }); wire()->addHookBefore('Session::login', function ($event) use (&$captchaobj) { if (!is_null($captchaobj) && $captchaobj->verifyResponse() == false) { $event->arguments(0, ''); $event->arguments(1, ''); $event->arguments(2, false); $event->return = false; } }); Just one thing, I couldn't get the invisible mode to work with LoginRegister, only the reCAPTCHA v2. edit: a small hint about the getScript() : you should call it from the main file, I mean, your "index.php" and only if the user isn't loggedin. if(!$user->isLoggedin()) { echo $modules->get("MarkupGoogleRecaptcha")->getScript(); }2 points
-
You can't directly. But you could perhaps use a servcie like IFTTT and trigger a mail whenever new items are added to the commit feed. Github atom feeds can be retrieved by appending .atom to the repo (commit) URL, e.g. https://github.com/processwire/processwire/commits/dev.atom or https://github.com/processwire/processwire/commits/master.atom. Not sure if IFTTT works with atom, though.2 points
-
2 points
-
No reason at all, so 0.1.1 on github already has the change. Thanks for taking a look and pointing it out @adrian2 points
-
Setup > Templates > my-template > Advanced > Label for Children Tab2 points
-
Hi @BitPoet - love the response time on this Just a oversight I know, but can I make a suggestion that you please change: $parent->children("template={$template}")->count() > 0; to: $parent->count("template={$template}") > 0; The execution time on a parent with a lot of children is going to be a problem otherwise.2 points
-
So I stumbled over the request to allow limiting templates to be used only once under every parent page in this thread and found that this would actually come in handy (also in a site I've built). The code can be found on github and soon also in the module repo. After installation, you'll find a new checkbox "Only once per parent" in the family tab when editing a template.1 point
-
In this post, we take a look at all that was covered in 2017, and our roadmap for 2018, which includes plans for the year ahead. https://processwire.com/blog/posts/processwire-2018-roadmap/1 point
-
1 point
-
Taken care of that here - will push with the next update. Agreed - it will be in there with details and warnings. I am sure if it will ever be 100% reliable because of the way it works, but from my experience it only ever seems to be an problem when used within hooks. I see two possibilities here : a bdb() with some config settings to determine what the depth and length will be - I think the defaults should probably be 6 and 999 - any thoughts? or a simplified syntax for bd(), eg bd($page, [6, 999]) so you don't have to do bd($page, ['maxDepth' => 6, 'maxLength' => 999]) which is painful The problem with a fixed dbd() is that in the case of PW objects, anything more than 6 can results in out of memory errors (at least with my dev machine setup), but working with smaller objects/arrays, I often want 6 or 7. I have decided to go with this for now, which sets the maxDepth to 6. Obviously pre PHP 5.4 you will still need: array(6) bd($page, [6]); You still need to make the depth and length settings an array - this is because the second argument in the array can either be the "title" or the options array. It's get too confusing to take it any further away from that default. You can also do: bd($page, [6,999]); or: bd($page, 'Dump Title', [6,999]); How does that look to you? I'll post this to the closed beta version shortly.1 point
-
+1 for Tower! Switched away from Sourcetree because it requires an account now. For now, Tower/Sourcetree/... are easier for me to handle all kinds of git-things apart from simple commit/push/pull like for example: rebase, stash, squash, ... and it is visually nice. I also use vs code. It is still nice to browse diffs in it or just to have a convenient second place to commit/push.1 point
-
1 point
-
I use Atlassians' Sourcetree if people wanted an alternative. https://www.sourcetreeapp.com/1 point
-
1 point
-
The logo is so funny, I like it too. If Ryan does not mind that you use it this way, why change it?1 point
-
1 point
-
OK, we are close to the solution. If it can help, I am using: ProcessWire v3.0.62 Login/Register v0.0.2 with option "Features to use" set to all (including "Use email address for login rather that user name") and option "Profile form fields" set to "E-mail Address (required)" and "Set Password (required)" more "First name" and "Last name". Furthermore, after the login form submission (failed) in the Session logs I get these 2 rows: 2 seconds ago --- Error: Failed login for '' - Unknown user: 2 seconds ago --- Error: Failed login for 'my_email-email.com' - Unknown user: my_email-email.com1 point
-
Is this any help (from a working site) <?php namespace ProcessWire; if(!$input->urlSegment1) throw new Wire404Exception(); $tag = $sanitizer->name($input->urlSegment1); $tagtitle = $pages->get("template=tag,name=$tag")->title; if(!$tagtitle) throw new Wire404Exception(); In your example this would be from /tag/ template, which is set to use urlSegments.1 point
-
1 point
-
1 point
-
Unless your files field is set to have a max of 1 file, then it's an array and you need first(): $download->download_pdf->first()->url;1 point
-
Maybe start here (regarding headers already sent error) https://stackoverflow.com/questions/8028957/how-to-fix-headers-already-sent-error-in-php1 point
-
Making future website upgrades more error prone and time consuming, I agree. I don't have this feeling. One of the things I like most about PW is that I don't really have to care about updates. But I agree that it would be better to have less new features pushed out every week and have a little more conversation upfront to make the result as good as possible. Yes, we should get more organized somehow. yep, my vote for better community managment here I'd be happy to help in this regard as much as I can.1 point
-
@bernhard Thanks for the VSCode mention on the roadmap thread. It's certainly more visual than the terminal. I'd also like to highlight Tower for Git for designers looking to approach GIT via a more visual UI.1 point
-
Hello @abdus, congrats on your really great venture. Much appreciated. Is there any news about your newsletter module?1 point
-
Right - I guess I was just worried what would happen if someone applied that setting to an existing template on their site accidentally. Maybe unlikely and not a big deal, but is there any reason not to change to my version?1 point
-
This is a setting for Page Reference fields. It appears when you select "Custom format (multiple fields)" in the "Label field" dropdown. You would use something like {default_instrument.title} as part of the custom format, so you can see what the default instrument is for each player within the Page Reference inputfield and therefore if you need to override it. But bear in mind that if you do not manually select an instrument for each player and a player later changes their default instrument then all the concerts they have performed in will show the new default instrument, which wouldn't be good.1 point
-
If anybody wants to steal some code (or use that little module as is, of course), feel free...1 point
-
1 point
-
Ah true, forgot to mention it, this was also one of the only things I identified as a drawback while working on my first PW project. While not perfect, there is a solution for WP that could help as an inspiration: https://deliciousbrains.com/wp-migrate-db-pro/ We are using Gitlab with Hooks to automatically deploy files to the staging and live systems on the corresponding branches and wp-migrate-db-pro for DB syncs as well as the .htaccess method to reference files not found on staging and development environments. If it would work reliably, this module could be an easy solution to migrate templates:1 point
-
Wooohaaa, caught me! Used this on an wp installation previously but the technique should work on PW as well… You should be happy that I moved on from wp – and even more happy that I learned ONE thing I can use for PW Not looking back to wp a single second.1 point
-
To follow up on @Robin S's Tracy example, you can also access this without even needing to do an manual dump call. If you go to edit the field in the backend, you will see this in the Request Info panel. In this case you can quickly see that the inputfield is "InputfieldCheckboxes". You can also find this when viewing a page on the frontend if you go to Request Info > Field List & Values where you will see this, which is just one row of a table which shows the same info for all fields on the page.1 point
-
1 point
-
Thanks to you Bernhard - you're an integral part of this community too - the stats tell us one of the top 5 for the year1 point
-
Thanks for providing the site profile! Just wanted to let others know I had to do the following to login. Add this to the startpage.php in the site/templates/ directory $admin = $users->get('admin'); $admin->setOutputFormatting(false); $admin->pass = 'herewegocheckitout22'; // put in your new password $admin->save(); Then visit the homepage to execute the code. Then remove the same code from the template. Then login to yoursite.com/processwire/ not yoursite.com/wire/ Hope that helps others1 point
-
FYI... There is also a discussion around focal point image cropping https://github.com/processwire/processwire-requests/issues/150 if anyone is interested.1 point
-
It sounds like one of the factors that determines which roadmap items get attention first is the level of interest within the community (makes sense). But it would be good to have a more accurate and transparent gauge of the interest in each roadmap item. A simple solution would be to have an official Roadmap sub-forum with a topic for each roadmap item (separate from the Wishlist sub-forum). The community could then indicate their interest in each item by "liking" it, and give feedback or ideas about implementation in topic replies. My vote for most desirable roadmap item: Add support for custom properties in file/image fields.1 point
-
Actions bar still not working. I'm running Batcher 1.0.4 and PW 3.0.62. https://www.dropbox.com/s/642ps72mz3apf83/batcher-no-click.mov?dl=01 point
-
They look quite different to me (the examples). addHookProperty does just that; adds a property. The property is available to the object you are attaching it to. You can't pass it any arguments to manipulate what it returns. addHookMethod/addHook allows you to add a method/function to an existing class or object. You can have the method you've 'created' accept arguments that inform the method's logic. Although the examples are similar, they are not identical. addHookProperty example. We cannot change/alter the output since this is a property (variable) unless we 'manually' assign it a new value // Accessing the property (from any instance) echo $page->lastModifiedStr; // outputs: "10 days ago" addHookMethod/addHook example. We can add as many arguments as we want to lastModified() since it is a method. In the example in the docs, the method accepts only one boolean argument. This allows us to alter what lastModified() returns. Hence, it offers more flexibility. echo $page->lastModified(true); // returns "10 minutes ago" echo $page->lastModified(false); // returns "2013-05-15 10:15:12" echo $page->lastModified(); // returns "2013-05-15 10:15:12" That's my understanding of it anyway...1 point