Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 02/28/2013 in all areas

  1. Table of contents Introducing the App and author Needs First version in PHP/MySQL without any Framework Why Processwire? App Version 1.0 Introducing the App and author Hi, my name is Luis and i´m a German based Web and Frontend Developer. I started 2010 with my own Internetbusiness and noticed at the very beginning of my business that it takes to much time to handle my accounting, invoices and clients. The main problem was that I needed for almost every task his own software solution, so the usual workflow in creating an invoice was something like open the CRM Software because the invoice software was good in creating invoices but bad in managing and searching clients, copy and paste the client into invoicing, create the invoice and handle it over to the accounting software. Not good at all... So I decided to create my own solution to fit my needs in the office management. Needs Invoicemanagement and creation Clientmanagement, very basic CRM Accounting Multi-User Simple financial stats about the Keyfacts of my business possibility to export the data for my tax consultant PHP / MySQL to work with it on intranet After pointing out my personal needs and writing down my usual workflow I started to develop the first version. First version in PHP/MySQL without any Framework In winter 2011/2012 I completed the very first version of my OMS (office management suite). The whole project was written in good old fashioned PHP from scratch. I´ve used this version till November 2012. Why Processwire? In mid 2012 I discovered Processwire and had no idea in how many ways this tool would change my life as webworker. After playing around with PW and developing the first little sites I had a little talk with my tax consultant, she said that my financial reports are pretty good and help to save money. (less time, smaller invoice from her) Why not publish the tool? Well, at this point my app was solely written for my needs, without possibilities for an Multi-User environment or for use in an companies Intranet. I finally decided to port the app to PW because of it´s flexibility, scalability and built-in user-roles. I had to dig deeper into PW at this point to see if I really could. Late 2012 I started porting the app in PW and was surprised how insanely fast developing could be. The whole database structure was ported into PW Pages, no SQL query is done by the app itself. It was possible to recreate the core functionality in about 2 weeks, implementing the Login and Multi-User functionality took another week. WebApp Version 1.0 https://youtu.be/PIgUMLZEcIU The app is now available for purchase @ www.misterui.de * also Processwire with an own eCommerce Script
    8 points
  2. Send photos from your mobile phone to ProcessWire, from anywhere, on-the-fly. ProcessWire maintains a chronological gallery that you can simply email photos to. Works with any e-mail capable device, whether mobile phone, tablet or desktop. Written by Horst Nogajski and Ryan Cramer Output inspired by the work of Philipp Reiner. Discussion leading to this module can be found here. Uses email libraries by Manuel Lemos Requires ProcessWire 2.2.13 or newer Here is example output from this module. Download from GitHub or Download ZIP file How to Install Setup a new email address at your provider. This address should be dedicated to the purpose of this module. Make the address private and cryptic enough so as not to be obvious or discoverable by others. Place the files included with this module in /site/modules/EmailImage/ In your admin, go to Modules > Check for new modules. Click Install for the EmailImage module. Complete all the settings it asks for, per the email you setup in step 1. Check the box to test your connection, and save. How to Use Email an image to the address you configured. You can include multiple images if you like. After waiting a minute or two, view the URL /email-images/ in your site. This is a page that was installed for you to display images. Repeat and enjoy. How to Customize While this module has everything working out-of-the-box, it is meant to be customized to your needs. For example: You may want to move or rename the /email-images/ page somewhere else. The EmailImage module keeps track of this page ID, so it is perfectly fine to remove or rename it if you want to. Take a look at the /site/templates/email-images.php template file. You may wish to replace it entirely with your own code, or you might build upon what's there, or use it as-is. But chances are you'll at least want to swap in your own header/footer to fit within your site's design. Take a look at /site/modules/EmailImage/EmailImageRender.php. That file contains an example function used to render an image gallery. This is the one called upon by the template file you just looked at. You might copy and paste this function somewhere else into your own site, and modify it to suite your own markup needs. Just remember to name it something different! Please post links to what you create in this thread. How to Uninstall You can uninstall this module in the same way as any other module, by checking the box to "uninstall" from the module settings screen. But please note the following warning: When you uninstall, your system is returned to the state that it was in before this module was installed. Meaning, the EmailImage pages and images will be deleted. So please backup your images somewhere else if you want to lose them during uninstall. After uninstalling, you can safely remove this dir: /site/modules/EmailImage/, and you can remove the template file: /site/templates/email-images.php.
    4 points
  3. Hi folks, I just wanted to say hi and that I am very excited to use ProcessWire for future projects. I stumbled upon pw yesterday, read some tutorials, watched some videos, read through the forums a bit, installed pw and tinkered around a bit and I must say I might have found the perfect CMS for my needs. I've tried many CMS but they all seemed too simple, too bloated, or the apis were just plain fugly (looking at you Wordpress). Also the community is small but seems very friendly, personal and professional. Anyway, so I am really looking forward to this =) Greetings from Berlin, Germany Christian
    3 points
  4. One day I will do this properly completel with examples, but for the moment, this is a hints and tips approach Creating a proper video tutorial First of all I have to say that I am not in favour of video tutorials for myself, especially covering a subject which is basically concerned with reading and writing. However, they do work well as an overview and many people like following them. The Big Wrong Things "So, what can go wrong? I mean, I know the subject, I sit there coding every day, this is my world - just turn on and record. What is the problem." The list is, sadly, endless. But here are a few things that can ruin your plans (and spoil my viewer experience): Mouse pointer waving around pointlessly Bad visual quality so it is unreadable at full screen Irrelevant windows all over the place Endless leaping between this screen and that screen and this and that folder, application and so on Muttering Repetitive, "I will just ... er,...not there ... oh yeah, that one.... oh, forgot a bit..." Forgetting to introduce not just the video but the various parts Tiny font size Buzz words, nicknames, unexplained short cuts ... Too long Trying to tackle a too complicated a subject And there are many more. So, how do the pros do it? I probably have a bit too much fun listing all the things I have done over the years just to confuse people, but the truth is that my main role has been rather bland - I have produced and/or recorded THOUSANDS of sound tracks for corporate productions, and video edited and even directed quite a few too. These have tended to be big budget affairs with professional camera operators, enormous Grass Valley editing suites, professional presenters and voice overs and so on. But that does not mean that the skills eat up the budget - it is just the fees that do. The skills are straightforward and logical and are free to anyone who wants to practice a bit. So here is a bullet pointed step-by-step guide. 1. Preparation Knowing what you are talking about ISN'T preparation - it is nothing more than a knowledge base. Most technical videos are written by people who do not know the subject but do the research and turn it into something meaningful. Trust me, even if you know the subject inside out you still need to do research and preparation: What level of expertise does the audience have? What is the conclusion of your tutorial? Do you know how to explain every action your will make? If you go through what you are trying to do correctly, you will find out there are lots of things that you know instinctively that you realise others might not know, or you have no idea how to explain. List them. Break it down. Remember that your audience cannot read your mind, so look for the things that you frequently skip over that may lose someone not living in your head. 2. Script Writing I cannot emphasis this enough - WRITE A SCRIPT!!! I don't care that YOU think you are the best ad libber around - you aint. I probably am, but I would never do a lesson unscripted. Even politicians who do long speeches "unscripted" don't really - they script every word and then learn it inside and out over days. Writing scripts scares the bejeesus out of people, which is why there are so many terrible, unscripted tutorials out there, but it is not as hard as it seems and it will make the rest of the process far easier in compensation. Start with a list. Coding tutorials, in particular, are nothing more than a list of actions - write this, press that, check this. So, when writing your script - start by doing that. Make each action as short as possible: "Open a new file" "Write <?php at the head" "Save file" and so on. It is as boring as hell, but you will not only get the lesson in the right order, you will quickly find out what is missing or what does not work. Break it into scenes. I think most people think that scenes in videos and film are three or four pages long. Well, to be honest, a lot of them are just a few lines. Think of it as a paragraph. Take my bullet points above; creating a new file and preparing it to be used as a php file is a complete action - it is a scene. The next scene maybe setting out two or three empty functions for one particular aspect, or perhaps preparing some other files. These scenes are intentionally short and this will become important later. Turn it into SPOKEN English/other language. This is distinct from language to be read. When we speak, we use short phrases, breath a lot, use huge amounts of semi-colons and frequently start sentences with "and." Your script will be spoken out loud and when you start turning your list of actions into sentences, you must remember this. Read each sentence out loud as you finish it; not in your head or mumbling, but right out loud at the volume at which you will record the finished video. Do not run words together, remember to hit the consonants NICE and clearly and look for the emphasis words; you can ALWAYS use capitals if that HELPS. Recording This is your make or break moment! Actually, no it isn't - you just did that when you wrote your script. If you have written the script well, the the next stages are predestined to be okay. You will make mistakes, but they will be easy to correct. It will only go wrong if you have left stuff out of your script, so read it through a few times to make sure it is perfect. Then PRINT IT OUT. Should you rehearse? Yes and no. You will not be recording this in one lump (that way lies madness) so it is a waste of time rehearsing the entire thing. However, rehearsing each section before recording is a good idea. You need to work out your moves between screens and how you speak the words. In the pro world we would only do a guide vocal at this point and then the voice over would come into my studio with a tidied script and we would re-record the final version. That is why pro stuff is so good. You can take that route if you wish, but the chances are you want to talk as you go. Take One You have written this in scenes, so only record one scene at a time. Play it back when you are happy and make sure it makes sense. These are now bite sized so are much more manageable that working in huge chunks. Put your screen recorder into record and wait a few seconds before you start talking or making screen actions - it will take the pressure off. In the pro world, when the director yells ACTION, there is always a pause while the performers get their brains into gear. And good thing too - otherwise their first words would be a reaction to the shouted word "action" and not as part of the scene as they should be. This applies as much to a corporate as it does to a drama. How many takes you do is up to you - but do not be pissed off if you have to do several. Coders are meant to be perfectionists, and doing a voice over and screen shots requires just the same attitude and degree of patience. What speed should you speak at? Slower than you think is right. This is not a commercial and you are not a professional voice over. Speaking clearly at speed takes YEARS of practice and even some of the best voice overs never get it right. But in corporate presentations, speaking fast is an absolute no-no. Speak evenly, in a considered, non-patronizing way, emphasising all the important words and resist the temptation to speed up towards the end of the sentence. Emphasis is a funny beast - many people believe that we emphasise by speaking louder. But in reality, we emphasise by slowing down the word and leaning on one particular syllable. Which word and syllable you emphasise is important too. There are two main forms of emphasis - importance and comparison. Importance is where you want to make something the most important bit of information. That can be a verb or an adverb or adjective. "It is VITAL that you shut the door." Vital is the important word here - you are emphasising the importance of the action "shut" by saying how vital it is. Comparison is when you are offering an either or - even if you are not explaining or referencing what the other thing might be. "It is vital that you shut the DOOR" Here it is now the door that is important and we are saying you should shut the door, rather than a window or cupboard or anything else. It is making a comparative. You can get it wrong. "What did you do in the nineteen seventies?" "I went to school in the nineteen SEVENTIES." That is the wrong answer, even though it is the correct words. You have made a comparative of the date. You should have said: "I went to SCHOOL in the nineteen seventies." On your printed script as you rehears, underline words that you should emphasise to make sure you don't start making it confusing simply by emphasising the WRONG words, and make marks / where pausing slightly / will also help with clarity. Your reading will be much better and the whole process much easier. Editing. You can ruin good footage in an edit, but you cannot do a great edit out of terrible footage. Do not rely on the edit to save you - get it right at the recording stage and the editing will be more fun. You have written this in scenes and when you edit, respect those scene breaks. You probably broke it up at logical points so it will not help if you try and run it altogether seamlessly. Pause between scenes - if there are major breaks, consider fading to black and slipping in a caption; it might give people break points to stop and take stock and it will help with the clarity. Do not put music over the main content - not that sort of video. Clean up the sound as you go - remove any paper rustles or next doors dog barking! Think about pace - keep the edit pace even. Avoid tricks. Just stick to fading in and out of black - don't spiral stuff in and out or do other things that your editor can do. Again, wrong sort of video. People are not looking at this for your editing skills, but your coding skills. They should not notice the edit at all - just absorb the wonderful knowledge that you wish to impart. Try to avoid zooming into a screen - the quality can fall apart very quickly and you will have achieved nothing. Presenting your final edit You have gone to the trouble of writing a script, so when you put your video up, maybe put the script up there with it - might help people as a quick reference! Make sure you précis your video with a good written summary of what it is about and what you hope the viewer will learn/achieve. And that is about it! I have not covered every single pitfall and problem you will encounter - that would be a book's worth and a boring one at that! But hopefully I have given you some fairly straightforward, easy to follow advice that will just help your next video turn the corner from "nice chatty person telling us something" to "expert giving serious guidance." Happy filming! Joss
    3 points
  5. Just searched for processwire on GooglePlus - and found this interview: http://www.cmscritic.com/interview-with-ryan-cramer-of-processwire/ ... no time yet to read it, though.
    2 points
  6. It depends on the field as to how the data is saved. But for textarea/tinymce it is saved exactly as it is presented, meaning just the HTML that TinyMCE provides. It's okay to edit it by other means. The way I usually solve the TinyMCE static links issue is to perform a search/replace on the DB dump file after exporting it from dev and before importing to live. I guess it's just become part of my workflow. But I really would like to find a native/built-in solution for this particular issue so that nobody ever needs to think about it.
    2 points
  7. If that little app impresses you so much, I can´t imagine what my next project will do with you
    2 points
  8. I think that a module like this mainly provides value in sending a mobile photo to a web site. The reason for that is that many of these mobile phones have no file-upload capability (at least iOS doesn't). But they can send email. So this module actually solves a need and lets you do something you can't otherwise do. Phillip identified the need and solved it by using Tumblr as an intermediary (since their app will pass through photos), which was a great idea. This module solves the need by using email as the intermediary--the one common thing available to all smart phones (and all credit to Horst and Phillip for the ideas). When we get into specifying other types of data and fields, like what's been mentioned above, it definitely sounds cool and interesting. But the reality is, we don't need email for that… we could just login to ProcessWire. We need email only because mobile phones can't upload files. I don't personally have a need to populate text fields from emails, but it's feasible someone could (like some of the things MarcC mentioned, for example). For that need, I think the approach taken in this module would be a good way to go, and perhaps this module could serve as a good starting point to build that capability, for anyone interested.
    2 points
  9. Cool now I can finally use outlook to build websites.
    2 points
  10. ProcessWire Email Obfuscation (EMO) Download | GitHub Email Obfuscation module for email addresses with 64 base crypting. This module finds all plaintext emails and email links from the document and replaces them with span elements including configurable replace text. All the addresses are encoded to 64 base strings and stored in spans data attributes. Then on client side we decode these strings back to their original state. Install Create new 'EmailObfuscation' folder into /site/modules/ and place the content of this repository into the directory. Login to processwire and go to Modules page and click 'Check for new modules'. Find 'EmailObfuscation' and click install. You can make optional configuration changes in the module admin page. Thanks This is a ProcessWire module fork from MODX Evolution plugin emo E-Mail Obfuscation. http://modx.com/extras/package/emoemailobfuscation EDITED ON: 2013-03-03 - Added description. 2020-04-16 - Fixed GitHub links and updated description. Hello all. Just found PW few days ago and it's already looking awesome! Here comes first contribute and some questions for developing it further. There was one existing email obfuscator on reposity that didn't use any crypting for addresses so I decided to do a little test run and port the one that we currenly use with MODX Evo to ProcessWire module. I'd like to make PageAutocomplete like gonfigure option to admin so that one could select and set templates to exclude module action. It looks like autocomplete is tied to pages and since templates are not set to system as pages this is option is no go, am I right?
    1 point
  11. Just wanted to post it here for others that might look for an example. I'm currently working on importing a Site to PW2.1. Following code I figured is needed to create pages using the Bootstraped API: <?php include(./index.php) // bootstrap PW $p = new Page(); // create new page object $p->template = 'page'; // set template $p->parent = wire('pages')->get('/about/'); // set the parent $p->name = 'mynewpage_url'; // give it a name used in the url for the page $p->title = 'My New Page'; // set page title (not neccessary but recommended) // added by Ryan: save page in preparation for adding files (#1) $p->save(); // populate fields $p->image = 'path/to/image.jpg'; // populate a single image field (#2) $p->images->add('path/to/image1.jpg'); // add multiple to images field $p->save(); // testing echo 'id: '.$p->id.'<br/>'; echo 'path: '.$p->path; Note: in PW 3 with multi-instance support adding new Objects https://processwire.com/blog/posts/processwire-2.6.21-upgrades-comments-more-on-pw-3.x/#more-updates-on-processwire-3.0 [Edit by Ryan #1] Added first $p->save(); [Edit by Ryan #2] Changed $p->image('...') to $p->image = '...';
    1 point
  12. I've been working on a blog profile that we can have as an installation option for ProcessWire. The goal is to have a profile that someone could download and setup a pretty nice website/blog without having to touch any code (i.e. it's ready-to-run and populate). I'm hoping that this is something that may help us to grow our audience beyond the web development community. The requirement is that it must be as easy (or easier) than WordPress, both to install and use. This profile is also for web developers, as it's a blog profile ready to be styled and enhanced -- a good starting point. It uses the Zurb Foundation CSS framework, so it is fully responsive and mobile-ready. It's not much to look at now, but should be fully functional. I'm making progress and wanted to post a preview. The content you see here is from one of my client's blogs and the content is just here to test things out. http://processwire.com/blogtest/ I'm hoping to get this up on GitHub next week. I've never really done much blogging, so am seeking feedback on what others would suggest to make the blog profile as good, powerful and simple as it can be. Right now it's pretty much a generic Zurb Foundation "look and feel", so it probably needs at least some color tweaks and integration of some masthead photo(s) or something.
    1 point
  13. http://nicenicejpg.com/ A friend of mine built this. I thought it was pretty funny. I have used placekitten.com in the past, but with a '90s rapper things just got a lot more fun.
    1 point
  14. Since I asked, I'd love to be a part of making it. I'll contact you via private message.
    1 point
  15. I'm happy to hear that you guys find this module useful. I haven't had too much (/any) time to work on this module yet (current status: spitting out essays for school at lightning speed..) but hopefully should get to use most of next weekend adding and fixing things here and there At the moment those arent supported, but that's going to be the very next thing I'll be adding (I hope.) Language-alternate fields are no problem since they're actually separate fields, but multi-language fields use slightly different schema and thus require some extra care here. I actually tested what happens if you enable this module for multi-language field and the result was pretty much as expected: only version that gets saved is the original one (column "data" in field_fieldname table) and if you attempt to roll back an old revision all language versions are replaced with that one. Not exactly useful.. luckily I did kind of expect something like this to come up, so this shouldn't be a huge thing to implement Thanks, Pete! I'll definitely take a look at these ASAP. There were couple of PHP diff libraries I originally browsed through and this may have been one of those, can't really remember anymore. Originally I were a bit worried about including an external library like that with a module. Perhaps that's not such a bad thing after all -- and BSD license should definitely make it possible. Anyway, I'll check this library (and that jQuery merge tool you mentioned) properly as soon as I get some free time Probably the most straightforward way to achieve diff-like capabilities would be building on current method (storing full data etc.) and then either running PHP diff at Process module and getting output via AJAX call or (what I originally planned to do, and still would kind of like to try out) use something like this JavaScript diff algorithm by John Resig.
    1 point
  16. Welcome aboard Christian. Just drop Nico a line to get mentioned in the German developers list. Enjoy your ride with processwire. I'm sure you will.
    1 point
  17. For the most part, different templates serve different purposes. For displaying customized site content in the editor, this is a fantastic tool (Bramus). I realized that based on information that we already have available to us in the page create/edit form, we could dynamically load CSS content specific to a particular template. I have not entirely thought how this might best be served, it's more of a proof-of-concept idea at the moment. (Originally in my head I was thinking of "template" as a "theme" which is entirely different, but my curiosity was piqued. I have not discovered yet how themes work with PW, or if they do.) Unfortunately - from the research I've thus far made - it seems as though changing the loaded CSS on-the-fly with regard to TinyMCE requires a complete removal and reload (init) of the RTE. It seems possible (for all TinyMCE compatible browsers), but does cause a Flash-Of-Content. Since the editor would be hidden in a different tab (in the default admin theme) when changing themes, I don't think this would matter all too much. Alternatively, the TEXTAREA could be animated to hide (fade), remove/init, then unhide. Regardless...below is a link to an example where I've made it happen (the code is shoddy, it was just to get it working). It seems to work best in WebKit as you can more easily see the redraw in Firefox. http://gravball.net/test/examples/css_change.html (Note: this link will not remain forever) Dirty work of the code (where the IDs in the switch relate to a BUTTON element being pressed, just for an example): tinyMCE.init({ mode : "textareas", theme : "simple" }); $(document).ready(function(){ $('button').click(function(){ // set the css file path based on button pushed var cssfile = ''; switch($(this).attr('id')) { case 'css1': cssfile = 'css/test1.css'; break; case 'css2': cssfile = 'css/test2.css'; break; case 'clear': cssfile = ''; break; } // http://blog.gbinghan.com/2012/04/reintialize-tinymce-after-jquery-load.html $('textarea').each(function() { try { tinymce.execCommand('mceRemoveControl', true, $(this).attr('id')); } catch(e) { alert('error'); } }).promise().done( function() { tinyMCE.init({ mode : "textareas", theme : "simple", content_css : cssfile }); }); }); }); A script could be modified to listen for an onchange of the template and swap out the Bramus CSS for a template-specific version. Unfortunately I would need to somehow either determine and copy the current Processwire init settings, or call it with a modifier (if that is possible, I haven't gotten quite that far). Realistically this, I would imagine, would be much more handy with front-end themes that come with an accompanying backend Bramus CSS file to match the frontend. Still, at this point it's more of a proof-of-concept. Administrators: Feel free to move this to a new forum/topic, I didn't intend for this to become a conversation of its own.
    1 point
  18. I like doing it all in one go Joss and having "umms" and "errrs" in there - pads it out a bit Love the app Luis and thanks for pointing me to that PDF class. I have been using a different one that I got to work and had even checked out this one before a few years back but when I looked at it recently it mangled my HTML - turns out they all have their quirks and now I've spent today getting my templates nice in this one it means my ~450kb PDF files that take 5 seconds to generate are now ~45kb and generate almost instantly
    1 point
  19. The answer is both Inputfields and Fieldtypes, but they are validating in totally different contexts. Inputfields validate user input. Fieldtypes validate data set to a $page, regardless of where it comes from. Think of Fieldtypes as API-side type validation, and Inputfields as interactive/user-input validation. Here's more detail: Inputfields only come into play when there's interactivity, i.e. a form and a user inputting something. Input should be validated by Inputfields so that the data is valid enough to echo back to the user, or for something else to pull the value from it. Inputfields should always be validated server-side where appropriate, but can also optionally include client-side validation. Inputfields can be used separately from Fieldtypes (they are used throughout ProcessWire in all forms). If there is some kind of input validation that isn't specific to a page or fieldtype, then it should be done by the Inputfield. Meaning, most validation responsibility goes with the Inputfield and an Inputfield shouldn't assume there's going to be any more validation beyond it. Inputfield sanitization/validation is done in $inputfield->processInput() or $inputfield->setAttribute('value', ...). The processInput() method is the first line of defense for values coming directly from a form. Whereas the setAttribute('value', ...) will see values sent from the form as well as values sent from the API to the $inputfield, like an $inputfield->attr('value', 'some value'), call. Where you put your sanitization/validation depends on what you are trying to account for. You may see some Inputfields have a setAttributeValue() function. This is not part of the Inputfield interface. It's just a methodology I sometimes use to isolate setAttribute('value', ...) for more readable code. Inputfields report errors by calling $this->error('error message'); The user will see that error message within the context of the field. Fieldtypes come into play every time a value is populated to a page. This could be from the API, the core, modules, importers, Inputfields… really anything. They need to validate that the value sent to the page is consistent with the type of data the Fieldtype is responsible for (type validation). So if the Fieldtype only stores a string, then it needs to make sure it's a string. If you set something invalid to a $page, the Fieldtype needs to either convert it to be something valid or if it can't, throw it out. For the most part, they should do it as quickly and silently as possible, because they get such a high volume of traffic. Not to mention, Fieldtypes can't assume there's a user present to see anything. Fieldtype sanitization/validation is performed by $fieldtype->sanitizeValue(). Every value set to a $page gets routed through that function, for the appropriate fieldtype. Whatever you do in there needs to be fast. That would be the correct behavior for the Fieldtype, but not for the Inputfield. The scope for Inputfields goes beyond just pages. They don't know what they are being used for. If they did, then their usefulness would be much less. But that's just "in general". There are some cases where you are building a Page-dependent Inputfield and your Inputfield needs to know about the $page being edited. Core examples would Inputfields related to files and repeaters. In that case, make your Fieldtype pass it along to the Inputfield. Each Fieldtype has a getInputfield() method that gets a copy of the $page and $field being edited. It has to return the appropriate Inputfield to edit the provided data. So you can easily send it along to the Inputfield right from there: public function getInputfield($page, $field) { $inputfield = wire('modules')->get('InputfieldSomething'); $inputfield->set('editPage', $page); // inputfield now has a $this->editPage property return $inputfield; } They can report error conditions, but technically they aren't the place for it. Yes. In general, Fieldtypes can't assume there's anyone there to see an error. But if you have some need where you think it is necessary to do from the Fieldtype, try $this->error('message') … it will only be seen in an interactive context. If you want to report an API error, throw an Exception. But if you can keep all of your error reporting in the Inputfield, that is the right place for it.
    1 point
  20. Because i'm a lazy boy well and i'm not such a good actor like Ryan
    1 point
  21. I agree, we need a directory. I will get around to building it eventually. But if anyone else is interested in taking on this project, just let me know.
    1 point
  22. I think that's a question for Joss, but before he'd asked me to put it in the "discussion" tab of the page. But because nobody really gets notified of changes in there, maybe posting in the forum would be better. What do you think Joss? You might have noticed I still need to update the design for modules.processwire.com. There just isn't enough time in the day. Hopefully soon!
    1 point
  23. Is it a shared hosting account, or a dedicated/vps? If it's some kind of dedicated platform where you don't have other accounts under someone else's control, then it's not as much of a concern. But I think this is a question for your hosting provider. What's probably happening is that PHP can't write to /site/assets/. Who is listed as the directory owner? It's most likely you, which would mean that Apache is running under an account other than yours that does not have write access. I would check with your hosting provider to see what permissions they recommend for CMSs that need to have a writable directory. This can very from host to host, so it's tough for us to narrow in on it here short of trying different options (that are more secure than 777) till it works.
    1 point
  24. DaveP: thanks. I got this solved just before your tip. I ended up using pretty much similar solution, used this logging just in the beginning of 404 template: $log = new FileLog($this->config->paths->logs . 'mysterious404.txt'); $log->save("url: " . $_SERVER['REQUEST_URI']); And then I noticed, that few urls that had , in their ?get=something,like,this That alone doesn't do any harm, but in that site I had autoload module, that did some redirects (hooked to pageNotFound). There i had this code: $url = $_SERVER['REQUEST_URI']; $url = $this->sanitizer->selectorValue($url); $p = $this->pages->get($url); if ($p->id)... That ->get($url) was the part that was causing problems. I have now simplified that redirect module so that it doesn't need to make that get query at all anymore. Thanks all for your help (and Ville from our office!).
    1 point
  25. @apeisa Could you not write a bit of logging code that hooks in before pageNotFound, like your redirect module?
    1 point
  26. Do you throw any GET vars into a selector?
    1 point
  27. 1 point
  28. which analytics tracks your site? maybe you look which visit matches the time of your exception mail and dig into the visitor actions funnel.
    1 point
  29. Wouldn't Processwire benefit from having some sort of global file/image management module so that you could choose assets for any page from a single location, rather than being specific to a page? I'm working a site where the client has decided to use the same content image on more than one page. At the moment, it seems the only acceptable option would be to upload the same image more than once. Creating related pages just to be able to add the same image to more than one page seems overkill for this scenario. On another site, the client wants to add images to the WYSIWYG field but first they have to add them to the page using the Images field on the page. It would be good if you could add images to a file module directly from within the WYSIWYG, because that two-step disjointed process is confusing for some people. A lot of other CMS have global file managers/media libraries, so just wondering why that feature is missing from Processwire?
    1 point
  30. "Why did that weird image get posted to my web page???" "That must be your Outlook stationery background."
    1 point
  31. This should work. create a date field besides the counter field. and put change the code to this: if (!$user->isSuperuser()) { if( date('Ymd', strtotime($page->day)) != date('Ymd') ) { $page->counter = 0; $page->day = today(); } else { $page->counter += 1; } $page->of(false); $page->save('counter'); $page->of(true); } echo $page->counter; written in the browser and not tested. But it should give you an idea.
    1 point
  32. In fact, this may streamline it further: <?php echo '<ul class="blocklist">'; // Start the list here as I don't want to loop through things twice foreach($pages->find("template=report") as $location) { foreach($location->mountains->sort('-stats_maxElev') as $peak){ // we prefix the field name with a minus sign to sort descending rather than ascending if ($peak->stats_mtnName){ // pages create 4 blank repeater "value sets" by default, this is a test to grab only populated ones $maxElevft = number_format(round($peak->stats_maxElev * 3.28084)); // to convert a field value in metres to feet; using number_format() to add thousands separators (ie. 3200 -> 3,200) echo '<li><p class="tabular"><a href="'.$peak->url.'">'.$peak->stats_mtnName.' '.number_format($peak->stats_maxElev).'m / '.$maxElevft.' ft.</a></p></li>'; } } } echo '</ul>'; ?> But without a copy of the structure and data I suspect it might fall foul of repeater issues
    1 point
  33. Hehe, it's easily overlooked. If you would like a fancy search then Soma is your man: http://processwire.com/talk/topic/1302-ajaxsearch/ He seems to have created more modules than you can shake a stick at... although if you're into shaking sticks at code you may need to take a break
    1 point
  34. Hey, guys. After much reading, learning, and experimenting with ProcessWire, I finally have something to show: humblebump.com It's not totally finished - there are some features I want to add - but I feel good shipping it as is and adding as I go. ProcessWire is great because I can add things as I learn. It's really flexible. Thanks for checking it out. Let me know what you think or if anything looks/works strangely.
    1 point
  35. You can use the Page link abstractor module to prevent this from happening http://modules.processwire.com/modules/page-link-abstractor/
    1 point
  36. I attached a screenshot to show what I did with processwire - piwik
    1 point
  37. Good morning little app builder ninjas, As promised yesterday I will point you to the important forum posts on how you could build your own app in Processwire. Are we all seated? First we assume that our app is separated into two main parts. The Frontend with custom login and the Backend for App Administration and User Dashboard. Before we beginn follow this link: http://processwire.com/api/cheatsheet/ Say hello to the Processwire API Cheatsheet made by Soma, whenever you meet Soma just give him a hug for this outstanding work. Well the Cheatsheet would be definitely your best and maybe your most intimate friend during developing process. Make yourself familiar with the Cheatsheet and make sure you activated the advanced view. Ok, lets beginn. Right before coding any line in our editor we have to think about our App. What should the App do? Which functionality do we need? Maybe you mockup your first design, but do not start to code! Think about your App, think about structuring your data, fields, templates,folder structure and ,believe me (really important), think about name conventions. A little example from one of my projects. The app handles three use cases, Frontend, Backend Administration and Client Dashboard, maybe a normal setting. I started to think about naming template files and folders. So I came up to the decision to name folders like this: includes-backend --admin --views --scripts --client --views --scripts includes-frontend --views --scripts Template files are named like this: backendHome.php backendMyData.php home.php homeNormalContent.php homeLogin.php Think about naming your page tree, this is maybe the first step in data structure you do. Sure you could start this way, but do you know how large your app possibly could grow before really thought about? So, do yourself a favour and write down your thoughts. I´m working currently on a App which contains round about 300 Files of Script Logic and Output forms, editing without any logic in naming would definitely be a mess. Ok, we thought a lot of our App in theory, what now? We need a custom login! You find some usefull snippets and logic about login from frontend in this posts: http://processwire.com/talk/topic/1716-integrating-a-member-visitor-login-form/#entry15919 http://processwire.com/talk/topic/107-custom-login/ (I really could recommend Renobirds login thoughts and his script) Read carefully through this posts, they contain almost everything you have to consider on frontend user management. You are now on a point of using processwire where you definitely receive input from users, so think about security and make yourself familiar with $sanitizer. Never ever work with user generated data without sanitizing them! There are two main headlines you always have to remember: 1st DO NOT SAVE PASSWORDS IN PLAIN TEXT IN YOUR APP 2nd DO NOT TRUST INPUT YOU RECEIVE FROM USERS Calm down little Ninja. Ryan just gave you a strong and powerful tool. He gave you Excalibur and named it just API. Follow this links: http://processwire.com/talk/topic/352-creating-pages-via-api/ (creating content via api) http://processwire.com/talk/topic/296-programmed-page-creation-import-image-from-url/ (image handling) Thats it.
    1 point
  38. Forced WordPress dev and MODx enthusiast sounds like my bio from a few years back too Welcome to the wonderful world of ProcessWire. You may find as I did that you have to un-learn old stuff as much as learning new stuff and the rule to work by with ProcessWire is "if it seems too difficult then there's probably an easier way" which is what we're all here for on the forums
    1 point
  39. Nice work! I was talking to ryan what seems like ages ago now about version control and I remember stumbling across this easy to use diff class that might help in a future version: https://github.com/chrisboulton/php-diff EDIT: I just noticed that someone has built a useful jQuery merging tool that would also help of you follow the link above and read the readme
    1 point
  40. @OrganizedFellow - Old version of redactor is free and available on github. New version is commercial with yearly fees. License does not look compatible with ProcessWire. There is a longer thread about this somewhere here.
    1 point
  41. Really happy to see this out and in the modules directory! Thanks for your great work with this module!
    1 point
  42. Just been playing around with this, and so far it's brilliant, and works great with frontend page editing as well. Thanks so much for your hard work on it. I'll let you know if I come across any issues!
    1 point
  43. Looks very useful, thanks teppo! Will try out this soon. Does it also work for multi-language fields?
    1 point
  44. can I suggest one? favicon.ico
    1 point
  45. The trick with counters is to remove yourself from skewing the count. I find that when writing blog posts I load the page several times and this would increase the count several times. You could go a step further with diogo's code and do this to exclude your account (superuser) from increasing the count: if (!$user->isSuperuser()) { $page->counter += 1; $page->of(false); $page->save('counter'); $page->of(true); } echo $page->counter; Or you could do the same for multiple roles if you have different editors for your site (my example has some fake ones named "news" and "sports" below): if (!$user->hasRole('news') && !$user->hasRole('sports')) { $page->counter += 1; $page->of(false); $page->save('counter'); $page->of(true); } echo $page->counter; Just a thought
    1 point
  46. O'Reilly is having a pretty good e-book sale on PHP books: http://shop.oreilly.com/category/deals/php-owo.do?code=WKPHP
    1 point
  47. Create a field "counter" with type "integer" and set it as "hidden, not shown in the editor" or "always collapsed, requiring a click to open", as you prefer. Put this code on your template: $page->counter += 1; $page->of(false); $page->save('counter'); $page->of(true); echo $page->counter; voilá
    1 point
  48. Thank you both. I'm having a great time with PW as opposed to other CMSs I've tried in the past. I actually have fun putting things together and getting things to work!
    1 point
×
×
  • Create New...