Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 07/17/2018 in all areas

  1. https://www.1and1.com/digitalguide/hosting/cms/processwire/
    7 points
  2. wire()->addHookAfter("ProcessPageEdit::buildForm", function($event) { $form = $event->return; $fieldset = $form->find("id=ProcessPageEditContent")->first(); $fields = $fieldset->children; bd($fields->each('name')); });
    6 points
  3. When removing a field from Page Edit, is the user removing that field from the associated template? Does that happen on the fly or Is there some sort of "Apply" step that happens at the end with the normal warnings about the loss of data that will occur? If it happens on the fly is there an undo feature? I'd be a bit nervous about accidentally clicking on the field remove button otherwise.
    4 points
  4. Hi @netcarver - thanks for your thoughts. Nico has just given me push permissions to the repo for this module so I could now start maintaining this module moving forward. However, I honestly don't really want another high profile module on my list of things to support at the moment, so if I do take this on, I will be looking for the community to help with PRs moving forward. Regarding your suggestion to me via PM about a community Github organization - I still think this might be a good idea, but I am also ok with being the gatekeeper for the module, just not wanting to take on being the support person - does that make sense? The other issue is that my fork has several breaking changes that prevent easy upgrading from the current master version that is in the modules directory, so without some manual DB changes, it should only be used for new installs. Anyone else have any thoughts on how best to proceed to ensure no-one breaks there site when upgrading to my new version? Maybe I just need to add an upgrade() method that prevents the module from updating old installs?
    3 points
  5. Hey guys, Thought I would share a quick preview of Designme. A module we (Eduardo @elabx and I) are building for visually laying out your templates/edit screens. ? This is a really quick, zero polish screen grab. FYI. Video #2 - UPDATE This new video shows the following features in Designme: Re-arranging fields via Drag & Drop Re-sizing fields via Dragging. Adjusting field settings - with live refresh. Working on "hidden" fields while Designme is active. Creating New fields. Deleting fields. Creating/Deleting Tabs. Dragging fields between tabs. Creating fieldsets. Tagging/Un-tagging fields. Fields without headers expand when hovered (like checkboxes). Live filtering of fields in the sidebar. Ability to adjust (all) Template settings without leaving Designme. Template File Tree Editing Template files source code with ACE Editor. Editing Multiple files with ACE Editor. (New Tabs) Saving files. Techie stuff Fields load their own js/css dependancies. *ready to use on creation (*most fields) Everything happens via Ajax to ProcessPageEdit (via module + hooks). Designme has a JS api that you can use. All actions trigger events. We would love any detailed feedback on what you see so far. If you are interested in testing Designme. Let me know below. ? Video #1.
    2 points
  6. Interesting to see this: https://www.1and1.com/digitalguide/fileadmin/DigitalGuide/Screenshots_2018/processwire-seitenbaum-beispiel.jpg A german file name. ? And it's not the only file with a hint of german. Here we go... https://hosting.1und1.de/digitalguide/hosting/cms/processwire/ (same as above but in german) https://hosting.1und1.de/cloud-app-center/process-wire-download#apps (some other news)
    2 points
  7. yes you just need to make the permission the same name as the process page, and then use that permission to restrict; if you need examples i can explain it more, but essentially this is like the core permissions setup used by stuff like lister pro, where the permission for a process matches the process page name. I haven't looked at MarkupSEO for a while, instead i use my (yet unreleased) MarkupSiteMetaAdvanced module, which has like a gazillion seo settings, but much more since it covers basically everything related to meta data, including schema, all social media, DCMI, analytics, copyrights, location, as well as the ability to setup custom key value pairs or define a path to a json inputfields definition file (sort of like mini settings factory); preview:
    2 points
  8. I am yet to check out this module so I am for sure not the best person to answer this questions, however I think if you just write a short manual migration guide and prevent accidental upgrading then it should be enough for us developers.
    2 points
  9. Have a look also to the section on Sub-selectors in that doc. So this should do it: $matches = $pages->find("template=group, children=[my_int_field=0]"); And for the other case: $groups = $pages->find("template=task,parent=[closed=0]");
    2 points
  10. jep, just take care when using AJAX loaded fields. if you add your JS via a ::render hook it will not get loaded. You need to load it via ::renderready
    2 points
  11. Really just all the new features mentioned in the commit log: https://github.com/adrianbj/MarkupSEO/commits/various-fixes-enhancements Anyone else out there ? ?
    2 points
  12. Thanks @netcarver and @vincent for finding this issue and getting a fix in place and tested. PR has been merged and the module updated! Sorry for the delay - was away last week.
    2 points
  13. Send the id of the page you want to save in the ajax request, then get the page based on the id.
    2 points
  14. You cannot delete the pages directly from javascript, you have to make a call to the server. My recommendation from what I can tell from your module, is to turn the list of checkboxes into an actual form: $out = "<form action='.' method='post'>; Remember to close the form tag and also add a button for submit! Check the boxes, click the submit button an there goes the request to the server. You then check on your execute() method for the comment input like: public function ___execute() { if(count($_POST['comment']){ foreach($_POST['comment'] as $comment){ wire('pages')->delete($comment); } } //rest of the code One difference here from what I read on your code, the wire() function which holds all the PW variables you are used to use on templates. After you delete them, the rest of your logic can stay the same, as it will only find the pages that haven't been deleted.
    2 points
  15. ProcessNetteTester Run Nette Tester tests within ProcessWire admin. (continued from here) Features AJAX interface for running Nette Tester tests, in bulk or manually display counter, error message and execution time in a table run all tests at once or launch single tests show formatted test error messages and report PHP syntax errors stop on first failed test (optional) hide passed tests (optional) display failed/total instead passed/total (optional) re-run failed tests only (optional) auto scroll (optional) include or exclude tests based on query parameters start/stop all tests with the spacebar reset one test or all tests (ctrl+click) TracyDebugger File Editor integration https://modules.processwire.com/modules/process-nette-tester/ https://github.com/rolandtoth/ProcessNetteTester
    1 point
  16. Adrian made a good find, 1and1 hosting is quite big, thats a good place for pw publicity. @ wbmnfktr yes you are right about being off, also in the columns where pw and wp are compared.
    1 point
  17. In the API Reference: https://processwire.com/api/ref/page/children/
    1 point
  18. Thanks elabx, I cant believe I missed that. I found people discussing $page->optionsfield->has("value=foo") to check if a value was selected, but since this options field might have a bunch of options, it seems a bit much to have to define each foreach. I tried: <?php if($option->has("title={$option->title}")): ?> but I have apparently missed how to do this. Yeah, I really just was not thinking, I got it with: <?php $field = $fields->get('my_field'); $options = $field->type->getOptions($field); $selectedField = $todo->my_field->value; ?> <select> <?php foreach($options as $option): ?> <?php if($option->value === $selectedField): ?> <option value="<?=$option->value;?>" selected><?=$option->title;?></option> <?php else: ?> <option data-id="<?=$page->parent->id;?>" value="<?=$option->value;?>"><?=$option->title;?></option> <?php endif; ?> <?php endforeach; ?> </select>
    1 point
  19. It's happening on the fly. You are right, lot's of potential for destruction or accidents. I have double confirmation on deletes, but I keep turning it off because I am adding and removing a million fields every day. I will post an example in the next video. It's pretty un-intrusive, but adds the protection. Good catch ? (also, thanks for the help with showing empty fieldsets. As you can see in the video, it worked out quite nicely).
    1 point
  20. Hmmm, if the user doing the search has read permissions to logfiles, could the logs be made searchable without having to drill down into the actual logs page? ?
    1 point
  21. Hi @adrian I'm not using your fork actively - because I wasn't previously aware of it. I do know people who use Nico's original module - but having had a quick look at the changes in your module I'll be switching over to using it going forward. If Nico is not currently accepting pull requests, (I know I go through phases like that with my modules) then perhaps starting an alternative module from your fork would be the way to go. MarkupSEOExtended?
    1 point
  22. Great to have you back, Adrian. Thanks for pulling in the change.
    1 point
  23. $this->addHookBefore('InputfieldTextarea::render', function($event) { $field = $event->object; if($field->name == 'body_offer') { $del = ''; foreach($this->wire->pages->get(11229)->textblocks as $item) { $field->entityEncodeText = false; $body = str_replace(PHP_EOL, '', $item->body); $body = addslashes($body); $title = $item->title; $field->description .= $del . "<a href=\"#\" class=\"ckesnippet\" data-snippet=\"$body\">$title</a>"; $del = ' | '; } } $js = wire('config')->urls->templates . 'scripts/ckesnippets.js'; $event->return = str_replace("</html>", "\n<script type='text/javascript' src='$js'></script>\n</html>", $event->return); }); I'm trying to add custom text-blocks from repeater fields into CKEditor. I've stolen the whole idea (and code) from @bernhard Problem is: The links are actually being rendered, but the Javascript is not loaded, i.e. the $event->return line doesn't seem to work. If I inspect the HTML, my additional script-tag is nowhere to be seen. I don't get any errors either. Running latest PW dev + PHP 7.1.19.
    1 point
  24. I think Tom is right. Inputfield render is the inputfield markup not the whole <html>. Why not just use the core scripts array? $this->wire("config")->scripts->add("/xxx/xxx.js");
    1 point
  25. Hi @Soma It's for an internal project management system I'm working on. There are categories that let you know how many projects belong to that system. Archiving a project sets it to unpublished. However, it still shows as it exists in the count. I'm planning on finishing my eCommerce system I'm building for ProcessWire soon and that also will suffer if it has a count of the amount of products in each category.
    1 point
  26. Shot in the dark, but is '</html>' rendered in 'InputfieldTextarea::render'? I know it's rendered in 'Page::render'. Might be worth taking a look at what $event->return is actually outputting. Maybe just echo $event->return.
    1 point
  27. @adrian Thank you for your reply and clarification. At present the solution outlined previously achieves the desired access control without the use of a role and/or module. I'll have to look into the ProtectedMode module further in due course.
    1 point
  28. Joshuag, from the videos I can tell that the work of your team is a masterpiece. It would be great to test the functionality in real whenever you are ready for a release. Keep up the good work. That is why I signed up for ProcessWire - because of its super creative and extremely supportive community. If you need some testers, you can count on me. I am just starting a new project and a module like yours would help me get more efficient while at the same time I would make sure to report any issues spotted or share ideas of improvement (if any ofcourse ? )
    1 point
  29. Posted update video in the original Post. ? I really value your feedback. Let me know what you think. Thanks in advance.
    1 point
  30. OK i understand ? I just didn't get that it was a snippet and "wasted" time to read your post and try to help where actually no problem existed and thought you might save others from that by naming it more obviously..
    1 point
  31. @bernhard I felt my post is not qualified for a tutorial with »step-by-step instructions on how to do things in ProcessWire« – and since the description for API & Templates contains »answers and support on the API and template development« I thought it would better fit in there. I was actually looking for a hooks / snippet / recipe section in the forum – but that does not exists. I know, there is https://processwire-recipes.com but it just feels to cumbersome to add one ?
    1 point
  32. I think this is by design to optimize queries. But not sure. It uses COUNT in SQL to evaluate children counts which don't check for page status, I can imagine on very large sets it could get slow? Anyway this case is rare you really need this and have access aware. What is your use case exactly? You can always just loop the pages in question and check for $page->numChildren(true) which is access aware. (You could also store/cache that info in a real field on the page with some hooks and use that.) Some example with numChildren() $res = $pages->find("template=basic-page"); foreach($res as $r){ $r->has_children = $r->numChildren(true) > 1 ? "true" : "false" ; } echo " | has children: " . $res->find("has_children=true"); echo " | no children: " . $res->find("has_children=false");
    1 point
  33. I can confirm that children.count returns all children - including unpublished and hidden ones. At least in my current project. Maybe it's similar to this: A work-around... not yet. You could try to find out if those child pages are viewable or something like this.
    1 point
  34. Thanks ? I will post an update video later today or tomorrow showcasing additional features. I have not decided the best option for releasing this module, but I have some interesting ideas.
    1 point
  35. I've updated in the modules directory. Don't have time at the moment to look at this – if its needed urgently, please submit a merge request. ?
    1 point
  36. The module has been moved to GitLab: https://gitlab.com/rockettpw/seo/markup-sitemap I have tagged 0.4.1-RC3, but have not yet updated it in the modules directory. Need to fire up the old laptop to get credentials for that.
    1 point
  37. The second foreach($speaker as $thumb) looks like there is something missing. I'd expect something like this there: <?php foreach($speaker->photo as $thumb) { // } And I would remove the very first part of code. <?php foreach($page->speaker as $speaker): $thumb = $speaker->photo->width(310); endforeach;
    1 point
  38. Ok, I got some updates on this module. I wanted to implement support of multiple forms on one page because I need to add a newsletter subscription form on one page using my module and right now this is not possible. Unfortunately this task is not trivial and I hope to get some help by you guys ? maybe @tpr @Robin S or @gebeer have already done something similar? Please see the explanation of the issue in the Nette Forum: https://forum.nette.org/en/30969-multiple-forms-on-one-page-standalone-version Edit: seems to be solved - got a reply instantly in the nett forum ? BTW: I decided to remove the branding from the module ?
    1 point
  39. Hey @adrian - thanks for pointing this out. Both are valid points, so I'll try look into it this weekend.
    1 point
  40. I could give it a try next week. Never used this or the version from Nico so we will see. Anything special I should look for?
    1 point
  41. $pages->find("template=exhibitions, tags=foo, tags=bar")
    1 point
  42. I think just keep the dev version is fine. Gideon
    1 point
  43. @cb2004 I did this many years ago for a Textpattern site when I wanted to migrate the passwords from old style hashes to newer ones. I haven't got anything for PW, sorry. The methodology is pretty much what I laid out in the post above yours. Maybe others could advise you about the best hooks to use, but I'd guess at doing a before hook on session::authenticate(). Something like this in site/ready.php would be a start (totally untested)... wire('session')->addHookBefore('authenticate', function($event) { $user = $event->arguments(0); $pass = $event->arguments(1); $imported_md5_password_hash = trim($user->md5_field); // Is there a value for the imported md5 field? if ('' !== $imported_md5_password_hash) { // Yes! then create the md5 of what the user just typed in. // NB: You need to change this code so that the value generated here follows the algorithm for the generation of // the password set you imported. $md5 = md5($pass); // and see if it matches the stored value for this user if ($md5 === $imported_md5_password_hash) { // it does, so create and store the PW version of the $pass the user just typed in... $user->of(false); $user->pass = $pass; // @see https://github.com/processwire/processwire/blob/master/wire/core/User.php#L23 $user->md5_field = ''; // Clear the md5 field so this path is bypassed on next login. $user->save(); } } }); If the match on the MD5 hash works, it stores the PW-hashed version of the user's password and saves. As this is a before hook, and the password compare and replace happens here, I think that's all that should be needed. Of course, you still need to import those hashes into the "md5_field" above (rename as needed.) Adding an md5_field to the user template allows you to easily locate which users have updated and which haven't using normal PW selectors. YMMV - but I hope that starts you off in the right direction.
    1 point
  44. @adrian @netcarver @horst, Thanks guys. There seems to be a problem. I don't know if I mucked up something server-side during maintenance or it's a GitHub thing. What's happening is that only one branch is getting saved, the one that was updated last. So, currently, only PW3 Master is available (you can tell by the folder pw3master here on the project page) since it was generated yesterday. The folders for the other branches are all missing. The next auto-update will be PW3 Dev, hence, it will wipe out pw3master folder. I will have a look at this when I get some time. I'm also wondering whether it is really worth maintaining PW2.7, 2.8 and 3 master? These docs are really for devs and my guess is that devs will most likely be using the latest and greatest PW version, i.e. PW dev. Any thoughts?
    1 point
  45. Just a stab in the dark, but did you try using PW namespaces in every included file? <?php namespace ProcessWire;
    1 point
  46. Nik is right about this. You probably want to change your selector to something like this: $field = $user->language->isDefault() ? "body" : "body.data" . $user->language; $matches = $pages->find("$field*=$q"); That will force it to not consider the default language in the matches at all. However, most of the time you should just do this, which already takes languages into account: $matches = $pages->find("body*=$q"); So whether the user searches for "Beer" or "Cerveza" they will still get to the right page. If you exclude the default language, then that fallback never happens.
    1 point
×
×
  • Create New...