Jump to content

sambadave

Members
  • Posts

    59
  • Joined

  • Last visited

Everything posted by sambadave

  1. @wbmnfktr We've tried adding the remote database server's IP to our local hosts file. Unfortunately we're not seeing any noticeable improvements. We're asking our IT department about the security measures they have in place and waiting for a rresponse. @rick We've not noticed a delay via SFTP. I'm not too sure about your other questions yet but I've asked other people on the team and have also passed this thread link on to our IT team. I can confirm that one member of our team wasn't using MAMP and still experienced the same issues, so that may rule out anything to do with MAMP setup. I'll let you know if I find out any more information. Thank you both very much for your help so far.
  2. Has anyone noticed abnormally slow page load times when working locally but connected to a remote database? I work within a team and we all have local versions of our PW sites but are connected to the same remote database. This allows us all to work from the one ProcessWire admin area, which we prefer. We have noticed our sites loading really slowly in this scenario and it is really limiting productivity. Average load time comparisons across our websites Working locally, connected to remote development db ~30s to 1 minute (1minute for more complex pages) Hosted development site - connected to same development db ~5s - 10s Live site, optimised with ProCache etc and live db ~3s - 5s Our template setup Overall, the majority of our page templates aren't doing anything particulary fancy. Most templates allow sub pages to be rendered on the parent page as blocks using the $page->render approach. In some cases there may be a number of blocks to display. We recognise that rendering a lot of blocks on a page could slow things down a little but not to the degree we are encountering. Steps taken to identify issues in our code As a test we removed all the rendered blocks from the parent page template logic and went as far as just showing a single static <h1> heading. We still saw times of ~15s with an almost empty page. It feels like this has something to do with the database connection, or maybe something within our MAMP setup on our Macs. It's strange as our hosted development and live sites are so much faster, so this feels like a problem with our local setup. If anyone has any suggestions as to where we are going wrong, we'd be very grateful. It can be quite frustrating when we need to refresh the page regularly to see our changes but we know that we will face up to a minute wait just to see if something has worked. The live sites are really fast so this is definitely something with our setup I would think. Thanks in advance for any words of wisdom 😊
  3. Thanks @bernhard I've very little exposure to hooks but I really should have a dig around and this is a great example to work from. Also thanks @DV-JF I never thought of that approach as well, by addidng pages through the page reference field. As always, there are lots of great ways to approach it with PW which is great. I apreciate your help πŸ˜€
  4. @BitPoet @kongondo Wow, exactly what I needed. This opens up so many possibilities. Thank you! πŸ‘Œ
  5. Hi there Short version of question Let's say I have a page in the admin that contains a field... Is it possible to output the content from that field on another page in the admin? Almost like a reference. Longer version of question (with example) A house builder with multiple (60+) developments. They want to be able to create notices/messages that can be added to one or many developments. Handy for things like regional covid lockdowns or temporary office closures due to bad weather. My approach for the admin editing options: Add each message to each development Pros: You edit the message on the development page in context Cons: Very time consuming and repetitive if the same message needs to be applied to 60+ developments Control all the messages from one admin page and say which development each message should be applied to Pros: Easier to add/remove messages to more than one development at a time. Control all messages from one place. Cons: Content is not added on development page, which is where typical admin users may expect to find it I went for option 2 due to flexibility, and created a page within the admin for global development notices. This contains a repeater with: Field for message to display Checkbox list of all developments. The user can select which ones to apply each message to It's working really well but the only thing is that if the user goes to a specific development in the admin, the relevant messages aren't displayed in context (as they aren't edited on that page and instead on the global development notices page)... which may cause confusion when a new staff member / content admin tries to edit the text but there is no field when they go to the development admin page where they expect to see it... Solution??? I don't require the message(s) to also be editable on the development page, but I wondered if there was a nice way to show it/them somehow. I feel like I am missing something really simple as I'm sure ProcessWire will have a nice way of achieving this, or maybe there are field settings that allow this kind of thing to happen? Any ideas on approaches or similar experiences would be much appreciated, even if it is just a much simpler example with the content from one field being shown on another admin page to get the ball rolling. Thanks in advance for any advice :)
  6. Apologies @kongondo I should have mentioned that I changed the settings of the file field to an image field after thinking the same thing. Ihad no idea that this would work with other file types as well so that will be useful on other projects I'm sure. For the website I'm working on an image field was enough though. Icould be wrong about the CMYK thing too. It turns out that the images were huge and had high 300 dpi settings so I think PW just crashed out trying to resize them. Uploading a more sensible image to start with seems to work fine now. Hope that helps πŸ™‚ It's a great module, so thanks for making it available.
  7. It looks like our client has uplaoded CMYK 300res images into the site. Swapping this out with an RGB image and PW seems able to resise it. Maybe PW struggles to resize CMYK images? I appreciate the help @heldercervantes Thanks
  8. Thanks for this great module. @kongondo - When rendering out the base image on the page I tried to add a width using processwire's standard image->width($x, $options) approach however I can't seem to get the image to ender when this is applied. I tried changing the field type to be image instead of file but still no luck. Is there something different about this field to the standard image field that the above approach would usually work on and do you have any suggestions as to how I could output a resized version? The client I am working with has multiple editors and not everyone knows to resize the image before uploading. I could leave a note in the CMS next to the field temporarily I guess. Any help would be much appreciated. Thanks
  9. Hi @teppo is it possible to order the results by the number of times the search query is found so that more important pages are listed first? For example, a page containing the search term 5 times would appear higher than a page with the search query found only once or twice?
  10. Thanks @Macrura and @dragan for the ideas. Selectize looks like it could do the trick! I'll check out that icon module too. Much appreciated Dave
  11. Thanks for such a detailed explanation @bernhard that's new to me and will definitely come in handy. I guess if I was to do this then I'd have to update the hook for any new select options though. If I had a set of 50 icons, 10 colours etc it could end up being quite a chore updating the hook file every time. Correct me if I'm wrong here though. Ideally, I'd like to set up the config area so that other admins that aren't necessarily coders, could add new options through the CMS. The beauty of the page reference select list is being able to select a parent page and show the children as options in a select box/radio/checkbox etc... so if you add a new option through PW admin the list just updates automatically. I'm sure there's a solution to this as is always the case with PW. Thanks again.
  12. Thanks @Sergio I kind of understand how that module works now after a quick skim through. I'm not quite sure how I would go about using that to create a selectable list though. Apologies, my PHP knowledge isn't brilliant. I was hoping that I'd be able to somehow open up the paramenters for the "Custom Page Label Format" on the "Input" tab of the speific page reference field to somehow allow me to add additional php and/or html markup within that, wrapped around the particular field values that I wish to use? Do you think something like that is achievable?
  13. Hi everyone, here's the problem I'm trying to solve. I have a config area in my PW admin that is locked down for admin use. I use pages to store a bunch of settings that I'll use for my clients website. It's mostly used for visual things like colours and theming. This list could be tiny or large, depending on the sites requirements, but its great because I can store any information I want to. So the page tree could look something like this: ADMIN SETUP Home Config Aesthetics Colours Red Field: Custom Label - "Red" Field: Class name - "theme--red' Green Field: Custom Label - "Green" Field: Class name - "theme--green' Blue Field: Custom Label - "Blue" Field: Class name - "theme--blue' etc... Sizes Small Field: Custom Label - "Small" Field: Class name - "sm' Medium Field: Custom Label - "Medium" Field: Class name - "md Large Field: Custom Label - "Medium" Field: Class name - "lg" etc... Icons Target Field: Custom Label - "Hands shaking Icon" Field: Icon SVG - "[svg code]' Target Field: Custom Label - "Target icon" Field: Icon SVG - "[svg code]' Success Field: Custom Label - "Happy face icon" Field: Icon SVG - "[svg code]' etc... HOW I USE THIS I'm then able to set up page reference fields for colour, size and icons. I'll use these fields on particular pages so that my clients can select a particular colour, size or icon, or anything really. Currently, with the page reference field I can create a custom label for the options. So for something like colour I can label the field "Theme" and present a list of colours like "Red, "Green" and "Blue" using the custom page label label format of the colours page. This of course means that I can use this to do some lovely presentation on the front end of the site. With a colour selected I'll then be able to use the page reference to get the class name for that colour theme so that I can update the page's look and feel. So in my markup I'd end up with "theme--red" or "theme--green" etc. THE PROBLEM I have this all working which is great and it's really flexible for the client which they love. However, I'd love to be able to make things more visual for the client. Is there a way to be able to output more than just text in the page reference field? I might have a bunch of different blue colours, so instead of a list like so: Navy Blue Deep Blue Bright Blue Sea Blue ... it would be great to be able to output actual colour swatches, which is a lot mor visual for the client. Taking the icon selector, I would ideally like to show the actual svg that I've stored against that icon as a selectable image instead of seeing text options like: Hands shaking icon Target icon Happy face icon Just a couple of scenarios here, but as you can see there could be any number of reasons to display a more visual method of selection. ANY SOLUTIONS? I've looked at modules like FieldtypeColorPicker which could help in solving the colour issue, but it doesn't allow me to select a colour and then use a particular class name assigned to it the way I describe above. Considering the other use cases I mention above, does anyone know if anything exists already that would help me to create custom presentaion for page reference lists, or if there's anything planned? Thank you in advance for anyone who's read this far and has any words of wisdom! Dave
  14. Good shout @dragan These links could point to any new resources as and when new builds are released. Things like intro videos, the PW cheatsheet, some basics on templating/setting up a field and adding it to a template. I find that when I show a new guy the relationship between fields, templates and some simple back end logic, it sparks a "Are you serious, it can't be that easy!?" comment every time. There's nothing that I can see in the ProcessWire journey that introduces this at the right point... the point of installing and going "What's next?" It might be that people are downloading it, but maybe they're dropping off once they see a blank installation and aren't sure where to go for a really simple breakdown of how to get started with templating. There's a tonne of great content already on proceswire.com explaining this, but it's maybe not structured into this journey in a way that a new user would naturally expect to find it.
  15. I totally agree that we need a new processwire.com. Our existing clients that use PW think it is brilliant but it's always quite hard to sell it in initially to new clients using pages from processwire.com. Admin look and feel I've found that most of our clients aren't concerned with the admin skin. It's simple and does the job really well. That said it could be modernised and it would be more visually appealing. A good example would be Umbraco, who's CMS used to look terrible, until it was given a fresh new face. It's really stripped back now and almost has a kind of Apple, utilitarian feel which lends itself to the task at hand. I think their users increased rapidly following this. Who is ProcessWire for? Everyone... but for different reasons! One thing I've learned from working with ProcessWire, is that it means different things to different people in terms of what is important and how PW tackles the job. A facelift may make it look nicer but I think the site needs to really target a few different audiences with some quick summary pages, highlighting why it's perfect for them. Designers Back end developers Front end developers Project Managers Content Editors Clients Marketing Directors If you can target these groups, under a general "Why ProcessWire is great" kind of entry point, then I think we would see a lot more people hitting that download button. I know the current PW site kind of tackles this, but I would say that it should be more obvious. After Installing PW... what next? When I downloaded Processwire initially I thought "okay what do I do now?". I came from an umbraco background so knew that I would essentially be installing a blank CMS (which I like as there's nothing that I don't need)... but if you're coming from Wordpress or are a first time CMS user, maybe you're expecting more... maybe you're expecting a landing page with links to useful resources and videos... Maybe this landing page could be tailored based on the type of user you are? Video - Tell me stuff I searched on google for demo videos and stumbled across a great video that Ryan had recorded. I think video is the way forward here. If people are time starved, then they just want to be introduced to the admin and all the great things it does. The thing is though, that if an admin reskin is in the pipeline, you can't record your video until that's done. I'm just rambling now... but hopefully some of this is useful. Cheers!
  16. Update: Adding templates fixed by adding auto_increment to id in "fieldgroups" table.
  17. Hi Wanze, thanks for the tips. I updated to 2.6.1 and I'm not receiving the error you quoted any more thankfully. I also tried your other tips but with no luck. I'm a bit closer to a solution though. Although editing existing pages was completely fine I was having a lot of bother creating new pages, new fields, new modules etc. After a bit of googling I was able to set auto increment for primary key in those tables which has fixed a lot of the issues as far as I'm aware. For some reason though I still can't create new templates. I'm getting the following error after trying to add a new template in PW: Session: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '0' for key 'PRIMARY' I assumed like the others that this was coming from the templates table so I've set "id" to auto_increment. It doesn't fix my problem though and I'm out of ideas now. It feels like I've definitely made a mistake somewhere along the way when exporting / importing databases so I've only myself to blame here. I'm still learning this side of things.
  18. Sorry folks, I'm having no luck tonight. I can't add any new pages, fields or templates... and I'm not sure if there are any other hidden errors that I haven't come across yet. I'm no SQL expert here but after a bit of looking around I think my database might have fudged at some point (most likely when I was exporting / importing). The client hasn't had to create any new pages until now so I think it's been hiding for a while. It appears to have something to do with auto incrementing and primary keys. Like I say I'm no expert here so after a little bit of editing in phpmyadmin I've managed to sort out some of the problems. I'm not 100% confident with any of the changes I've made and I'm not sure if there might be a lot of other stuff under the bonnet that I'm not aware of that still needs looked at. Can anyone give me any pointers as to how I can begin to fix this?
  19. Thanks MuchDev. I don't appear to be getting the crazy never ending page tree now which is great. I can edit pages fine, but still can't add pages without getting the following error after clicking "save" on the "Add New" screen. Error: Maximum execution time of 30 seconds exceeded (line 1896 of /Applications/MAMP/htdocs/viceroy/wire/core/Pages.php) I wouldn't have thought ProcessWire would be struggle to create a page in 30 seconds?
  20. Hi MuchDev. Thanks for helping out. I'm using version 2.5.3. I was using Firefox but just tried in Chrome too and the same problem exists there too. I'll try and upgrade and let you know how I get on. Do you think there's a good chance that upgrading would fix this? I wasn't sure if "Menus" might be some sort of admin specific name and that's why all the admin pages have jumped in there? The error log is saying this (I've masked out my site url): 2015-11-11 17:09:34 admin Module ProcessPageEdit failed init - Unknown page 2015-11-11 17:09:34 admin Module ProcessPageEdit failed init - Unknown page 2015-11-11 17:09:34 admin Error: Call to a member function is() on a non-object (line 106 of /home/viceroyf/public_html/wire/modules/Process/ProcessPageEdit/ProcessPageEdit.module) 2015-11-11 17:09:37 admin Module ProcessPageEdit failed init - Unknown page 2015-11-11 17:09:37 admin Module ProcessPageEdit failed init - Unknown page 2015-11-11 17:09:37 admin Error: Call to a member function is() on a non-object (line 106 of /home/viceroyf/public_html/wire/modules/Process/ProcessPageEdit/ProcessPageEdit.module) 2015-11-11 17:09:38 admin Module ProcessPageEdit failed init - Unknown page 2015-11-11 17:09:38 admin Module ProcessPageEdit failed init - Unknown page 2015-11-11 17:09:38 admin Error: Call to a member function is() on a non-object (line 106 of /home/viceroyf/public_html/wire/modules/Process/ProcessPageEdit/ProcessPageEdit.module) 2015-11-11 17:12:18 admin Error: Maximum execution time of 30 seconds exceeded (line 165 of /home/viceroyf/public_html/wire/core/Field.php) 2015-11-11 17:12:18 ? Error: Exception: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away (in /home/viceroyf/public_html/wire/core/DatabaseQuery.php line 91) 2015-11-11 17:12:18 ? Error: Exception: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away (in /home/viceroyf/public_html/wire/core/DatabaseQuery.php line 91) 2015-11-11 17:14:06 admin Error: Maximum execution time of 30 seconds exceeded (line 922 of /home/viceroyf/public_html/wire/core/Pages.php) 2015-11-11 17:16:03 admin Error: Maximum execution time of 30 seconds exceeded (line 933 of /home/viceroyf/public_html/wire/core/Pages.php) 2015-11-11 18:13:22 admin Error: Maximum execution time of 30 seconds exceeded (line 938 of /home/viceroyf/public_html/wire/core/Pages.php) 2015-11-11 19:04:56 admin Error: Maximum execution time of 30 seconds exceeded (line 677 of /home/viceroyf/public_html/wire/core/Page.php)
  21. Hey folks. My client has just mentioned that they can't add any pages on their site. I went to have a look and it appears that the tree nav is all over the place. For some reason my tree nav is caught in an endless loop where random admin specific pages keep repeating inside? It goes on for ever. When you click in to a page it uses the same page id, regardless of where in the tree nav you select it from so I'm scared to go deleting pages. Can anyone help me here?
  22. Thanks Soma for the detailed answer. Really appreciate everyone's help here. It'll take me a while to get my head around all the feedback but I'll see how I get on within a safe testing environment first. Thanks again
  23. Hi guys Thanks Andreas – Good to know I can do that. I'm just a little concerned for larger sites as going through all the image folders to delete certain images could take ages and might involve an element of risk if I was to delete the original image by mistake. Unless there is a way to do this with code? tsdtsdtsd – I wonder if there could be a way to toggle this setting through the admin to allow options to be taken into account. It's not a biggie now I know but it would be a shame to have a huge site and have to go through all the images manually. ProcessWire is still awesome though!
  24. Hi folks I recently put a site live and in the last stages of the project decided to do some image optimisation. $options = array( 'quality' => 70, 'upscaling' => false ); $pageImageLargeDesktop = $pageImage->size(960,720,$options)->url; The thing I love about ProcessWire is that you can change the size here and the new images will be generated across all pages. It's such a time saver. However after adding in $options parameters I expected the quality of the images to reduce on a page refresh, howeever the quality settings only seem to be applied during upload. This meant I had to re-upload all my images again into ProcessWire for the changes in quality to appear. Is there a way of getting round this? It wasn't a massive problem for this particular site but I'm thinking more along the lines of a larger site with hundreds or thousands of images. You just couldn't go back in and re-upload every image unless you had a lot of time on your hands. Am I missing a trick? Thanks in advance for any help.
  25. Hi guys, apologies for such a late response on this. I had to put this project on the backburner for a few months. cstevensjr – I installed the WireMailSmtp module, filled in the relevant fields and my tests are working now. pwired – Thanks for the response too. I don't doubt your solution would have helped but I tried cstevensjr's solution first and it worked. Thanks so much for the help folks, I appreciate it.
Γ—
Γ—
  • Create New...