Leaderboard
Popular Content
Showing content with the highest reputation on 12/02/2013 in all areas
-
If you like, please check out our latest project powered by Processwire: http://www.gasthaus-stuhlmacher.de/ A small website to the well known Restaurant Gasthaus Stuhlmacher in Muenster, Germany. It is one the oldest restaurants in town with a long tradition and a great historical background. Processwire is absolutely stunning! It is just unbelievable how fast and clean we are able to develop our projects. The backend is so easy to use. All of our customers are in love with it too. Especially the ones who are coming form Typo3, Drupal or Jomla! Thank you so much for all your efforts and support.2 points
-
Thank you, Wanze! I think I got it in a way. I was afraid no one would reply such a noob question. But you guys are so responsive, you rock Sometimes, even a tiny little thing would not make a sense and you have to ask someone else who knows. Such a welcoming community. I'll explore PW more and will make this website. Thanks again.2 points
-
This module serves as an example of creating an editable table of data as a Fieldtype and Inputfield in ProcessWire. In this case, we create a simple table of events each with date, location and notes. This pattern can be adapted to nearly any table of information. Note that this module is intended as a proof-of-concept. If you find it useful for the example scenario (events) then great, but keep in mind it is not intended as a comprehensive events solution, where using ProcessWire pages may be a better fit. This is a pattern I've used for creating tables of data in ProcessWire for many different Fieldtypes/Inputfields and thought it would be good to setup a proof-of-concept example like this to share. Module Page / GitHub Page Install Copy the files for this module to /site/modules/FieldtypeEvents/ In admin: Modules > Check for new modules. Install Fieldtype > Events. Create a new field of type Events, and name it whatever you would like. In our examples we named it simply "events". Add the field to a template and edit a page using that template. Output A typical output case for this module would work like this: foreach($page->events as $event) { echo " <p> Date: $event->date<br /> Location: $event->location<br /> Notes: $event->notes </p> "; } This module provides a default rendering capability as well, so that you can also do this (below) and get about the same result as above: echo $page->events; ...or this: foreach($page->events as $event) { echo $event; } Finding events This fieldtype includes an indexed date field so that you can locate events by date or within a date range. // find all pages that have expired events $results = $pages->find("events.date<" . time()); // find all pages with events in January, 2014 $results = $pages->find("events.date>=2014-01-01, events.date<2014-02-01");1 point
-
Field dependencies are coming in ProcessWire 2.4, and I just wanted to give you guys a little preview of it. The development of this new feature is being sponsored by Avoine, the company where Antti works (he also specified how it should work). Field dependencies are basically just a way of saying that one field depends on another. It dictates which fields should be shown in a given context. In our case, it also gets into whether a field is required or not. This short video demonstrates how it works: (switch to the 720p and full screen version, as YouTube's default settings for this video make it impossible to see): // Edit @Adamkiss: Here's link for those on mobile: youtu.be/hqLs9YNYKMM The implementation here is done both client-side and server side. Javascript handles the showing/hiding of fields and the required vs. not required state changes. On the server side, it doesn't process any fields that aren't shown, and honors the required rules. A separate processing occurs both client side and server side, ensuring that the user can't make their own rules by manipulating the markup or post data. These field dependencies can be used with any Inputfield forms. That means you'll be able to use it not just in ProcessWire, but in FormBuilder, and via the API too. It's very simple to use from the API. All you have to do is specify a ProcessWire selector to either "showIf" or "requiredIf" to the Inputfield, and ProcessWire takes care of the rest: // show this field only if field 'subscribe' is checked $inputfield->showIf = "subscribe=1"; // show this field only if 'price > 0' and at least one category selected $inputfield->showIf = "price>0, categories.count>0"; // make this field required only if 'email' is populated $inputfield->required = true; $inputfield->requiredIf = "email!=''"; This feature will be in the 2.4 core (rather than as a separate module), so it will also be ready and available for things like module and field configuration screens.1 point
-
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
-
Today only: ALL SitePoint Books and Courses$5,000 Value, NOW JUST $99 https://learnable.com/99-deal-unlimited1 point
-
Hi! Here is my second work on PW: one page promo site for super mega cool strut mounts (some car stuff). www.ss20gold.com - ProcessWire 2.3.7 - multilingual; // pm me, if there are funny/wierd mistakes, please - scroll-scroll; - animated gif reincarnation; - about 50 times of Massive Attack - Heligoland in process. Thanks all of you, you guys are rock!1 point
-
Hello everyone! I launched yesterday another PW site: http://compab.it The modules that i have used are: • Site wide file manager. • CKeditor • Language Field Tabs • Modules Manager • Site indexer • Ergo ADMIN THEME Enjoy!1 point
-
Yeah, used it for a jQuery plugin a while ago. Can't get much more "permissive" than that.. There's a license for pretty much every specific need out there, but for a system like ProcessWire I believe GPL was good choice. At least we, it's users, know it'll stay free (as in freedom, but probably as in beer too.)1 point
-
It's a fact that you cannot (legally) combine GPL code with code under any non-compatible licenses. That'd be a violation against GPL and most likely against the other license too. Ryan's explanation (here) is based on his interpretation of what extending / building on another application really means; as he explains it, he doesn't consider 3rd party modules to extend ProcessWire -- they just use an API it provides. I would argue that this is a legal grey area and no-one really knows for 100% sure how these rules work or what's legally considered "extending". Even the code word "extends" doesn't necessarily imply that this is something that in legal sense "extends or modifies" ProcessWire and thus needs to be published under GPL (or not be published at all). Heck, even FSF, though they (or mr. Stallman of FSF) are the authors of GPL license itself, admit that they don't know for sure how this would be interpreted in a court: So, I guess it's ultimately a question of whether ProcessWire modules are "intimate enough" with ProcessWire core to make a single, modified program vs. running as separate, individual programs that just communicate with each other. Personally I'd trust Ryan's judgement on this, as it seems to make sense. What I would like to point out, though, is that legally it doesn't make any difference what anyone here, including Ryan, has to say about this -- what really matters is the copyright law and how it should / would be interpreted. In any case I don't think that anyone is going to sue you for creating a commercial module with closed license.. @dazzyweb: regarding FB and ProCache licenses, see this post by Ryan. AFAIK this applies to both modules.1 point
-
There you have it, geeber and titanium just answered to the missing points. Building on top of that, your homepage code wouldn't be too different from this: <?php // header code foreach ($page->children() as $child) $child->render(); // footer code Couldn't get much simpler than this, could it? edit: titanium's method is perfectly fine, but if you're using the dev version you can use the method that Ryan describes here http://processwire.com/talk/topic/3551-small-tip-for-pages-that-will-be-used-with-render/1 point
-
Hm, there was something going on when Ryan implemented LanguageSupportPageNames about the language segment /de/ /en/ which is something that not really is needed when using this localized urls, but some think it would be nice to still be able to have them. This was when he made "home" page name configurable which normally without this module has no page name. I thought it would be possible to have the default language i.e /de/ be possible, but it looks like it's not, as it will redirect you to "/" root. I've not used this feature since LanguageSupportPageNames came out and wasn't aware, sorry. I'm not sure what you could do right now but the code that does this is in #294 if($page->id == 1) { // special case: homepage //$name = $isDefault ? $page->get("name") : $page->get("name$language"); $name = $isDefault ? '' : $page->get("name$language"); if($name == self::HOME_NAME_DEFAULT || !strlen($name)) return '/'; return "/$name/"; } If you uncomment this line //$name = $isDefault ? $page->get("name") : $page->get("name$language"); And comment out the line $name = $isDefault ? '' : $page->get("name$language"); This would allow you to redirect and stay there like "/de/" or "/en/". But further more this will also automaticly redirect "/" to the default "/de/" and you can't change it really again. So to make "en" default you would have to redirect again. This might be possible with some hook magic, but this seems rather silly. Since the line is still there I think Ryan was also unsure what would make the most sense and how to behave for the home page if segments are set or not, and I think some configuration should be possible to define the behavior of the special case.1 point
-
You convinced me. I will buy lots of those edit: you also convinced me with Massive Attack. Listening to Heligoland right now!1 point
-
You're welcome! Yes exactly. It's the same as getting the values from php's $_POST array, but it's a nice "Pw-way" of doing it Plus you get the advantage that if a variable is not set, $input returns null whereas accessing a variable that does not exist in the $_POST array returns a Notice "undefined index".1 point
-
Another option I think, might be to build a module that integrates Sir Trevor and enhances it with ProcessWire-specific blocks1 point
-
This is significantly more scalable and resource friendly than repeaters. It's directly connected to a single DB table without any other overhead.1 point
-
The unzipping in that part of ProcessWire doesn't use ZipArchive, and it needs to be updated. ZipArchive didn't used to be very common, so calling an unzip utility from the shell (what PW does) used to be more reliable across servers. Unfortunately that method doesn't work on Windows servers. Also, ZipArchive is very common now and this part of PW just needs to be updated to use it instead of the older method.1 point
-
1 point
-
Soma, since you pointed me to it specifically, I just wanted to let you know that I was able to use ImagesManager for my project and it fit the bill completely. Thanks for taking the time to work on image gallery management for PW!1 point