Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 10/04/2014 in all areas

  1. Please note: This post refers to a commercial package for PHP that includes a module for ProcessWire. If you have to deal with name data on a day-to-day basis then you know what a mess people can make of typing names. If your business prides itself on good formatting – for stationary, labels, email or nametags – then the English Name Sanitiser package for PHP & Processwire can help you keep things well formatted. Background About five years ago I got involved with selling books online via various storefronts such as Amazon, Play, Abebooks and Alibris. Day after day we'd get orders from customers and, quite frankly, the formatting of the Ship-to name field was a mess. A big mess. Some people typed "jenny smith", others "JANE DOE", some "jASON yARDLEY" and still others would write "No invoice" after their name. A few actually formatted their names right. As a business that prided itself on neat formatting of our postage labels - and because dealing with customers and the local post-office about missing parcels is a pain - I decided to start sanitising incoming names to not only make them look good to the customer when they received them but also to make the names and addresses as clearly and unambiguously readable as possible for postal workers. I initially thought that it would be an easy problem to fix - just run each name through mb_convert_case() but it turned out to be a more difficult than anticipated as PHP's methods of converting case handles several situations in a pretty unsatisfactory manner; names like McGregor or O'Donnel, company names and names with missing spaces following punctuation ("john h.jones" etc.) Here's a quick comparison of how PHP and the NameSanitiser do with some problem names... (The whole list is available under the "Tell Me More" button on QBox.co) Over four years later I've decided to release the English Name Sanitiser as a commercial offering that makes it easy to format English names (it includes a PW Textformatter.) The package itself includes a stand-alone sanitisation file that you can use in other PHP projects so it is in no way limited to just PW installations. Licenses are available for individual sites, developers or agencies/institutions and, as I still sell books via Amazon and use this package in my sales system, it is being actively maintained. Visit QBox.co now to learn more.
    11 points
  2. Description This module adds icons based on the file type uploaded. It also lets you change the columns, etc. You can watch the video for more details or download and install. To make it work (do not know why) you have to change any configuration setting and save. Version Alpha version (0.0.1). Updated: 0.0.2 - Added Json name shorter, icons and columns. Updated 0.0.3 - Config in columns Updated 0.0.4 - Video and Audio extensions added. Updated 0.0.5 - Fixed select files and drag to upload div position. Updated 0.0.6 - Execution of the module only in the administration. What a fail! Github
    9 points
  3. Steve, great idea. I am wondering why not release this also as non pw class? I think the current market for this is very small if thinking only ProcessWire.
    5 points
  4. http://www.radiologische-allianz.de Step1. Homepage uses a classic design. Purpose was to make complex information look easy for patients. If you use the homepage with a mobile, you get a special view with only the things you need when you are on the road. (The most time-consuming action was organizing all this data and find an easy to maintain ways to link this all together.) We have 11 centers. This homepage is a portal page for all of them and includes individual homepages of each center at the same time: If you access things for only one center through their homepage, you get a filtered view with only items offered there. There is also an individually built center-finder which uses Google maps to find the right center for your therapy, using Processwire technology. Processwire was chosen mainly because of the enormous flexibility to build links between all different sorts of information (without it being rocket science), especially because we were able to handle even non-hierachical data (e.g. a child is allowed to have 2 parents - doctors think that's normal ), and because we could offer the client a very clean and easy to use backend, hiding all the complexity of the homepage away from him: They started using it with only 2 hours of training. Not sure you could do this with Wordpress... (This is the first homepage we did with UIkit, which was a recommendation from this forum.) (Step2 will add some speed optimizations...)
    4 points
  5. Email Verification This module provides functions to validate email adresses and hosts. The module generates a textfile for blacklisted mailhosts (trashmail), which will be always up to date. Download https://modules.processwire.com/modules/email-verification/ API // get module $mailcheck = $modules->get('EmailVerification'); // return bool/ string - automatted update of blacklist file $mailcheck->blacklisted(email|domain) // return bool - validate a top level domain, checks against IANA list $mailcheck->validTLD(tld) // return array of punycoded TLDs - cyclic updated, data pulled from IANA $mailcheck->getTLDs(cycle=2592000) // return bool - checks syntax converts to punycode $mailcheck->validDomainName(domain); // return bool - checks punycode encoded syntax $mailcheck->validHostName(host); // return bool - checks syntax and accessibility $mailcheck->validHost(email|domain) // add a single value to blacklist $mailcheck->addToBlacklist(email|domain) USAGE $mailcheck = $modules->get('EmailCheck'); $email = 'susi@trashmail.com'; if($mailcheck->blacklisted($email)) echo 'Email Provider not allowed'; if(!$mailcheck->validHost($email)) echo 'Mailhost not available'; Example blacklist file: blacklist.txt
    3 points
  6. Or more to the point, how long to you mess with typography for a website? Today I have been starting work on my own general portfolio site - the last one crashed and burned several years ago and has been substituted with a meagre holding page for far too long. I decided to go a very minimalistic route, technically speaking. First, I started with the smallest grid I could find: Simple Grid. Then I wrote some extra media queries to cover hiding for phone only or showing phone only, or whatever. Not a very complete version, but just enough to cover my initial needs. Next up, I played with a bit of JQuery in conjunction with Horst's rather delicious Pageimage Manipulator (though it confused the hell out of me for a bit!) The idea has been to check the window width with jquery and depending on the size, use different versions of a background image that only covers the right hand half of the window for iPad and above, not just resized, but cropped in specific ways. Oh, and then a tiny bit of JQuey to pop up a minimalistic menu. So, all well and good. Then I went off to the font shop to choose my font. After umming and moaning and chewing my own beard for a couple of hours I settled on the rather predictable Lato - it is rather nice though. Now, remember that I am starting with a clean sheet here - the only typography styles are browser defaults. So, before I start on anything clever, I need to get my base font nailed down. Easy? Well, it would be if I was not being so bloody minimalistic and arty-farty! I wrote a carefully crafted introduction with a h1 and h3 title and sub title, and started playing. Here is a tip - DON'T USE LOREM IPSUM! If you are a writer, you will want your typography to match the sense of what you are writing. Blocks of Lorem Ipsum tend to be very dense and if you are not going to be laying out your story in that fashion (and in Latin), then it is misleading as hell. It is far better to put a little time aside and write something genuine that you are likely to use in the finished site. So, I wrote my intro: And I stared at it. Well, I am quite pleased with the words, and they even fitted an iPhone rather nicely, but I wasn't enthused about the size, spacing or anything else. So I started playing ... and tweeking .... and refreshing .... and tweeking a little more. And I kept going till? Well, I started about 3 hours ago and I am still going. I think I am pretty close now. My typography.css sheet is looking like this at the moment: html { font-size: 62.5%; /* 10px browser default */ } body { font-size: 1.6em; /* equiv 14px */ line-height: 1.5; /* adapt to your design */ font-family: 'Lato', sans-serif; font-weight: 400; background: #f5f5f5; color: #444; } h1 { margin: 1.0rem 0; font-size: 3.6rem; font-weight: 300; letter-spacing: -0.06rem; } h3 { margin: 1.0rem 0; font-size: 2.4rem; font-weight: 300; letter-spacing: -0.06rem; } p { margin: 0 0 2.0rem; padding: 0; } And that is working quite nicely. Oh, it is a bit more detailed than that ... but not a lot! What I am trying to do is come up with a schema that suits all of my output. In reality that is impossible as there are some rather large differences in style and subject to address, but if I can come up with an introduction that works beautifully, from then on I should be playing with shades of variation rather than complete palette changes. Which reminds me ... I haven't even begun to think of colours much yet! Better put another week aside. Joss
    3 points
  7. Hey, I think it would be a good addition if languages would be installable via "Modules" because they're in the modules directory anyway and you can even download then over the "New" tab. But afterwards they won't appear in the languages section. Maybe the whole backend translation stuff should be modularized anyway. But not sure if that's possible.
    3 points
  8. I am not totally sure why you have the child Home page. If it's just to get it to appear in the front-end menu, then there are much better ways. $homepage = $pages->get("/"); $children = $homepage->children; $children->prepend($homepage); foreach($children as $child) { $class = $child === $page->rootParent ? " class='active'" : ''; echo "<li><a$class href='{$child->url}'>{$child->title}</a></li>"; }
    3 points
  9. i spend a lot of time playing with fonts. for me it is one of the most important aspects of webdesign (if not the most important). i spend hours just to find good header & body font combination. readability is everything, and i think that too many web designers are forgetting about it (or they don't get it?) and instead they focus on how nice it looks ... i have some rules that i try to follow everytime one paragraph lines should not be longer than 80 characters font-size 18px or more (sometimes more than 20px) for screens larger than mobile. for mobiles i just set it to 100%. black text (at least #444) on white background, never white on black. bold headlines around 1.5 line height single column text one good free source of fonts is http://brick.im/ it renders font differently that google fonts. they look better then google fonts especially on headlines. however, there is not such a difference in chrome as it use to be since last chrome update a few weeks ago changed font rendering. however, the difference in mozilla is still noticeable.
    3 points
  10. The problem happened to be related to old session files that I transferred when moving to the new server. Once I deleted all session files in assets/sessions on the new server, PW picks up the $config->httpHosts array and the error message in the backend disappears.
    3 points
  11. My point of view is that Typography is very important in the Web Development process. I'm no expert though, as I'm still learning as I go. I believe that good typography puts a finishing touch on a website. I use MyFonts, FontSpring and Adobe Typekit. FontSpring is my favorite, as they have what I believe are great rules on the use of fonts. I also do a lot of graphics work for my clients (forms, images, menus, flyers and documents) and I have gotten away from the default fonts and started to use different fonts on all my workstations. I plan in the next year or two, to invest more of my time in learning and appreciating the world of Typography. There's a lot to learn.
    2 points
  12. I don't think you can change that setting in your template because it is already loaded. I think the best approach is to add the following to the top of the template file that is being appended. if($config->ajax) return; or instead you could use: if($useAppended) return; and then in your template files you could do: if($config->ajax) $useAppended = true; Lots of options really
    2 points
  13. Check out the image version, also from blad: https://processwire.com/talk/topic/7379-module-alternativegridimages/
    2 points
  14. That's a good idea, however, I don't want automatic price conversion. Price politics is more about psychology than mathematics
    2 points
  15. The problem happened to be related to old session files that I transferred when moving to the new server. Once I deleted all session files in assets/sessions on the new server, PW picks up the $config->httpHosts array. The error message in the backend disappears and I can create users and save their passwords without problems.
    2 points
  16. I used ispconfig as a control panel. This runs nightly backups of the database and content. It the tar balls these. I then use scp to copy them from one server to another and then untar them.
    2 points
  17. Just fixed some issue with new PW 2.5 while still compatible with 2.4. The module is now on v1.0.3 and updated on modules.processwire.com https://github.com/somatonic/TemplateNotes/commit/7a16e25126d1f2b2ef2b4792edc00f70b9c2db1b
    2 points
  18. I have just got round to uploading some bits to Behance - never done it before. And I have 6 "Appreciations!" I have decided I like behance https://www.behance.net/joss9911
    2 points
  19. try rsync http://rsync.samba.org/ EDIT: their website could use a freshen up...
    2 points
  20. In some previous posts, I demonstrated a simple proof-of-concept CRUD “application” for PW using jTable. I really wanted to use DataTables since it is older, wiser and with a huge fan base. One thing I wanted was for the CRUD system to be as simple as possible and possibly be Excel-like (more below). With DataTables plugins, you can perform stuff like inline-editing and Auto-fill. The latter works just like in Excel and allows you to quickly populate cells (quick copy). But that’s as far as it goes. Google led me to other Table management systems. Some of the front runners include jqGrid and SlickGrid. SlickGrid is nice and using virtual rendering can display millions of rows with ease. Its support for displaying data delivered on demand (Ajax/server) is minimal; it requires you to download all your data before it starts manipulating it. Someone has created an Excel-like extension for it allowing copy-pasting between SlickGrid and Excel. Awesome! But, it still didn't rock my boat completely, especially the Ajax content issue. Then I stumbled upon Handsontable, a new kid on the block that describes itself as “a minimalistic Excel-like data grid editor for HTML, JavaScript & jQuery”. Though relatively new, it is as Excel-like as you can get. You can copy-paste from/to Excel [single to multiple cells and multiple to multiple cells], use the usual shortcuts (Ctrl-A, Ctrl-X, Ctrl-C, Ctrl-V, Ctrl-Y, Ctrl-Z - i.e., undo/redo, etc., and tab navigation, etc.), use Auto-fill (vertically and horizontally), freeze cells/columns, make cells/columns read only, Right-click context menus, insert/delete rows and columns, perform inline-editing, etc. Double awesome! Handsontable (HoT) is minimalistic but comes with a rich API. However, most of the implementation is down to you (sounds familiar?). It will render the Table and provide you with Methods/Events/Options to manipulate it. You just have to provide the data as an Array or JSON defining your columns and containing your data. Soma has a DataTable module that is currently read only; you cannot edit the displayed data directly in the table. It is also in lazy development . So, I started toying with the idea of using HoT as an Excel-like CRUD system (module) for PW. I wanted something that could quickly and easily do mass editing (Batcher-like). Imagine quickly creating basic pages/records by copy-pasting from Excel. Or quickly changing records by dragging (Auto-fill) or pasting new values over old ones. Well, the result can be seen in the screencast below. I’d like to hear your thoughts whether this is something that I should consider developing into a module; something that could be used by Superusers. Depending on implementation, it could be used by other users as well. All HoT needs is data. What you do with that data is up to you (the developer) and your code! This can be very dangerous if not implemented correctly, of course! You could easily delete important records! However, HoT does not touch your database! Deletions, insertions, etc., will not alter your database unless you specifically write the PHP code to do that. All it does is send data to the server via a method your specify (post, get, Ajax, etc.), and even that is your implementation. You do not need to implement deletions or additions. You can use it for updating content only or as read only, but where’s the fun in that ? In the screencast , apart from the table itself, all the other implementations are custom - the buttons, selects, auto-save (can be tricky? can DDOS your server?). The current implementation is not perfect; it is a demo after all. Certain stuff would need to be implemented differently . I didn't want to spend too much time on something that would not be useful in the end. All CRUD operations are via PW API and/or vanilla PHP. Deleted pages are Trashed and not permanently deleted. If there is interest for a module of this kind, I would request all the help I can get to develop it please. I would put it up on Github of course. In the demo, this is running off Diogo’s ACP module. Let me hear your thoughts please. Should a module like this see the light of day? Thanks Wasn't sure in which forum to post this...
    1 point
  21. Template Notes Adds a "Help" tab to pages for notes and instructions on the current template used. You can add content by simply putting a html or markdown file in /site/templates/notes/ the module will automatically load that file if it finds one and adds a "Help" tab to the page edit form. Name the files using the template name. You can use html or markdown to write the help text. - /site/templates/notes/[tplname].html - /site/templates/notes/[tplname].md To style the content you can specify a custom css file url you add to the module settings. http://modules.processwire.com/modules/template-notes/ https://github.com/somatonic/TemplateNotes This module was quickly written after seeing a wish-list request by Joss http://processwire.com/talk/topic/5016-help-tab-for-template/
    1 point
  22. AlternativeGridImages module for Processwire Details Add a slider directly proportional to the size of the images introduced in the input field image. Installation copy AlternativeGridImages folder to /site/modules/ Screenshot https://github.com/LuisSantiago/AlternativeGridImages Updated 1.0.6: - Renamed altGrid as AlternativeGridImages. (Thanks @adrian) - Changed styles. - The slider value is saved in a cookie. (Thanks @Martijn Geerts) Updated 1.0.7: - Limit the number of characters in the file name (all items have the same height) (Thanks @enricob)
    1 point
  23. It'd be cool if one could click together all the fields an templates, export them into files (with the built in export functionality) and later use them on the API level (load the files) to say preconfigure a Module. Is it possible? I have not found anything on that topic. thanks
    1 point
  24. Okay, I am probably going to get this wrong, but let me think this through. You want a list of attributes, but without prices - you add the price later in the T-Shirt page? So, for instance, you could have a repeater (possibly better with a page table) that has two fields: Page Field, picking up a list of attributes and a text field for the price. You add a line, choose the attribute type from the page field drop down (must be single select, of course) and you put in your price. You can then loop through the repeater to list out all the attributes and associated prices for that product.. When it comes to a category, if you are creating the product page under its parent, then it already has a category - its parent! Oh, I should add, that the attributes can have more than just a title - they can have images, extra info, anything you like as they are pages in their own right - but you only use the title field when selecting them.
    1 point
  25. Are you basically creating a main page and the variants are children of that page? So, they all have the same prices, for instance, but other variations are possible with the children? If so, you could do something like this: Parent - T-Shirts Field: Default price (USD) Child page - T-shirt crazy style Field: override price (USD) - normally left blank. In your template for the child, you can call the price from the parent page (see the API for parents), checking whether the override price as been set. If it hasn't you display from the parent, if it has been set, you display from the child. You can do this will any field - set defaults in the parent, but allow for overrides for the children.
    1 point
  26. That's why you have the 4 options ...to suit the structure you want....Use option 2 if you want posts as children of Blog. That will give you /home/blog/mypost/
    1 point
  27. To be honest, I have read this a couple of times (as well as Diogo's explanation) but I still don't get what you are trying to achieve . I am not even sure whether we are talking backend or frontend. Maybe a diagram? Then again, I am just slow that way . Or if possible, set up a free 7-day dummy/test ProcessWire website on lightning.pw that we can have visualise....Just a thought...
    1 point
  28. No, the product itself (T-Shirt) is assigned to a category (T-Shirts), and all the pricing information is stored within the category page.
    1 point
  29. Cool! I just wanted the alike functionality for image field. In the grid view I have not found a way to trash an image. This grid should do it. Does it work with file field only or can it work with images (preferably displaying thumbnails as icons)?
    1 point
  30. Looks great, thanks for building this blad.
    1 point
  31. lightning.pw is really cloud hosting. Even if it's not 100% stable at the moment. But hey are going to integrate those snapshot/backup integration, etc.
    1 point
  32. Just for your information - I also got an: Unable to open ZIP file, error code: 19 (downloaded filesize was 133 kb time and time again.) Then I changed my php on the server from php 5.4.33 to 5.5 and the upgrade went flawlessly from PW 2.5.0 to 2.5.3 Maybe this info can be useful to someone ... Kind regards, Bernard
    1 point
  33. i know the c5 structure (and i can remember you from the forum there - it's nice to see you here) and worked with a similar CMS that use modules as sections/blocks on a page.....and i know all the benefits! Done some testsites, one rebuilding from the used CMS to PW and on the run one new PW site from the scratch.....and i don't miss this blockbased sheme anymore. From the start i missed the easy things that possible with blocks/sections -> add a form there -> add a galerie here -> drag and drop the blocks.....but now i know with PW it is much more to think about the project first and then create it like it should be, than building fast on the fly in the CMS system. I made for me an overview of the content-blocks- that i need to be used in a flexible way on some/every/single pages and thought about the options in PW......didn't found a usecase where i don't get a solution. Only drawback is that a enduser couldn't expand the website like he wants (For e.g. put a new little form here, add a new gallerysection here, add a poll on this page). But this stuff should be worked out previous the client needs such things....since he and you don't give the client the power to mess up his site. I liked the way to work with contentblocks with different types - but i like the other way to create all that is needed and expand it if it's claimed, too! just some thoughts on the block thingi kind regards mr-fan (did like the idea/way of Concrete5, too but it's a resourcehungry, slow on sharedhosts, hard to translate beast )
    1 point
  34. K after going in and increasing all of my memory limits in my php ini I am back in business. Looks like having my core memory limit at the default 128M was too low, so I went and bumped it to 256. I have a deecent server, should I go and bump this even higher, like 512+?
    1 point
  35. Great work Steve - this is one of my pet peeves too - I can never understand people's laziness when it comes to typing their name correctly. I have a couple of different stores that would definitely benefit from this!
    1 point
  36. Sorry, wrote that on the browser. Already corrected.
    1 point
  37. @adrian. Yes, there are thumbnail images, so it's normal . I really need to go to sleep earlier, sleep more/better and have a healthier life . @kongondo. I didn't use code tags this time because it created a horizontal scrollbar, so it seemed less readable at the moment I put it. But it's ok .
    1 point
  38. It's missing a semi-colon at the end of the if($pic .... line.
    1 point
  39. @Sinmok Take a look at what Gayan posted above, it shows you how to do it. I've also updated my previous example to make it more obvious.
    1 point
  40. Thanks Sinmok and netcarver. It would be really useful when we are using a front-end framework like Bootstrap. <?php $list = $pages->find("template=basic-page"); // Returns 5 pages $chunked = array_chunk($list->getArray(), 3); ?> <?php foreach($chunked as $i => $row): ?> <div class='row'> <?php foreach($row as $item) : ?> <div class="col-md-4"> <?php echo $item->title; ?> </div> <?php endforeach; ?> </div> <?php endforeach; ?>
    1 point
  41. Thanks MuchDev. In terms of the images, I am using a image loader for the galleries if you scroll down (try turning javascript off and your get the first 2 images), but I'm not using one ofr the page load itself so maybe something I can improve if the client agrees.
    1 point
  42. @adrian How's further development going on ProcessMigrator? I was playing around with it yesterday and it seems it's still quite buggy. I tested it about 20 times on fresh installs and got a few errors which I can discuss with you. I would like to feature it in a WordPress vs. ProcessWire screencast. Your plugin solves a huge pain point. Let me know if I can help.
    1 point
  43. Thanks for the report junofornow. I don't actually think that your change is what fixed it (unless we hear of it occurring to anyone else) because those two calls are equivalent. What's more likely is that there's an opcode cache involved here (like APC or eAccelerator, etc), and your change triggered the opcode cache to clear. I would be curious if you went back and changed it to the $wire->wire() version if the error re-surfaced? I would guess it doesn't, but would be interesting to test.
    1 point
  44. The 100 versions are for the admin - if you have "display thumbnails in page editor" checked on the Images field Input tab.
    1 point
  45. Ehm... http://processthemes.com (WIP)
    1 point
  46. Thanks for that tip Ryan - that might come in handy for sure. At the moment I end up having to delete the field and re-create it, which of course means deleting it from any templates that use it (otherwise I get: This field may not be deleted because it is in use by one or more templates.), re-create the field with the new type, and add it back to the template again. I completely understand the data loss issues and in reality I really shouldn't have to change between numeric and text field types very often during the design phase (if I have my act together from the start), so I guess it's no big deal.
    1 point
  47. That's a good idea. Though I'd still be nervous about it. Something to think about adding though... One way you can override things on your own is to edit the Fieldtype module file that you want to convert from. So if you've got a float that you want to convert to a string, edit /wire/modules/Fieldtype/FieldtypeFloat.module and add the following function to it (temporarily): /** * Return Fieldtypes that are compatible with this one (i.e. ones the user may change the type to) * * @param Field $field Just in case it's needed * @return Fieldtypes|null * */ public function ___getCompatibleFieldtypes(Field $field) { $fieldtypes = new Fieldtypes(); $fieldtypes->add($this->fieldtypes->get('FieldtypeText')); return $fieldtypes; } If the Fieldtype you are editing already has that function, that you could just modify it according to what you need.
    1 point
  48. In order to get use phpstorms codesense you must tell phpstorm what variables are there. Just add a PHPDoc comment like this to your php template files and it should work. Even without using my fork you get some codesense support, but a lot of properties are missing. /** * @var Pages $pages * @var Page $page * @var Templates $templates * @var Fields $fields * @var Users $users * @var User $user * @var Roles $roles * @var Permissions $permissions * @var WireInput $input * @var Sanitizer $sanitizer * @var Session $session * @var Config $config */
    1 point
×
×
  • Create New...