Leaderboard
Popular Content
Showing content with the highest reputation on 08/24/2016 in all areas
-
Great work @benbyf! I understand you wrote the tutorial to show that the module can do stuff on installing and uninstalling. There is another example you could use to handle creating pages and permissions (more info): public static function getModuleInfo() { return array( // Some default stuff 'title' => 'Title of the module', 'version' => 001, 'summary' => 'Summary of the module', 'autoload' => false, 'singular' => true, 'icon' => 'bookmark', 'permission' => 'name-of-the-permission', // Creates the page (and removes after uninstalling) 'page' => array( 'name' => 'name-of-the-page', 'parent' => 'admin', // Or whatever 'title' => 'Title of the Page', ), // Creates the permission (and removes after uninstalling) 'permissions' => array( 'name-of-the-permission' => 'Title of the permission' ), ); } Written in browser, so not tested. I guess you'll get the idea4 points
-
Newest tutorial about modules now available on tuts+ - Extending the ProcessWire Admin Using Custom Modules http://webdesign.tutsplus.com/tutorials/extending-the-processwire-admin-using-custom-modules--cms-26863 Thanks for everyones help.4 points
-
Ok, thanks to some testing and tweaks from @tpr, the Dumps Recorder now has a "Preserve Dumps" checkbox. When checked, dumps will be preserved until the session is closed. With it unchecked, they will be automatically cleared on page unload. This means it will store all consecutive ajax called dumps, and any dumps during php page redirects (which would be lost with the normal core Tracy dumps panel), but not burden the panel with lots of data unless you specify. The "Clear Dumps" button is there if you want to have a clear slate while testing ajax calls without needing to reload the page to clear. Let me know if you find any problems or have suggestions for improvements and don't forget to like @tpr's original post suggesting this option.3 points
-
I don't see anything wrong with your videos foreach, but look at the Cast line from your OP, you can't simply output $page->cast assuming "cast" is a page field. There are multiple ways, but perhaps the easiest for the way you have your code structured would be: $page->cast->implode('<br />', 'title');3 points
-
@Reid Bramblett Glad that worked out for you. @Mats Thanks for pulling our changes back into your repository - great! I made a few little tweaks to my repo since you did the merge; any chance of getting them pulled over to your repo as well? >PS Nice change to your avatar! I like the look of those T-shirts3 points
-
Recently we have had the absolute pleasure of working the professional grade monitor providers, EIZO. EIZO provide colour accurate monitors, so we took heavy influence from colour in our design process. For the website, as always ProcessWire has been a perfect fit. The modules I have used are as follows: ProCache ProFields Hanna Code MarkupSEO ColorPicker MapMarker MobileDetect Any feedback would be much appreciated — http://eizocolour.com/2 points
-
2 points
-
2 points
-
I found the time to test with a plain 2.8 installation, and it also refused to save changes. Just in case somebody needs a quick workaround too, I replaced the original code in UserGroupsHooks.module (starting at line 738): foreach(array('view_groups', 'edit_groups', 'manage_access') as $name) { $inputfield = $form->get($name); if ( $inputfield instanceof Inputfield ) { $inputfield->processInput($this->input->post); if( $inputfield->isChanged() ) { $page->set($name, $inputfield->value); } } else { $this->log->message("Not an input field in form: $name"); } } with this workaround for now: $fld = $this->modules->get("InputfieldCheckbox"); $fld->attr('id+name', "manage_access"); $fld->processInput($this->input->post); if($fld->value != $page->manage_access) { $page->set("manage_access", $fld->value); } if($page->manage_access) { $pa = new PageArray(); foreach($this->input->post->view_groups as $grp) { $pa->add($this->pages->get($grp)); } $pa->sort("id"); $page->view_groups->sort("id"); if($page->view_groups->implode("|", "id") != $pa->implode("|", "id")) $page->view_groups = $pa; $pa = new PageArray(); foreach($this->input->post->edit_groups as $grp) { $pa->add($this->pages->get($grp)); } $pa->sort("id"); $page->edit_groups->sort("id"); if($page->edit_groups->implode("|", "id") != $pa->implode("|", "id")) $page->edit_groups = $pa; } The fix in Issue #45 is also necessary for PW 2.8.2 points
-
You need to specifically enable the field to use a datepicker in it's settings.2 points
-
I should have also pointed you to this post which explains more about how to use implode, including using it with <li>2 points
-
No, sadly I don't own a Tesla Model S. Instead I own a 1994 Mazda. But with getting ProcessWire 3.x ready to release, I didn't have a lot to write about this week. So figured, why not chat about something else I'm passionate about (this is a blog after all). Last weekend, I got to pretend that I owned a brand new 2016 Tesla Model S (P90D) for two days and a couple hundred miles. I was so inspired by it, I figured why not write something. We'll even attempt to draw some parallels with ProcessWire. This post also covers updates to several 1st party modules. https://processwire.com/blog/posts/tesla-model-s/1 point
-
Sup. FieldtypeOpenWeatherMap [GitHub] This module fetches and stores current weather data from the OpenWeatherMap.org service and helps you manage icon markup. To limit requests, OpenWeatherMap.org’s JSON-response is cached in the database and only refreshed once the field is accessed and the cache has a certain age that you define. The fieldtype is sadly not multilingual, but you can configure the language of the weather descriptions OpenWeatherMap.org provides you with. It would not be hard to make the output multilingual by referencing weather codes and translating them with ProcessWire’s built in tools. You install FieldtypeOpenWeatherMap just like any other module, by placing the two files into ProcessWire’s modules directory. Once installed, you want to create a new field of the type OpenWeatherMap and assign it to a template. The template now has a text field that stores a city id. In the field settings, you may configure how and when the data is requested. That is, the requested language, units (eg. °C/°F/K) and the cache duration. The module does not provide you with built in icons or otherwise limits you to predefined markup (which I consider a good thing ). The icon in my example above is courtesy of Alessio Atzeni’s Meteocons (custom free license). To make generating icon markup a little easier, you can configure your own markup snippets in the module configuration: As you can see, in this example I’m using an icon font whose appearance is defined elsewhere in my CSS, but you’re free to put in image urls or just unicode entities or whatever. Rendering it is now quite simple. The following markup would result in something like the image above: <?php $w = $city->weather; $temp = round($w->temperature); ?> <p><?php echo "{$w->renderIcon()} {$w->description} at {$temp} °C"; ?></p> <h2><?php echo $city->title; ?> <span class="ico-rightarrow"></span></h2> <!-- irrelevant line --> The variable $w is now a WeatherData object that exposes the following properties: json //The raw JSON response from OWM timestamp //The time of the request city_id //The city id you entered in the admin sunrise //The time of sunrise sunset //The time of sunset main //The main weather name, e. g. “Rain”, in the configured language description //A slightly longer, more precise description like “occasional rain” iconcode //The internal icon code for this weather temperature //The temperature in the format you requested min_temperature //... max_temperature //… wind_speed //I believe the wind speed is also affected by the unit settings. As well as the method renderIcon(), which you already know. If you access a WeatherData object as a string, you will get the city id. This is so that the city id will correctly appear in the admin page edit form. I should mention that there is some more information in the JSON, such as wind direction. The module also exposes the method multiRequest(PageArray $pages, $fieldname). If you want to fetch data for a bunch of pages at the same time, you may want to use that so as to reduce unnecessary requests to the service. I haven’t really used this yet, so consider it experimental, I guess. As of now, this also disregards the cache freshness. If you’re still reading, there’s a chance you might be interested in using this. Allow me to clarify that right now there is no support for forecasts or historical data (yet?). Sorry :> Here’s the GitHub link: FieldtypeOpenWeatherMap.1 point
-
1 point
-
In ProcessPageList::find you can set showRootPage to false like this (trial and error): $event->object->set('showRootPage', false); // or this: // $event->object->showRootPage = false;1 point
-
Have you set up URL segments for the home page template? See Ryan's post where he talks about the home template:1 point
-
Tell me about it - sometimes they try to simplify to the point of losing functionality! I have just turned this default behavior off. I do not know why I haven't done so earlier. As for the other issues: thanks for striving for perfection. We are in the same boat1 point
-
Thanks - looks like I forgot to pass the length and depth settings to the dump method. I'll sort that out in the next version. The depth should actually make a huge difference to the size of the panel. I'll see what I can do about that - looks like I need to force it to wrap. Tell me about it - sometimes they try to simplify to the point of losing functionality!1 point
-
I have changed it, and it does not make a difference. I mean I always get 150 characters, even if I set it to something else. Another issue it the column content of the string. On this page it gets really wide (last colum can hardly be seen): And thanks to Apple's decision to hide scrollbars by default, I often do not even notice that a window's content can be scrolled. That is my own grief, however, I just wanted to mention that on a Mac it can be even more confusing when the table is cut off right before the last column.1 point
-
SITE OF THE WEEK! Beautifully crafted. Splendid work. And your using MapMarker. Good to see other people are putting it to good use.1 point
-
Awesome! Personally, I prefer to keep my code as basic as possible and avoid frameworks, but this is the kind of thing that helps the developer base grow and we all win. Great work.1 point
-
Thanks @szabesz for your input on this - definitely some good ideas. A couple of quick comments/questions: Could you PM me the html from that panel - I'd like to see why it is so large. I can already see that I am not getting the array of ML titles - it is still returning an object, but based on the size, I am guessing there are some other objects also in the Value column. Rather than jumplinks to sections, would you be ok with collapsed sections, like the PW Info panel? I like the idea of highlighting variables only used once - it was something I had also been thinking about. Looking at your $authors variable - is that actually one of those things that should be highlighted - is it really just defined there and never actually used, or is it used twice on that line, or there a problem with my detection of it only being used on that one line? "It would be nice to have a "collapse/expand all toggle" for arrays/objects" - what arrays/objects don't have this already? I thought it should be all. Not sure about making strings collapsible - this is a core Tracy feature I am using to make arrays/objects collapsible. You can set the length of the string in the config settings though (default is 150) - does that help? Also not sure about turning columns on/off - does the width of the panel matter that much, or is it more the height that important? Also curious what others think of the recent additions to this panel - is it getting to be too complicated? I haven't tested with complex pages with lots of template defined vars, so maybe it does need some refining - seeing your 1.1MB is not a good sign, but I think that can be dealt with so long as I convert all objects to arrays of the relevant properties/values rather than the full object.1 point
-
Wow, Gerrit van Aaken Hey Gerrit, feel free to leave your comments/wishes here or at git hub. I'm not sure, how fast I can continue work on this. But I'm curious about your improvements. Please keep in mind, that this module is still work in progress. I already use it in production, but it's not well tested. I can not say, if it works well on a large scale (like your big image database). Because the implementation uses JSON as storage format, be sure you don't need PWire-typical Selectors on your image-links. A LIKE-driven database lookup is all you can get on this fields atm (and maybe at all).1 point
-
Hi @adrian The Template Resources panel has started to grow fast, so I thought just before it outgrows my notebook's screen, I present a couple of suggestions: Returns and Class columns can be merged. After all, the info "Object" is redundant. Long string like a body's HTML code takes up a lot of space in the Value Column. Can you introduce AJAX only loading of such values? Or it can be made collapsable just like arrays/objects. That way initially the column would be narrow when arrays and objects are not expanded. It would be nice to have a "collapse/expand all toggle" for arrays/objects. What if columns can be turned on/off? At least the "Files/Lines" column. It could initially be in its closed state. This is what is used the least, I suppose. BTW, how about highlighting variables used in one template only and only once? It can help us spot variables no longer used or the developer might want to eliminate such variables by using expressions instead. How about jump links at the top to sections of the panel (to variables, constants, functions, included files)? The first two lines could be merged into one paragraph (These are all the... If you are looking...) to save some more space. "Panel generated in 183.67 ms Panel content size: 1.1 MB" could also be merged into one line and could be placed at the top, so no need to scroll down... Hope you find these suggestions useful. The following is just a screenshot to show what it currently looks like on my machine.1 point
-
Infinite scroll would be ok with automatically updated history state and a max number of images in the dom (aka removing / re-adding older ones). But this essentially renders the scrollbar useless.1 point
-
Is It admin or frontend? This might help you https://processwireshop.pw/plugins/dynamic-selects/1 point
-
1 point
-
Infinity scroll kills linkability. With pagination you have at least some links (although content changes over time). Great site and photos!1 point
-
All shots are film, developed and enlarged in my home bathroom. A serious hobby I would call it. Digital is so dead Could also infinity-scroll without page loads...1 point
-
@netcarver Repo is updated. Thats's my favourite shirt! Thanks for setting up the store.1 point
-
1 point
-
I may found the culprit: the top positon of the dropdown is 46.5px. It's calculated by JS, but I guess it's safe to hardcode as 47px. Try adding this with devtools and see if it helps: .topnav.ui-menu.dropdown-menu { top: 47px !important; } Works here in Chrome. In Firefox I couldn't see the flicker at all. In Chrome I see it very rarely, but if you zoom out the page it occurs more often.1 point
-
1 point
-
hi @thetuningspoon just wanted to say thank you! i looked to your code and it was really easy to implement my own fieldlink (needed some special selections) like this: php hook: /* pagefield for league selection */ $this->addHookAfter('InputfieldPage::render', function($event) { $field = $event->object; $pages = $this->wire->pages; if($field->name != 'league') return; // load script $this->config->scripts->add($this->config->urls->Webifex . 'pagefieldReload.js'); $admin = $pages->get(2)->url.'page/'; $leagues = $pages->get(1017) // settings ->season // current season ->child('name=ligen'); ob_start(); ?> <div><a class="pw-modal" href="<?= $admin.'?open='.$leagues->id ?>"> <i class="fa fa-edit"></i> Ligen verwalten </a></div> <?php $html = ob_get_clean(); $event->return = preg_replace('/<\/div>$/', $html, $event->return); }); and this simple javascript: $(document).on('pw-modal-closed', 'a', function() { $(this).closest('.Inputfield').trigger('reload'); }); awesome1 point
-
1 point
-
hi tpr, maybe if you find the time it would be awesome if you could fix/report/pull request the issue with the flickering dropdowns in admin as well as you just fixed that at buttons. maybe it's the same issue? although i think that should be considered to be a bug and should not be something you need steroids for... maybe you can make an issue on github and talk to ryan what is the reason for it? thank you1 point
-
There's already a nginx topic somewhere here in the forums (I think in tutorials) with a possibly more elaborate nginx conf. Maybe you could take a look at this one.1 point
-
A multiselect will return an array, so most likely you will want to foreach through it - something like this: foreach($page->pagefieldname as $p) { echo $p->title . '<br />'; } There are lots of other ways to grab the data so tell us more about your needs and we can help further.1 point
-
This is exactly what I’m looking for. Plus, the ability to habe fix aspect ratios like 16:9, 4:3 oder 3:2 (in addition to fixed pixel sizes)1 point
-
Cheers, Dipping my toe into modules. I like the YOOtheme uikit framework (www.getuikit.com), among other things, for its modularity. However, conditional deployment can be a bit of a pain and documentation is not always clear on what to include, unless you check the available files. So i tried a module which helps with that. The module works but I'm still at amateur level and the code is certainly not up to standard so i will only post it here yet. So if someone feels this module might be useful to her/him, please take some minutes to improve and share your teachings. Happy to learn. https://github.com/alterkater/MarkupUikitLoader thanks!1 point
-
I know someone has to write this, so let it be me. The first time I realised what I could do with the ProcessWire API it was like an insane mode in mentioned Tesla Model S. But it was just the beginning as PW keeps accelerating me ever since. Of course there are rough edges, but I am sure there are some in Tesla too - you just have to own it a bit longer to discover them . This creation of yours, Ryan, is something that was a mind-changer and a life-changer for so many of us here and more around the globe. And it is not just cheaper and better, it is open source and the best you can get! Tesla team made a great job. So did you - alone. More people everywhere in the world are using PW now than probably ever will be using Tesla cars. So the impact not only on the future, but on the present is quite comparable (Tesla team just has to work harder to not fall behind too far). ProcessWire is equally fine crafted mixture of technology and design, as this electric car... But none of us have to give it back some day soon. But not only the technology is to be mentioned. ProcessWire is a community, open source and global. People from Africa use it alongside people from Europe and Americas. And they (actually we) come together every day to talk to each other about a topic of no envy and hatred, but a common love and perspective. The world seems to be so unstable and fragmented these days. At the place that I live I hear a lot of negative words aimed at US and its policy. Some of it might be true, some of it is an obvious propaganda. But without other channels of information and communication you can easily lose your own point of view. I am sure something similar is happening on the so called "other side". Here in community we overcome that way of thinking. You, Ryan, and the open source ProcessWire thing is doing better job for creating a world as a better place than NSA spying scandals and troops being brought to places abroad for sure. And your avatar is the most friendly face of America to be seen for many. I do not know if making one of the best pieces of software in the world for free and inspiring one of the most friendly and helpful international communities shall ever help you to buy a luxury electric car (I really hope so), but "at least" your children have something to be really proud about.1 point
-
Thank you Lost, I really wish I could give you some useful information on how we convinced EIZO to use ProcessWire. However the truth is the choice of CMS was never a requirement and was left completely up to us. Since last year when I first discovered ProcessWire, I've actually never had trouble selling it in. Mentioning it's much simpler to use and securer than competitors, that more is possible with the flexibility of ProcessWire than what is with other CMS, always helps. I've actually had one site which I converted from CraftCMS to ProcessWire due to the speed in which ProcessWire runs with ProCache. Really, ProcessWire sells itself.1 point
-
Also, added super simple ProcessSimpleAdminPage module to Intermediate modules – to show adding admin pages within a module.1 point
-
Ok been trying to take on everyones comments. In doing so I've split repos into beginner and intermediate. https://github.com/benbyford/PW-starter-modules/ https://github.com/benbyford/PW-intermediate-modules In doing so I can add to them with simple and more complex modules as and when I create them (and learn a new skill). The basic ones are currently super basic, so could probably do a couple more and then stop of crucial things to learn in modeul making. Any more suggestions welcome.1 point
-
I've updated the my modules replacing HotUserSwap with simple TextformatterFindReplace instead. I'm going to work on some field types next1 point
-
1 point
-
Hi Horst! Thanks for you code amends, will alter now. I totally agree with you, the third module not really beginner level and needs a heck load more work on it before anyone was to actually use it. The security aspect I'm looking at next and thanks for those links. Bar the first module, I was trying to make modules that didn't already exist that would be useful and interesting for me to make and had aspects I could teach. If you have any more suggestions for a third module whcih doesn't already exist then I'm all ears. Thanks,1 point
-
Sure – where I work at we did exactly that, and haven't looked back since. First of all, it's important to understand that at it's core ProcessWire is a (web) application framework. We prefer to call it a content management framework, but that's not very far from what most web applications do: they store, process, and output content. The way I see it, the main difference to so-called traditional frameworks is that modelling and handling data is a built-in feature, not something you have to reinvent on a case-by-case basis. I have rebuilt a couple of old projects from the scratch using ProcessWire, and in all of those cases this has saved me a lot of time and made most of the model layer obsolete. Before we started using ProcessWire we were doing sites with another CMS and custom applications with Zend Framework. At the beginning I had this idea that we would use ZF for "apps" and ProcessWire for "sites", but in just a few short months we realised that there just wasn't anything we could achieve with ZF that couldn't be done, usually with less work, with ProcessWire. Sure, sometimes we pull other libraries into the mix, but that's not a shortcoming; in my opinion it's just good design Regarding some of the things that have been mentioned here: One thing I was originally missing from Zend Framework was a clearly defined structure. Built-in "one file per template" concept is great for simple sites, but that's just about it. This is why I built the original version of my MVC project. It's not perfect, but it has served us well for years. To get most out of ProcessWire you really should be using it's data modelling abilities. Sure, you can still mock up your own data structures and write SQL to fetch content from the database etc. but that's kind of missing the point: ProcessWire makes data modelling a breeze and the selector engine is both flexible and secure. Some users prefer to build custom management panels, but in my opinion that's another thing you should try to avoid. ProcessWire's admin GUI is flexible and extendable (see Process modules), and again: in most moderately sized projects it can easily save you days of work. For routing you can use page URLs, but I'd also suggest looking into URL segments. For me, coming from the world of Zend Framework, templates are a lot like controllers and URL segments make it easy to implement the concept of actions Try not to invent your own access management system. ProcessWire has a very good implementation of RBAC already in place, and if you need more flexibility, I'd suggest looking into modules such as Dynamic Roles and/or User Groups. Rolling out your own solution is risky, tends to cost a lot, and just generally speaking is a very bad idea. Form validation has been mentioned twice here already. I don't have much insight into this, except that in the beginning we used to build forms using Zend Form, which has it's own validation built-in. That was always a bit tricky (not because of ProcessWire), and these days we use Form Builder for pretty much every form-related need. Sure, it's a commercial module, but it has saved us so much time that the price is absolutely not an issue. In my opinion the answer to your original question is yes and no: ProcessWire can't substitute an application framework because it is an application framework1 point
-
Joss, what's on config.php line 1? That's an unusual error to see there. I would guess that when the files were uploaded the encoding got changed somehow? Though double check that you don't have some whitespace prepended in your config.php file. Make sure the first thing in it is a <?php with nothing before it. But if everything looks normal, I would guess that when you uploaded the files something got changed. If they got FTP'd in as ascii, try putting them in as binary. Also, for a quick fix, turn off CSRF protection in your /site/config.php file: $config->protectCSRF = false; But i have a feeling that something might be up with the file encoding, which would cause other problems even if you get the CSRF one fixed.1 point