-
Posts
11,191 -
Joined
-
Last visited
-
Days Won
373
Everything posted by adrian
-
Returning list of pages belong to a list of users
adrian replied to Matt Cohen's topic in Getting Started
Did you remember to get the id of the user whose name is matt and use that in the selector? You could do: $lostproperty = $pages->find("created_users_id=".$users->get("matt")->id.", template=lost-property"); Otherwise, make sure your template is correct. Also, to avoid confusion, I would go with $item instead of $items -
Returning list of pages belong to a list of users
adrian replied to Matt Cohen's topic in Getting Started
Try: created_users_id= as the selector, rather than user. -
http://modules.processwire.com/modules/jquery-file-upload/ https://github.com/adrianbj/FieldtypeVideo
-
Just add: protected static $fM; at line #19 You'll also need to change line 94 from: self::$fM['type']($f, $fM['label'], $data[$f], $fM['desc']) to: self::{$fM['type']}($f, $fM['label'], $data[$f], $fM['desc'])
-
I know this is very old, but I just stumbled across it - don't forget that AdminRestrictBranch (http://modules.processwire.com/modules/admin-restrict-branch/) will take care of #2 and #3
-
@rick900 - welcome to the PW forums. Any chance you could provide some code to show how to integrate payolee within ProcessWire.
-
Typically the easiest way to avoid loops with save hooks is to just save the field, rather than the whole page. So, do: $pageToSave->save('relatedPageField'); // or whatever the name of the field is
-
I have just added a new config setting: Local Root Path which you can use to modify the editor links from a production server to a your local dev files - I think this is a really handy improvement. If you have the remote server mapped as a local drive, you could even point to that if you'd prefer. It also includes a bunch of Tracy core updates, including support for AJAX errors on the bluescreen, but you guys can read more about the changes here (https://github.com/nette/tracy/commits/master) if you want.
-
Thanks for all the testing! Just to let everyone else know - Charles has tested the latest version (just committed) and it is working properly with PHP 7. Glad you sorted out the cron issues!
-
Have a read about the PHP modulus operator - that should get you started.
-
Thanks Charles, Please try the latest version. I don't have currently have a PHP 7 setup to test so there might be additional errors, but that one should be fixed.
-
Hi @dab, Glad you're finding it useful. I haven't used the module on a shared host with cpanel, so I am not sure whether there is maybe some interaction going on there. I don't think I have ever seen the module itself create these files. Obviously the module responds to: http://pw.dev/?hash=4ba942b72726bbc0fa527c0c3aa69f2bc6817534 but I don't know where that index.html version is coming from. Any chance there is a caching mechanism at play here. Maybe even ProCache? although I doubt it.
-
Unless I am missing something obvious, it should just be a matter of enabling url segments on your home template, then using the value of the segment to get the page details for that user name. https://processwire.com/docs/tutorials/how-to-use-url-segments/
-
Glad to hear - if you have a minute, it would be great if you could explain what was wrong so others might learn. Are you saying that despite the homepage being protected, guest visitors are having full access to the homepage? Is this your script that is redirecting to the homepage, or the PP module? Remember that the login form is injected into the currently viewed page - it is not a separate page.
-
Page tree: Link titles should show template too (not just name)
adrian replied to ottogal's topic in Wishlist & Roadmap
Following on from Kongondo's answer: https://processwire.com/talk/topic/4134-include-template-name-in-admin-page-list/ Although you might want to do it via the ProcessPageList settings so that it works for all templates: /processwire/module/edit?name=ProcessPageList -
Ok, so just save the field on the current page: $page->of(false); //sorry, I forgot this in the above examples $page->lp_item = $sanitizer->text($input->post->lp_item); $page->save('lp_item'); You can make it even shorter with: $page->setAndSave('lp_item', $sanitizer->text($input->post->lp_item)); That's it! Don't forget though if you have multiple users editing the same field on the same page you may want to deal with possible conflicts if they are editing at the same time.
-
You have to choose a page to save data to. The template for the page has to have the lp_item field in it. You could create a new page for each form submission - maybe like this: $p = new Page(); $p->template = "my-form-template" //use the name of the template that has the lp_item and other required fields in it. $p->parent = $page //save as child of the current page, or choose another page here $p->lp_item = $sanitizer->text($input->post->lp_item); // change the sanitizer type as appropriate: https://processwire.com/api/variables/sanitizer/$p->save('lp_item'); $session->redirect('./');
-
Take a look at this PR (https://github.com/ryancramerdesign/FieldtypeMapMarker/pull/11) - I haven't tested it, but hopefully it will take care of what you need.
-
What is $u meant to be? Is that the current user? Assuming it is and lp_item is a field on the user template, then try this: $user->lp_item = $sanitizer->text($input->post->lp_item); // change the sanitizer type as appropriate: https://processwire.com/api/variables/sanitizer/ $user->save('lp_item'); $session->redirect('./');
-
You can ignore my last post - @dg decided to go with the approach of sending all debugger bar requests with: XDEBUG_SESSION_STOP=1 which seems to solve the issue for me. So for those of you who manually switched to the stable branch, I would suggest updating to the latest version of this module and switching back to master. I will be removing the old stable option (or swapping them when the master is released as 2.4 stable). Please let me know if things are running fast again with the new version and master branch - thanks!
-
Those of you who noticed very slow rendering of the Debugger bar, but noticed significant improvements when you switched to the stable version of the Tracy core - were you all running xdebug? I noticed that it speeds things up significantly (almost as fast as the stable branch) if you disable xdebug. If that is the case for you it might be helpful if you could contribute any ideas to this issue: https://github.com/nette/tracy/issues/157#issuecomment-219547179 and either confirm that disabling xdebug helps, or it doesn't and any other info you have that you think might help to solve it. Thanks! Ignore this - see my next post.
-
You need to reference the field from the selected page(s). If the page field is set to store multiple pages you usually want to foreach through them: foreach($page->page_field as $pf) { echo $pf->title; } That will return the titles of all the pages selected.
-
The easiest way to install is to paste: ElasticSearch into Modules > Site > Add New > Module Class Name I don't know much about the Elastic Search module. Another option which I know handles searching PDF files is: http://modules.processwire.com/modules/indexer/
-
To quote Ryan's latest blog post: https://processwire.com/blog/posts/more-images-upgrades/ - note the bit about "custom meta data fields"
-
Are $text1 and $text2 fields on the same page as the images field? So they are the same text for each image? It sounds like what you want is $page->text1, but until we know exactly where $text1 and $text2 are coming from, it's hard to know.