Jump to content

JayGee

Members
  • Posts

    248
  • Joined

  • Last visited

Everything posted by JayGee

  1. I agree - or just assuming if you are dragging over a page that it needs highlighting/opening.
  2. Sorry to bump an old thread but 3 years since you posted this just saved my day! I wonder if there's a way this could be made more obvious in the dashboard UI?
  3. Hi @sirhc- do you solve this in the end? Have the same error on a site and can not figure it out.
  4. Can confirm we've run into this same issue with the latest Bootstrap, latest PW and latest jQuery. We're currently doing this to ensure latest jQuery for the public and the compatible older version for editors. <?php //Load older version of jQuery for front end editor if ($user->isLoggedin()) { echo '<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>'; } else { echo '<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>'; } ?>
  5. We're currently working on a site that requires front end editing for the client. We've noticed that you don't seem to be able to use CKEditor for uploading images from the front end - is this normal, a bug or do we have an issue elsewhere? Initially, the upload seems to work - however inserting an image from the front end CKEditor doesn't seem to add the file to the page's images field as per the normal behaviour when editing in the back end. What happens instead is that the image seems to get uploaded to the server, and persists in the text area field until the page is next saved in the backend. At which point the image disappears because it is not referenced to any image field. The img tag seems to persist in the text area's source however and therefore shows in the dev tools/inspecter as a broken image link. Any ideas? We've not noticed this before, but on previous sites we've only used images fields for front end pictures.
  6. Awesome thanks @BitPoet and @gmclelland - I knew there would be a fix ? Will give this a try.
  7. Hi Andreas, The custom styles aren't available to choose in the back end. On the front-end, it behaves exactly as I would expect with context-aware styles available in the drop-down, with the adding bonus of live style updates as you would expect in the front end template. I'm not too fussed about the changes appearing accurately in the back end so haven't put in the editor css, but the styles just aren't available in the drop-down unless modifying the core mystyles.js. Front end they appear fine in the drop down. Does that make sense? I'll have to take some screenshots if not. ?
  8. I added some custom styles to the CKeditor menu bar using the example mystyles.js and the PW tutorial. This worked fine for fields when editing on the frontend. But none of our custom styles showed in the backend editor dropdown unless we edited the core copy of mystyles.js in wire/modules. Is this correct behaviour, a bug or a mistake on my part? Tried clearing cache, logging in/out etc but the backend ignores our custom styles in the site/modules path.
  9. Have done it with tags in the end!... simples! ?
  10. Hi all. We've created a private log-in area for a client on their site that is restricted on a roles basis. Is there a simple solution available to let them upload files to a file field and then choose individual users that can access individual files? Does that make sense?!... it's hard to search for answers to this as all results pertain to server file permissions.
  11. Just wondering what software/approaches others take to the management of their code snippets. Relatively new to PW and finding that its logical approach is making it far easier for me to reuse code in projects and encourages me to try and be more organised! I've looked at few notes apps that piggyback of Gists - although I'm not sure if Gists is a good idea for private project work seeing as they're never totally private.
  12. Awesome thanks - this has been a useful lesson ? I think my inital confusion on this stemmed from my hook function being my own code and not part of PW, but I guess as it is an extension of an existing class then it makes sense the other variables should be accessible. (I may be rambling here... but I know what I mean!).
  13. Ah ok - that's interesting thanks. So are all Processwire object accessible like this within hook context?
  14. GOT IT! ....obvious mistake in hindsight! I needed to pass the $page object into the closure. Because I'm populating the email to field from a page template field it wasn't getting populated as the $page object wasn't there. so $loginRegister->addHookAfter('createdUser', function($user) use (&$mail) { becomes $loginRegister->addHookAfter('createdUser', function($user) use (&$mail, &$page) { Thanks all ?
  15. The wireMail code definitely works as it was ported from another project. But double checking this has narrowed it down a bit thanks - It's definitely something to do with how I'm implementing the hook as if I move the mail sending code out of the hook it works fine.
  16. Hi all, I'm trying to hook the createdUser method of @ryan's LoginRegister module to send a notification by email to site admins when someone registers and clicks the confirm link. But struggling to get it to work. Any pointers much appreciated. I think I'm getting code blindness! ? I think the error may relate to my use of anonymous functions which I haven't used much in PHP before or object scope. I've also not made much use of ProcessWire hooks to-date either! (In at the deep end here). I know the hook fires as if I replace my wireMail code with a simple echo and die() it works. I'm not getting any errors, but no message gets sent. $loginRegister = $modules->get('LoginRegister'); $loginRegister->addHookAfter('createdUser', function($user) use (&$mail) { // Init wiremail $notificationMsg = $mail->new(); //Prep message body $msgTitle = 'A new user has registered'; $msgContent = 'Email message content'; $msgBody = '<p style="font-weight:bold;font-size:20px;">'.$msgTitle.'</p><p>'.$msgContent.'</p>'; //Create array of recipients (from on-page repeater field) $emailRecipients = array(); foreach ($page->notification_recipients as $receipient) { $emailRecipients[] = $receipient->email; } //Create array of recipients (from charge page repeater field) $emailRecipients = array(); foreach ($page->notification_recipients as $receipient) { $emailRecipients[] = $receipient->email; } //Send message $notificationMsg = $notificationMsg->send( $to = $emailRecipients, $from = 'no-reply@mydomain.com', $subject = $subjectMsg, $options = [ 'bodyHTML' => $msgBody ] ); }); $loginRegister->set('renderStyles', false); $loginRegister->execute();
  17. @Raj I second @Soma‘s advice. There’s a lot of great PW tutorials listed here: https://processwire.com/docs/tutorials/ You don’t sound like you’re a million miles away from what you’re looking to achieve and as per Soma’s comment I would just reload your script to check for submission rather than worrying about Ajax upload. Definitely recommend checking the tuts above out, it’s where I started with PW and I’ve not looked back! I’ve found PW to be the easiest CMS to get to grips with and it’s also really pushing my PHP skills to new places too :-) because the core is so well organised it allows you to be more creative with what you want to do.
  18. Still only on my iPad at mo so just guessing but don’t you need todo something like $files[0]->url to get the complete path?
  19. Does the user field get updated successfully? I’m not in front of my computer at the moment to check but from my memory the file doesn’t stay in the upload folder it gets moved to the folder where all your site image uploads go.
  20. Ah perfect - yes can confirm works as follows: echo $templates->get('dog')->fieldgroup->getField($field['name'], true)->label; New it would be available somehow - Thanks for your help ?.
  21. Thanks @dragan - but no luck with the methods in that thread either. Just to reiterate, I'm not having any problems displaying the labels. It's just that the labels being output by PW are the default field labels set in the global field editor, not the override labels applied to those fields in the template editing interface. See screen grab: Note: The field names display correctly for fields using their default names - it's just the overridden ones that don't work.
  22. I'm pulling all the fields from a template type, in this particular instance 'dog'. I'm getting all the template fields by: $t = $templates->get("dog"); $dogFields = $t->fields; The looping through my $dogFields object to output the fields as per snipper earlier. I have overridden the 'title' field in this template to be called 'dog name' as it just makes more sense in this context, but I can only ever seem to output the field's original default name 'title'. Obviously I don't want to rename the title field globally.
  23. I've overridden the name of the some fields on a template, but I can't seem to output the updated names on the front end. PW outputs their original names regardless of what is being displayed in the template editor. Is this correct behaviour? Currently looping through to get fields outputting each as follows: echo '<input type="text" name="'.$field['name'].'" class="form-control" id="'.$field['name'].'" placeholder="'.$field['label'].'">'; When I dump my $field object there doesn't seem to be any output for the overridden labels in the array, is there another way to do this?
  24. Ignore me... had the path wrong! Works if you use: cache/.avatar_uploads/
  25. I'm just experimenting with your idea @Soma as I hadn't thought about this approach for securing the upload folder before. Using the path as you described throws an error though, even if I manually create the .folder. Error: Exception: No upload path! Should PW automatically handle this path or does it need me to configure this folder somewhere? Or perhaps the server doesn't allow the .folders?
×
×
  • Create New...