Leaderboard
Popular Content
Showing content with the highest reputation on 03/14/2014 in all areas
-
Here's a video of a module we're working on that I thought you guys might like. The module, Lister, provides a different type of Page List than the tree that you usually interact with in ProcessWire. It gives you a table of pages with customizable columns, filters and actions. Rather than try to explain what it does, I figured I'd show you. This module also uses a new (soon to be released) Inputfield invented by Apeisa, developed by me, and sponsored by Avoine, called InputfieldSelector – it's what you see on the configuration screen as well as the Filters tab. I recommend bumping up the size/quality to 720p so that you can properly see everything. The video has no sound... I tried to do one with narration, but that didn't work out.27 points
-
Thanks Ryan. You give me way too much credit. Happy that I could contribute to selector inputfield. And always grateful that company I work at has great trust and support for processwire. Lister is really a game changer for ProcessWire, thanks for building it Ryan!8 points
-
7 points
-
Ryan, Antti, (Avoine), I honestly can't thank you enough for this — this is a game changer (and that's not hyperbole). I'm giddy.6 points
-
5 points
-
Could someone please help me pick up my jaw from the floor . What just happened here?!!! Thanks Apeisa, Avoine and Ryan!4 points
-
I agree with renobird, this opens up new ways to work with processwire completely. Thumbs up Ryan and Apeisa, you rock! (..as usual..)4 points
-
PW not only having a great back end but also great back end coders. You guys really know what you are coding.4 points
-
Thanks apeisa, this is a very good solution, i will use this!! And for the record, here is my solution for the 24h format: ^([0-1]?[0-9]|2[0-3]):[0-5][0-9]$ Logic: The first number (hours) is either: a number between 0 and 19 --> [0-1]?[0-9] (allowing single digit number) or a number between 20 - 23 --> 2[0-3] the second number (minutes) is always a number between 00 and 59 --> [0-5][0-9] (not allowing a single digit)4 points
-
JPEG compression is lossy, JPEG compression with 8-bit images is very lossy. (http://www.4p8.com/eric.brasseur/gamma.html#introduction) And the GD-lib is not the photoshop engine.4 points
-
Hi Adrian Never too late to chime in. And you know I always appreciate your insights! That module you mentioned does a very interesting thing. I have made a mental note to have a play with it later on when I have finished some other things. Indeed I was wondering to myself just 2 days ago how could we resolve a page by it's id. Looks like you've solved that one! Yay! Ok guys... thanks to renobirds suggestions and Joss's sterling wiki pages on the url segments system along with a good cup of coffee, I created this snippet which I fully understand... // URL SEGEMENTS SECTION: // As we are only using 1 URL segment, let's display a 404 if there's more than 1 URL segment. if($input->urlSegment2) throw new Wire404Exception(); // This enables video pages to be resolved by appending the video id to this url: www.site.com/videos/ if($input->urlSegment1){ $page = $pages->get("video_id={$input->urlSegment1}"); // In case there is no such video id, let's display a 404. if(!$page->id) throw new Wire404Exception(); } That and turning on URL segments is all I had to do. These URL segments are bloody brilliant!!!! So, for now rainbird, i thank you for helping me make / discovering a fundamentaly large architectural change to the way I shall be adding videos in to the system. I would however, be interested in knowing, if anyone could share, how we could get a field that we created to auto increment. In the case here, I could do what Joss suggested earlier, and use the page id as the video id. That could be done programatically and the more I think about it, the more I like the idea! Thanks Joss! But for acedemic purposes, lets say i am starting from scratch, or that I have a field that is assigning all sorts of things and information to a "serial number" that increments. So there might be a need to have a field in a template that can likewise auto increment whenever we create a new page using that template. Any suggestions anyone how to actually code this facility in? Thanks again guys!!4 points
-
Very impressed by this video! Lister will be an awesome addition to any site but it seems extremely useful for sites that got a lot of content.3 points
-
You and Apeisa are incredible. Thanks to Avoine for again sponsoring ProcessWire development.3 points
-
3 points
-
Hi Zahari, don't forget: $page = $pages->get("video_id=" . (int)$input->urlSegment1); // type casting for untrusted user inputs !!3 points
-
This module creates a blank dashboard page in your site admin and sets it as default when you login instead of the page list. It came from a need in a few projects where I was creating modules for various user roles to use and I didn't want them to see the page list at all, but needed to display various stats and quick access buttons. For example, if you have a person who is creating invoices or doing other back-office stuff in various other Process modules then as an admin you wouldn't want them to access the page tree anyway, and there are other scenarios where you might want to have a dashboard instead of launching straight into the page list. It also requires (and adds) a permission - "dashboard" - so you can create new roles and assign the dashboard permission to those roles - something you might want to do fairly commonly if you have a lot of admin modules that you want to restrict access to. Editing the template is simple - there is a dashboard.php template file in the /site/modules/ProcessDashboard/ folder (decided to leave it in there to keep it safe, but I might be tempted to move it into /site/templates/ ) as well as .js and .css files ready to add your code to. You can use the API as you usually would to create your dashboard experience. For example, display data based on user roles or even specific users using code like this: if ($user->hasRole('invoices') { echo "Hi staff member $user->name. View invoices to be processed below: ... ..."; } if ($user->name == 'pete') { // Show some super-awesome stuff here } You can also do away with the dashboard.php template file and edit the module directly, putting your code and output in the execute() function (the way most Process modules are written) but I decided to include the separate template file to make it easier for more people to use. This does touch on areas a few other modules have addressed to some degree (like diogo's Custom Admin Pages) but this is designed for one purpose - instant dashboard creation. You can download the module here: http://modules.processwire.com/modules/process-dashboard/ This module also uses code from diogo's ProcessHomeAdmin module so that the default admin page can be overridden.2 points
-
don't know if is useful but here are some chart js librarys https://developers.google.com/chart/interactive/docs/gallery/treemap?hl=en http://smoothiecharts.org/ http://www.oesmith.co.uk/morris.js/2 points
-
Hi horst Thanks for the great advice, replies and the code example too! I shall dig into it and study it! Thanks again renobird. Cheers guys!2 points
-
I think it should work if you initialize the values with zero here: https://github.com/ryancramerdesign/FieldtypeMapMarker/blob/master/MapMarker.php#L332 points
-
This one I use for something other, so please modify to your needs (maybe 'saveReady' ): public function init() { $this->addHookAfter('Pages::save', $this, 'hookAfterPagesSave'); } Following code is not tested! // in your function, first get the page with something like $p = $event->arguments('page'); // depends on hooked method // check to avoid endless loop if($p->skipMe) return; // validate if it is a page of the right type, maybe check template if('video'!=$p->template) return; // don't do it for videos that have already their unique id if($p->video_id) return; // get the last used number $data = wire('modules')->getModuleConfigData($this); // get the modules data $id = intval($data['myIncrementalId']) + 1; // get the last used number and add +1 $data['myIncrementalId'] = $id; wire('modules')->saveModuleConfigData($this, $data); // save back the data // save this to the template field $p->video_id = $id; // add this to avoid endless loop $p->skipMe = true; // ready $event->return = $p;2 points
-
Optical illusion? For me both are the same exact brightness, resize browser and open both and switch between them.2 points
-
High five, putting those settings in config.php seems to have solved it for me as well.2 points
-
2 points
-
How about using text field and simple pattern to keep it like date? If you put this into pattern setting of your textfield: [0-9]{1,2}:[0-9]{2} it will only allow values like 9:15, 14:20 etc... Of course that regexp could be tweaked to US friendly if pm / am etc are needed. I find all the timepickers clumsy compared to clear and simple text input. Oh, and if data needs to be 100% valid, then this is no good of course, since this allows values like 99:99. Regexp could be tweaked though...2 points
-
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
-
I didn't know this one Shortest way to echo a variable only if populated (using pw fields of course ): echo $page->field?:''; and: echo $page->field ?: "field is empty"; // echoes field content echo $page->empty_field ?: "field is empty"; // echoes "field is empty" or even: echo $page->field1 ?: $page->field2 ?: "they are all empty";1 point
-
Parse.com It's a platform for mobile applications. you have other options like stackmob or kinvey. Basically you got an SDK for different platforms that enables communication, data storage and push notifications. Currently I´m Looking foward integrating Processwire with Parse.com using the php wrapper https://github.com/apotropaic/parse.com-php-library1 point
-
small update: added separate inputfield for HTML signature into config page to solve an issue found by tuomassalo. https://github.com/horst-n/WireMailSmtp/issues/1 version now is 0.1.81 point
-
You're welcome. I think Ryan did some work on the float fields - there was a problem that float values were "cut down" to integers due to the local set by PHP, if multilang support was enabled. Maybe something changed how an empty value is handled too. Cheers1 point
-
Assuming that those time entries alway have a start and an end. And as the date is not necessary I assume that those time stamps never overlap the span of 24 hours. I do think it's not that difficult to "rebuild" Soma's slider a bit. Set it to RangeSlider and set the Max value to 86400 (seconds a day). or to 96 ( all quarter of hours a day ) Then the only thing you need to change is the value for the slider labels.1 point
-
Hey Wanze, You're right for sure. I got thrown because I though it was just API related, but it actually seems like a bug between MapMarker and the latest version of PW. I looked back at a couple of sites that are working fine and MapMarker has always defined those as '' and not 0 and they have always been float fields. Not exactly sure what changed where, but this definitely fixes it. I'll submit a pull request for Ryan. Thank You!!1 point
-
dnGREP too. Or if it is in your database, you can just search there, e.g. using phpMyAdmin...1 point
-
You can always ftp/download all the files and folders to your computer a just do a quick 'Find in Files...' with Sublime Text, Notepad++, or any search tool you've got available. beaten by DaveP1 point
-
If you have shell access you can use grep, otherwise (so long as file size & bandwidth allow) download the whole lot and search locally,1 point
-
You really need one of the more Ajax knowledgeable people round here to make this work properly. I am not sure how it could count as an extra pageview, or whether it does on Pinterest - that side of it might not be an issue for them and from the SEO point of view, it is not how many times a page is viewed, but rather whether the page is linked to from other sites. The link that you click will, from the search engine's point of view, be just an ordinary link - it is the JQuery that will then use that link to create the modal and so on. If you are looking for stats on what is clicked (which is different from whether it is good SEO or not), then you could create a field for your template that is for hits, and then have it add one each time you click on the link. This is an old post from Ryan http://processwire.com/talk/topic/245-automatic-visit-count-5k-visits-a-day/?p=16611 point
-
1 point
-
http://www.4p8.com/eric.brasseur/gamma.html#introduction or before: http://processwire.com/talk/topic/3768-processwire-231-dev-branch/page-5#entry43649 BTW: I remember well the first words from a colleague who has experience for more then 20 years working in international architecture photography bussiness after playing around 2-3 days with his first ProcessWire version of his site: "Schönes Programm, übersichtlich und einfach. Vor allem alle meine Bilder sind so klar und knackig." (english with googleTranslate: "Nice program, clear and simple. Above all, all my images are so clear and crisp.") And be aware: by visualizing images or anything else within a website there are involved many instances. (Browser, System, Monitor). Above all, one can not make reliable statements if you do not at least use a good set hardware calibrated monitor. And even two well adjusted monitors doesn't show the exact same output. So, before going academic here, ... back to work.1 point
-
Chiming in quite late here and to be honest haven't read things thoroughly, but my RedirectIds module might be of use for giving your clients an easy url over the phone: http://modules.processwire.com/modules/process-redirect-ids/ It means you can give them: mysite.com/videos/1356 where that number is the PW ID of the page. You can choose to have that link redirect to the normal full PW url for the video, or stay on the numbered url and just load the page content - simple config setting in the module. Not sure if this is your best approach, but thought I'd throw it in the mix.1 point
-
Dear Horst, Thanks for this tip. I had read the post by Hari, and Ryan's response. It seems to me that the reconnect to mysql code would come in handy, but it also seemed that it was meant for situations where there was quite a lag between commands, like with thousands of records being processed. In my case, it was happening with load balancer hits against the index page. Also, my version of PW didn't have the file 'WireDatabasePDO.php'. It just had Database.php. But... your post, and Hari's comment on the GitHub page, https://github.com/ryancramerdesign/ProcessWire/pull/366, stimulated my little grey cells, so I went and looked at the wait_timeout value. It was set to 30 seconds, and the load balancer checks every 30 seconds, so I thought that might it. So I raised the value to 300 seconds. I'm hoping that will fix it. Crossing my fingers. Thanks for your help! Peter1 point
-
1 point
-
On the subject of limiting the default PW admin user interface to only show users their own content in some way i can't help you. Maybe others have solutions. But this does sound like you might indeed want to make a 'front-end' system, where a member can login and manage and create their content. You can still use all the power of the PW api, to store the content (pages), users etc. Creating a member role and giving it only the page-view permission will keep them out of the PW backend but this will allow you to use the API to do stuff with roles. You can add as many roles and (custom) permissions to that roles, that you might need for your frontend system. On this subject i once wrote a simple example http://processwire.com/talk/topic/2937-creating-a-front-end-admin/?p=28954 This might help some. Of course, making you own admin basically, will require work, coding skills and a good understanding of (the) PW (api). More knowledgable users will be able to answer more specific questions on this subject.1 point
-
I forgot modules take a little while to become approved in the directory - you should be able to download and test this module out now.1 point
-
@SiNNuT: thanks, yes it's Ubuntu. I will try that fix first with: ini_set("session.gc_probability", 1); ini_set("session.gc_divisor", 100); And if this doesn't do it, I will delegate it to a cron-job.1 point
-
You might want to try what Ryan suggests here: http://processwire.com/talk/topic/1142-lots-of-sessions/?p=30237. Session garbage cleaning isn't currently working on certain systems with default config (more about that here). Garbage cleaning for sessions is always random and it's possible that it just hasn't happened for a while. Hard to say without knowing a bit more about your environment, how often new sessions are created etc. Anyway, above solution shouldn't cause any harm either, so I'd try if it helps.1 point
-
You can also just zip the entire site up, put it in the new location and change the DB values in config.php. I always work like that - I develop on an old box locally that is set up with ubunto and virtualmin so that I am always developing as a root installation and then just move the entire thing to wherever it is needed. Much easier for a non-tech like me. I never use export profile to move a site, just to create profiles for multiple use. Edit; oh, yeah, I forgot you need to export/import the DB ... But quick and easy to do.1 point
-
I am not a dev, but as I said before, all they are doing is using a line of JQuery to put the url of the linked-to page into the address bar. If you look at the source, the modal is in a div with the class "module Closeup canClose" This div is written (using ajax, I would guess) into a div called appendedContainer, which remains on the page unpopulated if you don't click on anything - it is simply a target for the retrieved page The css for the the closeup div is: .App .appendedContainer>.Module { -webkit-overflow-scrolling: touch; overflow-y: scroll; bottom: 0; left: 0; position: fixed; right: 0; top: 0; z-index: 680;} As you can see, it positions itself over the home page content with a z-index to put it on top. The actual homepage which is being overlaid is in a div called "ajax HomePage Module," just for interest and to help you find your way through the source. sooooo... What needs to be done here (by some nice person who can write a couple of lines of code) is for your link to call, by ajax, an actual PW page using its own template (possibly render() - though you would need to get rid of header and footer bits), write it into a div as above and at the same time, pop the URL of that page into the address bar. I am pretty sure that is how Pinterest are doing it, though foolishly, without PW It is probably about 4 lines of code and a couple of lines of JQuery to sort out the address bar bit. I am really not certain how to do it as I am an ajax virgin, but someone should be able to do it on the back of what I have just written. By the way, I do not see any SEO advantage to this method - the page is only called in by ajax when the user actually clicks on the image/link and the address bar is only populated at that same point. From a Search Engines point of view, it will just look at the link on the image, whether or not it has a nice flash popup Does that help steer you in the right direction? I am sorry I don't quite know enough to post the actual few lines of the solution. I could probably work it out eventually, but that would just be by asking everyone here how to do it! haha. PS: It is very definitely NOT an underpop - though I love that term! It is an overlay.1 point
-
Here's a very basic test page / proof of concept: http://fantastique.ch/pinterest/ Using underscore + backbone + colorbox. i.e. accessing http://fantastique.ch/pinterest/#backbone-js will load the desired url in the colorbox iframe (not just onClick).1 point
-
Joss, Horst, thanks for the reply, but like dragan points out (Thanks Dragan) the lighbox does not solve the url rewrite method and that is what I am looking for. I looked at backbone.js but for the life of me can not figure out how to make that work. That is why this is posted in the jobs section, cause I would prefer someone to do this for me and make that work, I am not proficient to do this myself. tnx!1 point
-
You can only pass static strings to the __() function. At least, the translation parser will only be able to find static strings. The only reason you'd put a variable in a call to the __() function, is if you knew the text was already available translated, and wanted to retrieve the translated version. But that text would have had to appear statically, somewhere else in the file. To make a multi-langage image field, you can use a Repeater. Your repeater would contain two fields: 'image' and 'summary'. Make the 'image' field of type Image, and set to to contain max 1 image. Make the 'summary' field of type TextLanguage (or TextareaLanguage). The Image field is the next one on the list to make multi-language capable, so should be within the next major version of ProcessWire.1 point
-
If PHP's garbage collector isn't working right, it'll affect DB sessions too. @joe_g, unless your site really handles that many sessions in a day, you may want to look into your PHP garbage collector settings. The relevant PHP settings are session.gc_probability, session.gc_divisor and session.gc_maxlifetime. We set the gc_maxlifetime automatically based on your $config->sessionExpireSeconds setting, but not the other two. However, you can force specific settings for those by adding lines like this to your /site/config.php file: ini_set("session.gc_probability", 1); ini_set("session.gc_divisor", 100);1 point