Jump to content

muzzer

Members
  • Posts

    126
  • Joined

  • Last visited

Everything posted by muzzer

  1. In summary, i think that maybe there should be an emergency shut off in AIOM+, because without the method described above, how would you keep a site online say if AIOM+ was just totally failing? Yes, I have also experienced a few weeks back exactly the same as you describe here, and resolved it essentially the same way. As with you I had unwanted downtime while I sorted the issue. As a result I've also implemented a system similar to yours, which makes me think others are probably doing the same also. If this is something that is being repeated on multiple sites then ideally it should become part of the AIOM module.
  2. Looks really nice, good stuff Tom, I'm gonna install this and give it a burn when I get a minute. I realise you mention it's not version control, but if all changes are recorded (even text areas) as they appear to be then I'm guessing it's possible to add a roll-back feature to crank a field back to a previous version?
  3. OK FWIW I've kind of achieved what I was after by creating a repo solely for pulling images (/site/assets/files) from remote server to dev box and another repo for the site/templates folder to upload all dev changes I make to the remote server. Works well enough. For the images I'm talking about almost 2000 image folders with a 10-20 images per folder so doing this sync with WinSCP every few days was a drawn out process, now it's a couple of git commands and magic happens I might cron it as the icing on the cake. I'm starting to love git! I'd still like to have the entire site as a repo for backup purposes (to bitbucket) but my understanding of git is still a little limited. I suspect I need to read up on "git submodule" to handle repos within repos. Any hints here would be appreciated. Als, I'd be interested to know how many PW users use version control to manage website deployments. is it really as common as the blogs I'm reading make it seem? Cos to be honest, getting to know git has not been cheap on my time!
  4. As a solo developer I'm finally taking the plunge into git, seems like everyone is obsessed with version controlling etc so I figure I'm a bit behind the times still manually transferring files. So I've set up git on my dev box and also on the remote server, and have bitbucket in there also. My ideal workflow is really pretty simple; Make changes and test on dev box, commit changes and push to bitbucket, and a bitbucket post hook then pushes the changes received on bitbucket to the remote server (live website) and does an automatic git update. So a simple git commit/push automatically updates my live site. Much easier than manually transferring file I grant you that. Ok, now I have the entire PW site as the master branch. I realise I could just version control the site/templates folder but I want the entire site on bitbucket so that it acts as a backup as much as anything else. Also, as the website has a load of users altering images I want to be able to push the site/assets/files folder on the remote server bitbucket and then pull it onto my dev box every now and then, but never push it from dev to remote. There is also the issue of files such as .htaccess which should be ignored. So summarizing, I need to implement: never push .htaccess or site/assets/files from dev to bitbucket, but allow push of /site/assets/files from remote to bitbucket (for pull into dev) Does .gitignore handle this scenario and can I set different gitignores for dev and remote pushes? Or is there a better way? Should I be using a separate branch of the entire PW site to version control just the site folder and keep the main branch as my "site backup"? Please excuse if this is a basic question, I'm sure regular git users will think so, but I have to say, implementing git to this stage has been a bit of a mindf*** for me. But I'm getting my head around it now. Seems like there is a thousand ways to skin this particular cat and working out the best method for my particular workflow is, well.....
  5. Using repeaters for the first time and wanted some clarification; In the repeater documentation it provides sample code for adding a new repeater via the api: $building = $page->buildings->getNew(); $building->title = 'One Atlantic Center'; $building->feet_high = 880; $building->num_floors = 50; $building->year_built = 1997; $building->save(); $page->buildings->add($building); $page->save(); Okay, I've followed this with my code as follows: $pg = wire('pages')->get(86040); $newroom = $pg->sRoomsRepeater->getNew(); $newroom->title = 'new room'; $newroom->sRoomType = 85952; $newroom->sPriceBand = 85984; $newroom->sPrice = '300.00'; $newroom->save(); and a new repeater is added to the page. Sweet. I go into the PW admin and confirm it is indeed added to the page. Ryan states: So calling getNew() followed by save() creates and saves the new repeater item. What I don't understand is the final two lines of Ryans sample where he uses the add method - what is this for? In my code the new repeater field is already added and saved into the page without using this method. What am I missing?
  6. @bbeer, I know the feeling, damn you Revo! All the way to hell! But looking on the bright side, while modx was nice to develop on, it feels like my current choice of CMS is simply a classier and more hardened unit ;-) So I'm kinda glad Revo came along and killed Evo. PW will take a bit more killing thou...
  7. OK, so there is not a "console" or the like for executing API calls, just thought perhaps there was a module or something which covered this, seems to be for nearly everything else Several solutions, all better than I'm currently doing, thanks guys. @Macrura, I think I'll set this up as you describe and see how it goes. If it's got the Soma seal of approval.... say no more.
  8. Is there any way (module?) to execute basic api commands from inside the PW admin? For example, say I wanted to do a (one-off) something like set a field value to "this is a default value" for all pages with a specified template; What I do presently is temporarily add some code to a template file and then browse to a page which uses that template; Then once the commands are run I delete the code from the template..... $p = $pages->get("template=test"); $p->of(false); $p->set( 'fieldx', 'this is a default value' ); $p->save(); The PW API is so good, so coupling it with such a cumbersome method to achieve a simple pages update seems dodgy. Am I missing something? I find myself doing this type of thing quite often, so how does a real PW geek (as opposed to a wannabe PW geek ;-)) achieve the above?
  9. Holy hell that's a bloody brilliant answer, ESRCH you are the man! I've done this with a pageTable as you described and the result is perfect. But even better is the explanation of the difference between pro table and pageTable, and the way the data is stored. This explanation also gives me a better insight into why Ryan chose to have each field in PW as it's own table rather than have all fields for a page stored in one row in a pages table (like modx used to I think). This is something that always bothered me a little. response #5 should be pinned.
  10. Thx for the detailed replies. Just to clarify as there appears to be some confusion on what I'm trying to achieve; The questions will be set on the template - ie, they do not change. The user answers them all. So inputfield dependencies are not needed (but thx for the idea, never used dependencies so will have to look at this cool feature). The table field option is not one I had considered or ever used before. Tried it out and it seems to cover all the bases very nicely, so this is probably the way to go. What is the difference between a table field and the profields table? Ryan mentioned in a post I have since lost that the profields are more efficient, can anyone elaborate on this? Is the upgrade to pro worthwhile - how often are developers utilizing the other fields available in profields?
  11. I've come to a situation which I have not come across previously and am wondering how best to solve. I have a template with a heap of "questions" which usually have a yes/no answer, but may also need further detail. So a textfield with a simple yes, no, or other text such are "sometimes" would cover it. But I'd also like a couple of additional checkboxes to accompany each of these fields as a toggle for display; eg For example: do you have children? yes, Display this field (yes), Include field in emails (no) do you have pets? (yes, 2 rabbits) Display this field (no), Include field in emails (yes) do you have rabies? (sometimes), Display this field (yes), Include field in emails (yes) ...etc, you get the picture. I have probably 50-80 fields like the above. How would I go about doing this? Is this what is referred to in Processwire as a custom fieldtype? Are there any really basic tutorials or examples for something like this?
  12. @alan Yeah, agreed, SSH is nice and works well in an ideal world. It is the way to go if it's an option. However, many clients are using shared hosting so SSH is not an option. For these sites storing passwords in plain text files is not great. I can't understand why programs with massive uptake like filezilla still do this, it's a major negative IMO. I would definitely recommend anyone using filezilla check out winscp.
  13. ST3 and sFTP plugin is nice but one thing I don't like (and reason I no longer use that plugin) is that it stores passwords in plaintext files. If your computer gets compromised the all your sites are open slather. I've been hurt by this before using filezilla (also stores passwords unencrypted). I now use winSCP with an encrypted masterpassword, seems to work nice. Just my 2 cents....
  14. Thx guys. I went with Adrians idea. Once the form is filled a new page is created via the API (man this is so easy in PW, love this API !), a zip file is added for download, and the administrator gets an email to advise a new resource has been submitted. Works really nicely, stoked with result. Cheers for the advise. I was tempted to email the resources as attachments but I personally hate having massive attachments bogging down my email client. Also, depending on the email client it's often easier to extract a zip of ten files than have to extract the files from an email.
  15. Or perhaps another path would be to send files to dropbox or similar and the simply email client the dropbox link?
  16. I'm developing a site for a client which involves (non-logged in) users submitting resources which other anonymous users can then view or download. The final downloadable resources will be produced by my client from files and text (up to 10 files - pdfs, spreadsheets, images etc) uploaded by the user. So the flow goes something like this: User submits a frontend form containing a description of the resource, eg typical resource may be "Study of sustainability of commercial fishing in area X", along with a number of files, for example, shaded maps (image), spreadsheet of data, word or open document of evidence, and a number of other images. Files and text descriptions are emailed to my client Client reads through and organises the files and text into one or more PDFs. Client creates a new PW page, adds a description of resource, and uploads PDF(s) to the page Users then view the PW page and can download or view the accompanying PDFs Pretty simple kind of scenario. However, I'm conflicted as to how the upload/emailing of images should proceed; I could either: email the uploaded resources (up to 10 of) direct to the client, or use the API to create a PW page, add the uploaded resources to the page, save page, email resources from the page to the client, and then finally delete the page. Option 1 is simple, but there may be issues? - email failure would result in loss of the resources - large email (10 attachments of up to possibly 5Mb each) could be seen as spam? etc. Option 2 is a little more complex but allows resources to be maintained - in case of email failure resources could be downloaded manually I'm looking for suggestions here, which option would you choose to implement, or an alternative path altogether?
  17. Are you using the same template for the homepage as for the subpages?
  18. Odd indeed. Anything in the log file? I would update the .htaccess and wire folder to original. Then getting desperate I would remove all code except an echo/die statement from the page template. If it works then it's prob something in the template code. Other than that, what modules are installed?
  19. I've used this type of method for various things in the past, perhaps not on PW, but the way I've done it is to surround the entire string with the "\" character, eg |2|13| This way I believe you can use the %=|3| selector to find only the 3 edit: and you could also use %=|3 to find 31, 310, 35 etc
  20. Yeah, well done maxwell, only gets easier from here... Some great photos on the site. I've tried taking photos of interiors when trying to sell a house and yeah, it's not easy to get a good pic within limited space, I envy your skills and knowledge with the lens.
  21. @Joss, my recent experience FWIW; Been playing with PocketGrid for the past couple of days also. Found it to be a very sweet little system. Redesiged an entire non-responsive site to be fully mobile-compatible (my first responsive site) in about 6 hours, including developing my own responsive menu, learning the grid (10 mins max, so simple) and converting content with new styling. To say I was impressed is an understatement. I've tried Bootstrap, Foundation, Pure, and a pile of other grid systems in the past few weeks and kinda felt "weighted down" by them, and doing exactly what I wanted often caused more problems than it solved. This could be because I'm not fluent enough in their use - I know others rave about Foundation etc - but really, PocketGrid was so easy to use and I felt like I still had complete control of the pages. I like that
  22. Also (this may be helpful), I find it sweet to use multiple users (or profiles) in Chrome. Because each instance has its own session storage you can be logged in in one instance of Chrome and logged out in the second, so you see both the admin and client versions of the website you are developing (assuming they differ) without having to constantly login/logout. .
  23. I recently used MailGun for a newsletter mailout and it was the bomb. No ads for the free account which is also very generous in it's limits. The API was nice also allowing me to send contacts and campaign info to Mailgun direct from PW. Not as "out of the box" ready as the likes of MailChimp - a bit more down and dirty which I quite like ;-) Some services are just too polished! Also check out Mail tester if you have not already. Nice little site which analyses the email you send to it and advises how spammy it is and how to rectify any issues to get the best mailout results,
  24. Thanks all, Teppos article is pretty sharp, don't know how I missed the existence of all this, perhaps because I've been avoiding getting into module creation which is where it seems hooks are mostly used @MindFull; It seems I can't access the functions arguments $num and $seed inside the function, eg debug( $seed ); returns 2 even if I pass a different value to the function, but I can do debug( $event->arguments[0] ) and that retuens the passed value; Is this normal or am I on another planet?
  25. holysh*t, never knew you could do that! Absolutely solves my problem, thx @MindFull for the explanation. BTW, what is the 3rd to last line for? $example - new $PageArray(); , is this relevant?
×
×
  • Create New...