Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 09/10/2013 in all areas

  1. The Organization of American Historians just converted its website to Processwire: http://www.oah.org/ Founded in 1907 and with its headquarters located in Bloomington, Indiana, the OAH is the largest professional society dedicated to the teaching and study of American history. — Michael Regoli, OAH
    6 points
  2. Thank you all for your replies... Unfortunately i don't have direct access to the server... But i found another solution... i am buying a unix hosting with a decent provider... Why? Because honestly pw is the best cms i ever worked with till now, i am a cms expert ... I am not dropping pw for stupid iis ... Long live Process wire
    5 points
  3. @RJay: yes that's right, - but also it is right that if you want to keep proportions and want that they fit into max dimensions for width *and* height you can call: size( $myMaxWidth, $myMaxHeight, array('cropping'=>false) ); For example: http://nogajski.de/priv/postings/rearrangedImageSizer.html#sizeNoCrop & http://nogajski.de/priv/postings/rearrangedImageSizer.html#sizeCrop
    3 points
  4. Add $useMain = false; to your template and the html won't output.
    3 points
  5. I was really intrigued by that (and getting mad at lawyers!), so I Googled for more info. Apparently, it's not quite removed. There was widespread misunderstanding of what was going on. See here: http://iteration99.com/2013/php-json-removed-from-php-5-5/ So, developers, rejoice! Workarounds won't be necessary when upgrading to 5.5 so long as you have the JSON-C extension installed.
    3 points
  6. I wanted to make a note for anyone else that is concerned about performance and is thinking about serializing data and saving it to a textarea field: After some research and a little testing, it seems that json_encode() is faster than serialize(). Other than being faster (at times, nearly 100% faster), it is also more easily readable without decoding and it's more portable. This is best for simple arrays. If you're storing objects that need to be unserialized to the correct class, you'll want to use serialize().
    3 points
  7. Hi folks This isn't a new concept, but since I use this on several sites and was getting frustrated by having to add the fields and put the CSS in the admin template's CSS file to have it overwritten on updates I thought I'd make it into a module where it should work regardless of which admin template you use and shouldn't be affected by updates since the CSS to hide the fieldset's container styles is now in a separate CSS file completely. Unfortunately I can't find the original topic where this concept was introduced (if anyone can find it, please link to it as I can't take credit for the idea), but essentially what the module does is create a left and right columns that are actually fieldsets, and you simply add the fieldsets to your template and place fields in each of the columns to suit yourself. Enough chit-chat, the screenshot below will explain it better: I think when this was originally discussed it was back before ryan had introduced field widths, but I think this still has a place for where you have differing heights of field (as per the ASMSelect field on the right of the shot) where using field widths would result in a space before the next row of fields. In fact, this works especially well on pages where you have small bits of information to enter and want to leave a larger left column for text editor, image and file fields. The beauty of now having variable width columns per-template now as well is that you can change the fieldsets from their set widths of 70% and 30% respectively to whatever suits your needs on a particular template. Download from the modules directory. Usage Download and install the module above Add admin_column_left and admin_column_right fieldsets to your template and put the fields in the relevant column fieldsets (Optional) change the field width for either column, taking care to leave 1% for a gap between the two columns (default is left column at 70%, right column at 29%) That's it!
    2 points
  8. It's not like that PW need to step through a forest to look for tree with a number on it. It has google earth showing it with a bubble "here I am".
    2 points
  9. Both the same and since you specify a id explicit, it will just get that page and the template wouldn't be required. But actually there's a difference in it: $pages->get($pageID); Will get the page even if unpublished, in trash, hidden or user would have no access! It isn't doing a real "find" and it's much like getting a row from DB no matter what. It's like a shortcut PW is doing in this case not doing a usual page finder search. $pages->get("template=book,id=$pageID"); This will convert the previous into a "page finder search" much like when using a find("template=book, title=Mytitle"), thus behave different. It will not return a page if unpublished or hidden or in trash or the user has no access. EDIT: In fact in the last one, it will even get the page even if the template isn't correct! So the id=id is the key here. Any selector will get ignored. So doesn't really make sense to add selector if you got the ID. Page ID is one of the things that's unique an always the same untill you delete it.
    2 points
  10. danysrour, Welcome to PW forums! In addition to above responses, the following threads may be of help. ProcessWire on Windows7/2008 Server with IIS WebServer http://processwire.com/talk/topic/268-processwire-on-windows72008-server-with-iis-webserver/ ISAPI_REWRITE 3 on IIS http://processwire.com/talk/topic/766-isapi-rewrite-3-on-iis/ Mircosoft IIS and Processwire http://processwire.com/talk/topic/3558-mircosoft-iis-and-processwire/ ProcessWire on LiteSpeed Web Server? (See Ryan's post) http://processwire.com/talk/topic/1212-processwire-on-litespeed-web-server/ Can't reach admin page http://processwire.com/talk/topic/1962-cant-reach-admin-page/
    2 points
  11. off topic, but worth mentioning: ProCache supports the head developer. Template caching does not.
    2 points
  12. Reviving this old thread. Luckily, since I'm only getting into PHP now, by going straight to OOP, I've not really had to unlearn some procedural PHP in order to grasp OOP. I found the following helpful: http://net.tutsplus.com/tutorials/php/object-oriented-php-for-beginners/ http://www.tutorialspoint.com/php/php_object_oriented.htm http://phpro.org/tutorials/Object-Oriented-Programming-with-PHP.html http://www.codewalkers.com/c/a/Programming-Basics/ObjectOriented-PHP-Fields-Properties-and-Methods/ http://www.massassi.com/php/articles/classes/ http://net.tutsplus.com/tutorials/php/from-procedural-to-object-oriented-php/ http://net.tutsplus.com/tutorials/php/real-world-oop-with-php-and-mysql/ PHP Academy tuts - videos
    2 points
  13. Hani, ProcessWire will scale pretty infinitely in terms of pages, but not in terms of fields or templates. The same can be said of databases in general–you can have millions of rows in a table, but probably don't want millions of tables. I would say you've gone beyond what may be practical for long term use and maintenance of the site. At least, I have never tested ProcessWire with any more than 200 fields (and I thought that was an insane amount). I would be curious why so many fields are necessary? It might be good for us to get a list of all the fields, which may lead to some good suggestions on alternatives. But this is a situation where I think you might really benefit from making your own Fieldtype and Inputfield combinations. It is surprisingly simple to do, and can represent any DB table, no matter how many columns it needs. There is far less overhead in having a custom Fieldtype that represents a table with 100 columns, than there is in having 100 separate fields. Have a look at Adrian's new FieldtypePhone/InputfieldPhone module for a good example of how to represent a DB table with a Fieldtype. Some other options I can think of relate to ProFields, a pack of modules I've been working on to release soon (probably as commercially supported like FormBuilder and ProCache). It includes FieldtypeMultipler, FieldtypeTable, FieldtypeTextArray and FieldtypeTextareas, among others. These enable you to have a single field that can to represent any quantity of inputs. Though they all do it in a little bit different ways. FieldtypeMultiplier lets you take any other Fieldtype (that isn't already multi-value) and turn it into a multi-value field. FieldtypeTable is a multi-value compound type that lets you keep a user-defined combination of fields contained in a group… not quite as powerful as a repeater, but it's only 1 field and has far less overhead. FieldtypeTextArray lets you have a defined quantity of inputs for any text field… like say you needed a field to represent 3 email addresses, for instance. Lastly, FieldtypeTextareas lets you have 1 field that can represent any number of named textareas while having them all be searchable from the same field. For example, you could have a single field called "content" that contains separate inputs for body, sidebar, summary and about_the_author or something like that, but they only consume 1 field, accessed via $page->content->body, $page->content->sidebar, etc. All of these Fieldtypes/Inputfields are aimed at really reducing the overall quantity of fields necessary to represent lots of data. I developed this set because I had a site with lots of similar fields, and this group of modules helped me to reduce the quantity of fields by more than 70%. However, these aren't ready for production use, so it may be a little while before I have them ready. But if you'd be interested in helping to beta test them, your use case might be about perfect.
    2 points
  14. Menu Builder As of 29 December 2017 ProcessWire versions earlier than 3.x are not supported Modules Directory Project Page Read Me (How to install, use, etc..) For highly customisable menus, please see this post. If you want a navigation that mirrors your ProcessWire page tree, the system allows you to easily create recursive menus using either vanilla PHP or Soma's great MarkupSimpleNavigation. In some cases, however, you may wish to create menus that: 1. Do not mirror you site's page tree (hirarchies and ancestry); and 2. You can add custom links (external to your site) to. That is primarily where Menu Builder comes in. It is also helpful if you: 3. Prefer creating menus via drag and drop 4. Have a need for menus (or other listings) that will be changing regularly or that you want to allow your admin users to edit. The issue of custom menus is not new here in the forums. The difference is that this module allows you to easily create such menus via drag and drop in the Admin. Actually, you can even use it to just create some list if you wanted to. In the backend, the module uses the jQueryUI plugin nestedSortable by Manuele J Sarfatti for the drag and drop and is inspired in part by the WP Custom Menu feature. Please read the Read Me completely before using this module. For Complex or highly-customised menus, it is recommended to use the getMenuItems() method as detailed in this post. Features Ability to create menus that do not mirror your ProcessWire Page Tree hierarchy/structure Menus can contain both ProcessWire pages and custom links Create menu hierarchies and nesting via drag and drop Easily add CSS IDs and Classes to each menu item on creating the menu items (both custom and from ProcessWire pages) or post creation. Optionally set custom links to open in a new tab Change menu item titles built from ProcessWire pages (without affecting the original page). E.g. if you have a page titled 'About Us' but you want the menu item title to be 'About' Readily view the structure and settings for each menu item Menus stored as pages (note: just the menu, not the items!) Menu items stored as JSON in a field in the menu pages (empty values not stored) Add menu items from ProcessWire pages using page fields (option to choose between PageAutocomplete and AsmSelect [default]) or a Selector (e.g. template=basic-page, limit=20, sort=title). For page fields, you can specify a selector to return only those specified pages for selection in the page field (i.e. asm and autocomplete) For superusers, optionally allow markup in your menu titles, e.g. <span>About</span> Menu settings for nestedSortable - e.g. maxLevels (limit nesting levels) Advanced features (e.g. add pages via selector, menu settings) currently permissible to superadmins only (may change to be permission-based) Delete single or all menu items without deleting the menu itself Lock down menus for editing Highly configurable MarkupMenuBuilder - e.g. can pass menu id, title, name or array to render(); Passing an array means you can conditionally manipulate it before rendering, e.g. make certain menu branches visible only to certain users [the code is up to you!] Optionally grab menu items only (as a Menu object WireArray or a normal array) and use your own code to create custom highly complex menus to meet any need. More... In the backend, ProcessMenuBuilder does the menu creation. For the frontend, menus are displayed using MarkupMenuBuilder. Credits In this module's infancy (way back!), I wanted to know more about ProcessWire modules as well as improve my PHP skills. As they say, what better way to learn than to actually create something? So, I developed this module (instead of writing PW tutorials as promised, tsk, tsk, naughty, naughty!) in my own summer of code . Props to Wanze, Soma, Pete, Antti and Ryan whose modules I studied (read copied ) to help in my module development and to Teppo for his wonderful write-up on the "Anatomy of fields in ProcessWire" that vastly improved my knowledge and understanding of how PW works. Diogo and marcus for idea about using pages (rather than a custom db table), onjegolders for his helpful UI comments, Martijn Geerts, OrganizedFellow, dazzyweb and Mike Anthony for 'pushing me' to complete this module and netcarver for help with the code. Screens
    1 point
  15. GitHub: https://github.com/adrianbj/ProcessMigrator This module has gone through lots of iterations with lots of new functionality each time. It is now a fully fledged content migration tool. *** Please be sure to read the GitHub ReadMe to find out what it can do now as most of the posts in this thread are no longer correct regarding its functionality Once it is release worthy, I'll create a fresh thread with all the details. This modules allows export, sharing, and import of page lists via JSON files. It takes care of replicating all the pages, as well as creating any templates and fields that are needed. I have defined "Page Lists" as page trees (parent and children) that store selector values for a Page fieldtype. An example would be a list of countries that would be used to populate a countries drop-down select field. The fields might include: Country Name, 2-digit code, 3-digit code, number code. I would like to suggest a place where we can post json files to be shared and updated - maybe a dedicated github repository? Start of a repo of lists ready to import is now available: https://github.com/adrianbj/ProcessWirePageLists It might handle migrating other simple pages trees as well, but it should not be considered a tool for migrating general pages as it does not handle associated files, nor does it handle fields which store arrays. Probably lots of other things it doesn't handle either It now handles migrating all (I think) field types, including repeater fields, page fields, all Profields fields, multi-language versions of fields etc. The only omission is the actual uploaded files and images in file/image fields. WARNING: This should be considered an Alpha module - please don't use this on a live site at the moment and be sure to back everything up before testing. Would appreciate any feedback on the concept, the code, and the idea of a shared and community edited resource of these files. Also, would love to hear what page lists would be good to share. Here are a few quick ideas: States (separate files for each country) Measurement units Languages Religions Race Academic subjects (chemistry, biology etc) Publication types (book, journal article, newspaper article, newsletter, thesis etc) Car makes and models Anyone have a better idea for a name, or how to better describe "Page Lists"?
    1 point
  16. Shouldn't this be Europe/Warsaw by the way?
    1 point
  17. So I finally found out how the "1.2.3.13/bmi/" gets into the image URLs! It´s not a virus or the like, rather the Mobile Broadband provider injects this into the URL and you get the image via a proxy (a more compressed version of it, it is being reported). So I suppose for the CMS, when the new content just has been added the proxy doesn´t have it in the cache of course and therefore fetches it and compresses it, that´s why it takes so long. Whereas if you visit a more high volume site the images already are in the cache and so it´s not noticeable. I checked: a large percentage of the image-URLs of sites I visit have the "1.2.3.13/bmi/" in them, I just hadn´t noticed because they seemed to load normally. (I have only been using my current Mobile Broadband provider for a few weeks now). This seems to be fairly common with mobile broadband. They do it in order to save bandwidth (serving more compressed images rather than the original). I saw some hint that it is accomplished via an inserted javascript. Well, whichever way it´s done, I certainly don´t like the fact that my pages are changed on the way to the browser! The solution is probably to insert a a header that prevents caching - I still have to work out whether to do this by setting it on the server or inside ProcessWire. But anyway, it is not actually really a ProcessWire problem as such. Thank you teppo and kongondo for your advice. When I have resolved the issue I will post it here.
    1 point
  18. Hi Martijn, can you only use gif? (Newsletter with embedded cid: ?) You may try: function pimPng2Gif($im1, $rgb) { imagealphablending($im1, true); imagesavealpha($im1, false); $w = imagesx($im1); $h = imagesy($im1); $im2 = imagecreatetruecolor($w, $h); imagealphablending($im2, true); imagesavealpha($im2, false); $bg = imagecolorallocate($im2, $rgb[0], $rgb[1], $rgb[2]); imagefilledrectangle($im2,0,0,$w-1,$h-1,$bg); imagecopy($im2,$im1,0,0,0,0,$w,$h); imagedestroy($im1); return $im2; } $rgb = array(219,17,116); $png = $page->images->first()->pimLoad('png2gif',true); $gif = $png->setMemoryImage( pimPng2Gif($png->getMemoryImage(), $rgb) )->setOutputformat('gif')->save(); echo "<img src='{$gif->url}' /> {$gif->name}";
    1 point
  19. Horst, I'm not so sure we'd want to take this route because it would either have to modify the settings of the Pageimage, or it would have to return a new copy of the Pageimage on every option change. I wouldn't want it to modify the settings of the original Pageimage because other code in one's site/application might be assuming it to have the default settings. It would be like some tall person borrowing your bike and not lowering the seat back to where they left it when they are done. Maybe the eventual size(); call could reset those settings back (if it hopefully occurs), but that might also be confusing to someone wanting to issue multiple size() calls on the same Pageimage. Returning a new Pageimage would solve that, except it would also be pretty inefficient creating a new copy of the Pageimage for every single setting change. It makes sense with a size() call because it's literally returning a new Pageimage represented by a new file, but I'm not sure it makes sense for functions changing settings to return new copies of the Pageimage. I personally think that options intended for a size() call probably belong with that size() call as they are now. But if you think the array syntax is too much, we could always look at providing an alternate selector string syntax or something?
    1 point
  20. Ryan, thank you. I figured out the naming scheme, but I'm thinking in this case it might be better checking for known prefixes (Process, Markup, …) and bundle all others under a section called 'Other'? Because, in this case, there is no way to account for a good sectioning. Naming my module 'WeWorkWePlayMailer' won't throw an error but groups it under 'We'. That's stupid. 'WwwpMailer' groups it under 'Wwwp', which is okay but an abbreviation should be all caps… In my opinion, it'd be better to have an 'Other'-section, allowing developers to group their modules using a property in getModuleInfo(); I might be biased.
    1 point
  21. Thanks all! @onjegolders, Good ideas, thanks for the suggestions, I'll look into them. music = Fourplay - "Pineapple Getaway"
    1 point
  22. Got a Dutch translation pack in the pipeline too.
    1 point
  23. Excellent module, well done.
    1 point
  24. So here I found a possible hint at what might be going on, even though I can´t make sense of it yet: Like I described at the beginning, the problem is that "1.2.3.13/bmi/1.2.3.11/bmi/" gets inserted into the image URLs of the images on the pages, only the image URLs though, not the page URL. They still load, but much slower. It also happened on another server, got these instead: "1.2.3.10/bmi/1.2.3.12/bmi/" Now I found that all these IPs point to: IP Information for 1.2.3.12 IP Location: Australia Australia South Brisbane Apnic Debogon Project ASN: Australia AS15169 GOOGLE - Google Inc. (registered Mar 30, 2000) IP Address: 1.2.3.12 [Whois] [Reverse-Ip] [Ping] [DNS Lookup] [Traceroute] Whois Server whois.apnic.net (Info from http://whois.domaintools.com/1.2.3.12 ) On some forum I found the following: A 'bogon' is an unallocated IP address. There are still ranges of IP addresses which are reserved but not yet in use. These are filtered or ignored by many ISPs as they will only show up if something is misconfigured or something malicious is going on. But IP addresses are running out. The 'debogonizing' (ugh) project is designed to get these addresses assigned to companies and out of the ISP filters. 1.2.3.11 would have been a bogon, but isn't now (although your ISP might still think it is). A google search implies it's something to do with mobile phone proxy servers. If you remove '1.2.3.11/bmi/' from the URL, you should see the picture as it was originally intended. But why and how would that get into the image URL? I also read some vague hints about trojan infections or the like. However, where would that be? On my computer locally? On the servers?? Anyway, I´m going offline to run a comprehensive antivirus security check locally to see...
    1 point
  25. It seems to me that whoever created that database in the first place is trying to be too atomic (http://en.wikipedia.org/wiki/Atomicity_(database_systems)). You could replace all the fields containing eg. with something like Ryan's Google Map Marker fieldtype (http://modules.processwire.com/modules/fieldtype-map-marker/), such that room description (Master Bedroom) and the 2 dimensions are contained in one fieldtype, being reused for the different rooms. I think this might reduce the number of different fields required.
    1 point
  26. Thanks both (Ryan and interrobang)! Just have added optional support for PiM-Variations too <pre><?php $keepThumbnails = true; $keepPimVariations = true; // Pageimage Manipulator Variations ini_set('max_execution_time', 60 * 5); // 5 minutes, increase as needed include("./index.php"); if($keepPimVariations) { if(!wire('modules')->isInstalled('PageImageManipulator')) { $keepPimVariations = false; } else { // PiM is installed, but is it a version that has method getPimVariations() (Ver 0.1.0 +) $a = wire('modules')->get('PageImageManipulator')->getModuleInfo(); $actual = preg_replace('/(\d)(?=\d)/', '$1.', str_pad("{$a['version']}", 3, "0", STR_PAD_LEFT)); $keepPimVariations = version_compare($actual, '0.1.0', '<') ? false : true; } } $dir = new DirectoryIterator(wire('config')->paths->files); foreach ($dir as $file) { if ($file->isDot() || !$file->isDir()) { continue; } $id = $file->getFilename(); if (!ctype_digit("$id")) { continue; } $page = wire('pages')->get((int) $id); if (!$page->id) { echo "Orphaned directory: " . wire('config')->urls->files . "$id/" . $file->getBasename() . "\n"; continue; } // determine which files are valid for the page $valid = array(); foreach ($page->template->fieldgroup as $field) { if ($field->type instanceof FieldtypeFile) { foreach ($page->get($field->name) as $file) { $valid[] = $file->basename; if ($field->type instanceof FieldtypeImage) { foreach ($file->getVariations() as $f) { $valid[] = $f->basename; } } // keep thumbnails: if ($keepThumbnails && $field->type instanceof FieldtypeCropImage) { $crops = $field->getArray(); $crops = $crops['thumbSetting']; $crops_a = explode("\n", $crops); // ie. thumbname,200,200 (name,width,height) foreach ($crops_a as $crop) { $crop = explode(",", $crop); $prefix = wire('sanitizer')->name($crop[0]); $valid[] = $prefix . "_" . $file->basename; } } // what's about PimVariations ? if ($keepPimVariations) { if ($field->type instanceof FieldtypeImage) { foreach ($file->pimLoad('x',true)->getPimVariations() as $f) { $valid[] = $f->basename; } } } } } } // now find all the files present on the page // identify those that are not part of our $valid array $d = new DirectoryIterator($page->filesManager->path); foreach ($d as $f) { if ($f->isDot() || !$f->isFile()) { continue; } if (!in_array($f->getFilename(), $valid)) { echo "Orphaned file: " . wire('config')->urls->files . "$id/" . $f->getBasename() . "\n"; // #unlink($f->getPathname()); } } wire('pages')->uncache($page); // just in case we need the memory }
    1 point
  27. Czech Localization Pack. Current version: 0.9.6 (93 files) Changelog: Added: /wire/modules/Fieldtype/FieldtypeFile.module Added some missing strings Updated some strings Czech Localization Pack for external modules. Current version: 0.1 Added: TextformatterVideoEmbed /site/modules/TextformatterVideoEmbed/TextformatterVideoEmbed.module InputfieldCKEditor /site/modules/InputfieldCKEditor/InputfieldCKEditor.module FieldtypeCropImage /site/modules/FieldtypeCropImage/InputfieldCropImage/InputfieldCropImage.module /site/modules/FieldtypeCropImage/FieldtypeCropImage.module /site/modules/FieldtypeCropImage/ProcessCropImage/ProcessCropImage.module pw_czech_096.zip pw_czech_modules_01.zip
    1 point
  28. merged this and pagination from arjen. thanks guys!
    1 point
  29. I had the need of iterating through a lot (and I mean A LOT) of pages by template, and was also having memory problems. With this amount of pages it was becoming really annoying to do it few at a time, so I came up with a solution that doesn't need a wireArray. With this I could iterate over more than 50.000 pages with the same template on a website with more than 100.000 pages by bootstrapping PW from the command line. I just had to set a time bigger limit to PHP with set_time_limit(), and everything went fine and without interruptions. while (1) { $p = wire('pages')->get("template=my_template, id>$id"); // get page with id bigger than previous if(!$id = $p->id) break; // assign current page's id to $id or break the loop if it doesn't exist // do stuff using $p as the current page wire('pages')->uncacheAll(); // clean the memory (with $p->uncache() doesn't work. why?) }; edit: actually, using the command line I don't think set_time_limit() is even needed.
    1 point
  30. I looked at it a time ago, but I don't use that part of the Minify script. Maybe better to delete all those parts I don't use. (using 2 classes directly from within this module) (Already did the deletion of the rest of the files, think when developing that module )
    1 point
  31. Thank you, Ryan. My intent was to implement some sort of security auditing such that I would receive a message whenever a CSRF was attempted. So I needed to catch the exception. The following code works for me. try { $form->processInput($input->post); $session->CSRF->validate(); } catch (WireCSRFException $e) { echo "Processing aborted. Suspected attempt to forge the submission. IP logged." . $e->getMessage(); /* * Some code to execute whenever the token gets spoofed * Like sending a notification mail with the spoofer's IP address */ die(); // live a great life and die() gracefully. }
    1 point
  32. short update: the missing string has to be placed in /wire/templates-admin/default.php. Maybe could be done with installation process of the language support module? /* * Dynamic phrases that we want to be automatically translated * * These are in a comment so that they register with the parser, in place of the dynamic __() function calls with page titles. * * __("Pages"); * __("Setup"); * __("Modules"); * __("Access"); * __("Admin"); * __("Languages"); // the missing phrase * */ after that it's translatable. Also have done some more translations for the german language pack (for 2.3.4). Will send a pull request soon.
    1 point
  33. I've forked the module and added javascript callback. Now I'm working on the PUT and POST methodes then we have a complete restful solution. But does anyone know if it's possible the call the input settings of a field ? Like required, pattern, ... for a field
    1 point
  34. 1 point
  35. Beautiful work @jlahijani! Great job with the screencast too–I need to hire you to do my screencasts. Unless you've got other plans to produce it into an SAAS app or something, you should definitely release it. I think a lot of people would find this very useful both as a great tool to use and an impressive example to learn from.
    1 point
  36. Hi kp52 and welcome. Nice to read from you here check this out for more boost. COMING FROM MODX ? Link2: A MODX refugee: questions on features of ProcessWire http://processwire.c...of-processwire/ Link3: Code comparison between modx and processwire. http://processwire.c...ge-2#entry30349 PROCESSWIRE CMS INSIGHTS Link1: Very good case study from RayDale giving good insight in processwire http://processwire.c...a-a-case-study/ Link2: Symphony or Processwire ? Another good insight. http://getsymphony.c...s/thread/79645/ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Find more boost in these useful collected posts here: http://processwire.com/talk/topic/4173-grouped-forum-posts-links-articles-tutorials-code-snippets/
    1 point
  37. You could also do this in your homepage template: echo $pages->get('/path/to/page/')->render();
    1 point
  38. Absolutely! Here is a simple, but functional example for both login and logout templates. You would want to replace the markup with your own markup or includes. Likewise you'd want to change the redirects to redirect to whatever page you want them to go to after completing a login. /site/templates/login.php: <?php if($user->isLoggedin()) { // user is already logged in, so they don't need to be here $session->redirect("/somewhere/"); } // check for login before outputting markup if($input->post->user && $input->post->pass) { $user = $sanitizer->username($input->post->user); $pass = $input->post->pass; if($session->login($user, $pass)) { // login successful $session->redirect("/somewhere/"); } } ?> <html> <head> <title>Login</title> </head> <body> <form action='./' method='post'> <?php if($input->post->user) echo "<h2 class='error'>Login failed</h2>"; ?> <p><label>User <input type='text' name='user' /></label></p> <p><label>Password <input type='password' name='pass' /></label></p> <p><input type='submit' name='submit' value='Login' /></p> </form> </body> </html> /site/templates/logout.php: <?php $session->logout(); ?> <html> <head> <title>Logout</title> </head> <body> <h1>You have logged out</h1> </body> </html>
    1 point
×
×
  • Create New...