• Content count

  • Joined

  • Last visited

  • Days Won


psy last won the day on October 9 2016

psy had the most liked content!

Community Reputation

98 Excellent

About psy

  • Rank
    Full Member

Contact Methods

  • Website URL

Profile Information

  • Gender
    Not Telling

Recent Profile Visitors

1,560 profile views
  1. Hi @maxf5 Thanks for the feedback. Wow, what results. Definitely not getting those slow speeds here. Will work on reducing the images sizes.
  2. Feeling the love for ProcessWire today. Two sites launched and owners over the moon happy. Two additional sites ordered by existing clients and both specified ProcessWire as the platform. New sites: 1. Owner is just starting out in business and had already spent $100's dollars and 6+ months on a 'free' website without success. She helped me so I sponsored development of her site. Client's comment: "OMGOSH this is sooo exciting!!!!!!! YAY!! Thank you alot!!!!! Can't wait to tell everyone!!! THANK YOU!!!" ProcessWire 3.0.63 2. Original site built in WordPress. Over 1000 lines of code on the home page and the bombed out at line 124 with "Too many errors". Google's page speed insights were cringingly bad. Project was to keep the visuals and rebuild the site in PW with a solid foundation. Job done. No validation errors and vastly improved page speed insights. Also added search and better site navigation. Client's comment: "So good!" ProcessWire 3.0.63 Looking forward to working on the next two sites, both of which will be website apps with workflows rather than informational sites. As ever, grateful for comments/feedback to improve either site.
  3. Quick workaround... in _main.php add <region id="dummy"></region> in basic-page.php add <region id="dummy"></region> Seems PW needs a region in the page template to kick-start the process.
  4. I am using regions with the tag <region id="whatever"> in the _main.php file. Config file is set up as follows: $config->useMarkupRegions = true; $config->prependTemplateFile = '_init.php'; $config->appendTemplateFile = '_main.php'; When I use a page template that changes a region, all goes well. However, I set up the _main.php file to reflect the output for a basic page. The basic-page.php template needed no customisation so was simply as follows: <?php namespace ProcessWire; ?> When a page with the basic-page template was output, all the <region> tags remained in the HTML, ie were not stripped. When I added a customised region to the basic-page.php template, all the <region> tags were stripped from the output _main.php HTML. Did I do something wrong or is this a bug? Using ProcessWire 3.0.63 © 2017
  5. There are many. I trawled the FB forum on the assumption my requirement wasn't unique Here's one:
  6. This works for me. User name is generated by PW from first name and last name fields. New user enters email, password and a couple of custom fields. The user must be saved before the roles are added. Hook developed with help, esp from Ryan, in the FormBuilder forum. // Create new user from FormBuilder feu-register form $forms->addHookAfter('InputfieldForm::processInput', null, 'hookCreateUser'); function hookCreateUser(HookEvent $event) { $form = $event->object; if($form->name != 'my-fb-form-name') return; // if it's not the form you want, return // format the first_name and last_name as the username $sanitizer = wire('sanitizer'); $users = wire('users'); // ensure email address is valid and unique $email = $form->get('email'); $emailValue = $sanitizer->selectorValue($email->value); if($emailValue) { // check there aren't any other users with the same email $insiders = $users->find("include=all, email=$emailValue"); if($insiders->count > 0) { $email->error(__("Sorry that email is already in use")); return false; } } // makes sure the username is not already in use. $first_name = $sanitizer->pageName($form->get('first_name')->value); $last_name = $sanitizer->pageName($form->get('last_name')->value); if ($first_name && $last_name ) { $username = $first_name . '_' . $last_name; $u = $users->find("include=all, name^=$username"); if ($u->count > 0) { $number = $u->count+1; $username = $username . $number; } } else { // invalid or blank $username->error(__("Please enter a valid username")); } // ok, all checked, create user account $newUser = $users->add($username); $newUser->of(false); $newUser->email = $emailValue; $newUser->pass = $form->get('password')->value; $newUser->first_name = $form->get('first_name')->value; $newUser->last_name = $form->get('last_name')->value; $newUser->country = $sanitizer->text($form->get('country')->value); $newUser->phone = $sanitizer->text($form->get('phone')->value); $newUser->save(); $newUser->addRole('guest'); $newUser->addRole('my-custom-user-role'); // change to your user role name $newUser->save(); $newUser->of(true); }
  7. @Macrura Thanks, sorry for the late reply, just saw your comment. Forgot to add album template to MarkupSEO allowed template list. Fixed
  8. Solved!!! Answer was in the .htaccess file. Remove reference to robots.txt being a physical file on the system. #RewriteCond %{REQUEST_FILENAME} !(favicon\.ico|robots\.txt) RewriteCond %{REQUEST_FILENAME} !(favicon\.ico)
  9. Same for me Thought maybe it was a $config setting but couldn't find anything. Suggestions?
  10. @OllieMackJames Glad you like it There are way too many schemas for me to include in the basic module. I chose what I thought would be the most useful. However you have a couple of options: 1. Use the custom schema option, eg: $jsonld = $modules->get("MarkupJsonLDSchema"); $options = array(); $options["@type"] = "VideoObject"; $options["custom"] = array ( "actor" => "Barney Rubble", "caption" => "What an actor!", ... ); ?> <script type="application/ld+json"> <?php $jsonld->render('Custom',$options); ?> </script> OR 2. Write your own schema and add it to the site/modules/MarkupJsonLDSchema/schemas/ directory. See the other schemas in there and their naming conventions as examples, and feel free to include your video schema code in this topic to share with others. BTW, the link leads to a 404 Error. A much better resource is Hope this helps psy
  11. Strangely, the odd order of the pw-append method was definitely repeatable for me. Even with the scripts in the correct order I was still having issues with js errors. The <region> tag works ONLY if I have ProCache turned on to combine & minify scripts. Guessing the same would apply to All-In-One-Minify or similar modules. At least in my case, inline scripts execute too quickly unless the preceding scripts are forced to be loaded beforehand. Lesson learned and all good
  12. Thanks Robin, forgot about the <region> tag. Good call!
  13. I've configured my PW site to use regions and mostly it's fabulous. However I encountered a strange problem when appending scripts to the body tag of a template. The body tag id is "bodyTag" (duh!). There are 3 scripts - two external and one inline. My first attempt was to append each script individually thinking they'd appear in the same order on the output: <script id="googlemapskey" type="text/javascript" src="" pw-append="bodyTag"></script> <script id="localMapsJS" type="text/javascript" src="<?=$bootstrap?>js/jquery.gmap.js" pw-append="bodyTag"></script> <script type="text/javascript" pw-append="bodyTag"> jQuery(document).ready(function($){ ... }); </script> Not so! Got lots of js errors and discovered the output had placed the scripts in the incorrect order, ie: <script type="text/javascript" pw-append="bodyTag"> jQuery(document).ready(function($){ ... }); </script> <script id="localMapsJS" type="text/javascript" src="/site/assets/mytheme/js/jquery.gmap.js"></script> <script id="googlemapskey" type="text/javascript" src=""></script> In other places I've appended multiple HTML regions to the same tag and it's worked fine. It only happens with scripts. After trying a few things, I discovered a workaround which was to wrap all the scripts into one div which is then appended to the body tag. This is OK but not ideal. I think (?), the partial is rendered in its entirety before being appended to the body tag: <div pw-append="bodyTag"> <script id="googlemapskey" type="text/javascript" src=""></script> <script id="localMapsJS" type="text/javascript" src="<?=$bootstrap?>js/jquery.gmap.js"></script> <script type="text/javascript" pw-append="bodyTag"> jQuery(document).ready(function($){ ... }); </script> </div> Curious to know where I went wrong in the first example with each script appended individually or is this behaviour with scripts an undocumented feature of regions? Using PW 3.0.61 with both Chrome and Firefox
  14. Another way perhaps: When you look in the database at field_pagetablefieldname you will see 3 columns - pages_id = the page on which the PageTable appears (this is what you need) data = the id of the PageTable page sort = sort order for the items to appear on the pages_id page You could hook after the new PageTable entry is saved (ie Pages::saved), and do a $database call to select the pages_id that has the newly created page id in the data field.
  15. Thanks Juergen and a great suggestion re the anchor. Achieved it with Ryan's snippet: // scroll to form submitted message jQuery(document).ready(function($) { var f = $('#FormBuilderSubmitted'); if(!f.length) return; var y = f.offset().top; $('body').animate( { scrollTop: y }, 'slow'); });