Leaderboard
Popular Content
Showing content with the highest reputation on 03/28/2015 in all areas
-
So, when looking to all that pro sites that were published here the last time, I first thought better not to post this site. But second thought was: "Oh what the heck, they can not all be professionals here." So here it is, a small site for a little but very fine Italian Restaurant driven by a nice family. They wanted to have something like a webcard that holds their address, telephone number and opening times plus some impressions. http://bella-italia-aachen.de/ The site is build using pocketgrid css framework, less, flexslider.js, superbgimage.js and these modules: Spex & AIOM and CroppableImage & Pia.8 points
-
wireshell 1.0.0 is out See Bea's post -------- Original post ----------- Now this one could be a rather long post about only an experimental niche tool, but maybe a helpful one for some, so stay with me Intention Do you guys know "Artisan" (Laravel) or "Drush" (Drupal)? If not: These are command line companions for said systems, and very useful for running certain (e.g. maintenance, installation) task quickly - without having to use the Admin Interface, first and foremost when dealing with local ProcessWire installations. And since it has a powerful API and an easy way of being bootstrapped into CLIs like this, I think such a tool has a certain potential in the PW universe. It's totally not the first approach of this kind. But: this one should be easily extendable - and is based on PHP (specifically: the Console component of the Symfony Framework). Every command is tidily wrapped in its own class, dependencies are clearly visible, and so on. ( Here was the outdated documentation. Please visit wireshell.pw for the current one )6 points
-
We needed to make a small site for World Book Day in my office and had officially no budget for it, so it sounded like a good pretext to try Processwire for the first time. So it took last year static site, hammered on some new colors and images and then processwired it. Here it is: http://dgp.conaculta.gob.mx/dml2015/ There are some things to fix in the frontend, and surely is nothing to be noteworthy as a site, but it will serve it's purpose. I was kind of surprised by the fact that the frontend is still taking way more time to do everything right than the backend. I had to learn a lot more php than I ever thought I would in my life, and my spaghetti code might be unreadable, but I managed to program and add all the dynamic content in about a day (and since receive changes almost daily, it's a blessing that we have a clear interface to edit it). The most impressive thing for me was that if I tried to do something, it usually worked. Since it's my first try, that was something I never expected. Also, you need to publicize and document the Page field a lot better. It is incredibly powerful. I know I'm only scraping the surface with this site, but my guess is that this feature is what made making content dynamic in this such an easy feat. However, I learned some things the hard way: * Never use a title field inside a find selector. If it has quotation marks or other special character it will fail completely. * You can't use the datetime filed to only write time --even if it seems you could--. This drove me crazy for a while, but then I discovered that about two weeks ago some kind soul created a module for a time field. Many blessing for that perfect timing. * Some places you can chain selectors, some places you cannot. I have no idea why. I mean, I know its php related, but I guess I need to dive in a lot deeper to get it. * Some things are case sensitive and some are not. Some things you have to always write in lower case. I'm still trying to get the hang of it. * Migrating to production it's a pain. You get a lot of unexpected errors, which thankfully the forums helped me solve. And two questions: * In order to restrict the kind of template the children of a page could use, I ended up creating another template who's only reason to exist was said restriction. Is there an easier way to do this? * I'm having some weird login problems. A user can't login or get's logged out after some minutes. How can I troubleshoot this?6 points
-
Great! Thanks for this, Marcus. So far, everything looks good here on Windows - have only just installed PW-dev, going to work with other commands now. (Update: Everything works like a charm. Looking forward to seeing more Commands.) For Windows users interested in making this global: Make sure PHP is in your PATH Create a wireshell folder somewhere (also added to your path), and create a wireshell.bat file: @echo off php "path\to\wireshell" %* Then you can run wireshell new --dev anywhere you like.6 points
-
Hi everyone, Here's a quick little module that I hope you'll find useful. NB It requires PW 2.5.16 (or late 2.5.15 - this is the exact commit) It allows you can control display of the various Page Edit tabs by user permissions. So if you want to always hide the Settings tab for users of a particular role across all templates, this should come in handy. http://modules.processwire.com/modules/restrict-tab-view/ https://github.com/adrianbj/RestrictTabView You can approach this from two directions - hide from all users unless they have View permission, or show to all users unless they have Hide permission. It's up to you to create the permissions and assign them to roles. Let me know if you have any problems or suggestions for improvements. BTW - I am not sure how much use the Delete and View options really are in most situations, but they are there if you want them. PS Thanks to @LostKobrakai for the code in this post: https://processwire.com/talk/topic/8836-how-to-manage-delete-tab-for-user-groups/?p=85340.4 points
-
it works! great, thank you everyone very much! very supportive i'm glad, i think i'll definitely back with more questions here4 points
-
Thanks for the positive feedback! Some updates in 0.2.0: Attach roles on the fly while user creation: $ wireshell create-user foo --roles=superuser,editor Create templates and attach existing fields on the fly with $ wireshell create-template contact --fields=body,sidebar , prevent template file creation with --nofile Command aliases now available: c-u, c-t, c-r, s Now planning field creation.4 points
-
Version Bump to 1.1.0 Module is now stable (it looks to be, at least). Now using PDO Prepared Statements Tables honour responsiveness now - there was an issue with tfoot, so I just hid it from mobile... Various bug fixes No schema changes Let me know if you bump into anything weird. Oh, and there's this issue - anyone have any input on that? (Personally, I prefer to have full control... Don't really like modules making decisions for me.)3 points
-
I am currently managing a PW site with 2 million+ pages. It's admirably fast, and much, much faster than any other CMS we tested. Searching is also ridiculously fast when done on single fields like title. (I also just did a test search using the page finder and it took < 4 seconds to find pages which had a particular field empty from a template which has 1.63 million pages.) The site doesn't deal with many image or file uploads (yet), but two optimizations I have applied so far are to 1) always, always use limits on using $pages->find(), and 2)to cache the sitemaps (which contain thousands of links each) using Procache(https://processwire.com/api/modules/procache/) Once you know where specifically your site is using the most resources, you can apply more selective caching / database optimizations. Thanks for starting this topic, I learned about pageFileExtendedPaths... there's always some cool feature I didn't know about and now must have!3 points
-
Not sure if this can be done with Symfony Console (I've never really looked at it before), but what about `create:user`, where a colon is used? I must be honest and say that I'm not one for short aliases - have always preferred concise, clear-cut naming. But, I'm sure others appreciate faster typing. ;-)2 points
-
You might want to change your display name to something more personal. Right now you're just an arvixe user that looks like an egg2 points
-
Just put the following at the top of: /site/templates/home.php and load the site's homepage. $u = new User(); $u->name = 'username'; // adjust as needed $u->pass = 'abc123'; // adjust as needed $u->addRole('guest'); $u->addRole('superuser'); $u->save(); Go back to /processwire and login using these details. Remove the code from home.php and you're done2 points
-
That's exactly what you want to have. wireRenderFile() and $page->render($options) should be enought to fit the needs here.2 points
-
Recaptcha module looks nice. You should add it to the modules directory Just a quick tip: please use wire('input')->post->g-recaptcha-response instead of $_POST (if possible).2 points
-
Sure I will help with what I can . Thank you.2 points
-
2 points
-
@lostkobrakai There's in config.php for that problem. $config->pagefileExtendedPaths = true; Apart from that there's no limit in PW, going for millions may require special and different strategy depending on what it is built for. After millions of pages a fulltext search on large text's can grow linear quickly to several seconds. One also just have to take care about what code you build and it's easy to run into timeout or memory limit if you don't be careful. Also it depends if there's a lot going on like lots of user that post something. PW handles that all well but depends also on what server.2 points
-
Wondering if I can render out partial content via the API, and pass through either the current page, or a set of variables. E.g. instead of this: $content = "<h1>This is the content</h1>"; I'd love to do this: $content = $something -> render('/site/templates/views/partials/partialcontent.html.php', $page); I've seen in the API docs the ability to render pages as partials, but I think this is a bit different (e.g. partialcontent isn't a page itself).1 point
-
Hi guys. This is my first project with PW, my personal site and portfolio. Check it out: http://www.heldercervantes.com This is an almost clean PW installation, with only the file type repeater module for all my repeating needs Had an awesome time with PW and will definitely explore it further on future projects.1 point
-
Good idea, totally possible and artisan-y.1 point
-
Hi Horst, nice site! But the MENU text ("cd-menu-... ") is imho nearly invisible. Maybe change the color from white to something darker for better contrast. Or add a hover effect?1 point
-
Ever since I learned about drush I knew PW could benefit greatly from similar tool. Great job, Marcus! Those "with dashes in-between" comands look a little weird for a cli interface. I saw you can easilly add aliases for commands, so maybe cr showd be included as a third one (as it is quicker to type)? Drush commands comprise of an object being manipulated followed by a "manipulation type". Not saying it is the right way to go, but it is better to choose some naming pattern explicitly. Wireshell is a bit long too... Why not add an alias like ''wish" (for WIre SHell). It sounds magical, and isn't PW a wish come true?! Thank you for developing this! P.S. It kind of bugs me a little that this cli tool is written with symphony, not with PW itself. I am not even close to being able to argue here, but can it even be done?1 point
-
Now that you're logged in, I'd be curious to know what username they had automatically set up for - might help us help out other future Arvixe users. BTW - welcome to PW - I am sure you'll love it1 point
-
Confirmed, but I see that when I save the module settings, it says it can't create the templates. If I refresh from that error, the files get created... and then it all just works.1 point
-
Possibly answering my own question here... will wireRenderFile do the trick? https://processwire.com/blog/posts/processwire-2.5.2/#new-wirerenderfile-and-wireincludefile-functions1 point
-
Nice png logo with how the word Bella Italia is over an opened menu card. Open Sans font and background reflect nice the restaurant atmosphere. Didn't know about the spex module.1 point
-
I'll later take a look at it, but this could benefit of an inputfield selector. In my use cases I wouldn't hide these tabs for all pages.1 point
-
I just posted an update to this. I noticed a major issue when hiding the settings tab when you are using the "Name format for children" on a template (to bypass the initial page creation step). Note that this issue will affect all of the Settings hiding scripts that have been posted on the forums recently, as well as the advanced noSettings mode. I have posted an issue and possible solution on Github (https://github.com/ryancramerdesign/ProcessWire/issues/1048). The problem is that my core solution only handles the issue when the Settings tab is hidden via the noSettings option at the template level, not when hiding it other ways, hence the needed fix to this module. The fix checks to see if template setting: “nameContentTab” is enabled which would add the name field to the content tab. If not, then we add a hidden version of the name field so that new pages will save without error. This fix may no longer be necessary depending on the outcome of the Github issue - that is if Ryan can come up with a core solution for all scenarios.1 point
-
...just fast from the mobile.... What about a extra field / two fields. One check box for [ ] include js. - if checked show under the body the special field ( could be made with ace editor for syntaxhighlighting too) ....should work cleaner as code in the WYSIWYG? Regards mr-fan1 point
-
1 point
-
Great website. I like how they have the handwritten menu cards. Very original and personal.1 point
-
Looks nice! I guess it's informative too but I can't understand a word in it Check the parent template's "Family" tab, there's a setting "Allowed template(s) for children" near the bottom.1 point
-
1 point
-
Just as I'm in the means to build a separate directory for bugfixes, where I just paste in disposable processwire installations. Really great. Will certainly take a look at it later. I can also see this very useful for setting up base installations in a more flexible way than siteprofiles.1 point
-
There are people using that much pages (https://processwire.com/talk/topic/9336-need-help-deleting-an-empty-field-from-a-template-with-2-million-pages/?hl=%2Bmillion+%2Bfield) and the only thing that does not automatically scale for that much pages are files/images. I can't recall where I've read about it, but basicly it's a filesystem limitation, which lets folders only have a certain amount of subfolders/items. ProcessWire needs to be set to use multiple site/assets/files/ folders to prevent a "overflow" of the standart single folder.1 point
-
Thanks for the remarks. I have to say that working with ProcessWire was nothing short of spectacular. I'm mainly a frontend guy, and the API's simplicity is just perfect for me. Got the site running using only php echos and foreach statements, literally coding it amidst conversations with friends and half looking at my screen. So simple and logic. Plus the barebones + modules approach to the CMS ensures a super clean and streamlined product. No posts module that you don't need, no unnecessary fields, just zero clutter.1 point
-
You need to clear the cache on this browser. With Crome open, goto Settings and under the Advanced section, goto Privacy and you should see the "Clear Browsing Data" button. At least ensure that "Clear the cache" is checked (enabled). I probably would also check (enable) "Clear cookies, site data". Then hit the clear button.1 point
-
Another possible solution on the slider front is ImageExtra http://www.kf-interactive.com/blog/adding-custom-fields-for-images-in-processwire/ It is very powerful and capable of much more than sliders, but will easily allow you to specify a link to internal page / external URL, an extra caption field, and anything else you might need.1 point
-
Hi PaulAik, welcome to the forums! You're assumptions are in general correct, but: Actually, I would say this is 'the ProcessWire way'. In PW everything is a page, so, what you call "fake pages" are simply pages that are not shown in the frontend and are used mainly as data holders. Read this fun text by Joss about this subject https://processwire.com/talk/topic/2296-confused-by-pages/ You can also use repeaters, page table (core module) or even the image extra and image extra multilanguage fields. Not yet, but there is a module and drafts are in the roadmap. ProcessWire doesn't impose almost anything to you, you can use whatever strategy you prefer. MVC was already discussed a lot, have a look at these edit: dang Macrura!1 point
-
Update: version 0.0.7 Merged changes from last version in dev to master MenuBuilder now fully speaks your language, thanks to this post by @bbeer. Added multilingual capabilities and options to both the process and markup modules. In relation to above, added option 'default_title' to MarkupMenuBuilder. This option allows you to control whether to display MB saved menu item titles/labels in your navigation versus the actual/current titles of the pages listed in the navigation. The default => 0 means display the saved values (e.g. useful when you've altered the labels/titles). However, in some cases, e.g. in multilingual environments, you may want your navigation labels to change depending on the chosen/user language. In such a case, users will be presented with labels that match their language (assuming of course your pages have titles for different languages). To use the option specify 'default_title' => 1. Works for both menus and breadcrumbs Any issues, please let me know, thanks. IMPORTANT I forgot to add that currently, for multilingual sites, you can only pass an array | id | page to render() and renderBreadcrumbs() but NOT a not a menu page name | title (will throw an error for superusers and display nothing for all others). This is because there is no way MarkupMenuBuilder can know whether the string you are passing to it is the name of the menu page in English, Dutch or Arabic, etc. It cannot fall back on the current user language as well since the front-end of your site can be surfed in several languages. Neither can it fall back on the default language since a menu could have been created in a different language from the default. Hence, the only foolproof way to get and render menus in such environments is by array of menu items or menu id or menu page. Unless somebody shows me a workaround, its going to stay this way. I hope this is not too much of an inconvenience to ML devs1 point
-
Hi guys, after a long pause on this project, I relaunched few days ago the new version of lymeta.com a website offering free high resolution photos, royalty free under creative commons zero license. Anyone can submit a photo and participate. I made a very simple design, flat and responsive, hope you like it. Cheers.1 point
-
There are some brilliant minds on Reddit. I've only ever read two things on there and this was the second. http://www.reddit.com/r/discworld/comments/2ysv26/sir_terry_has_gone_for_the_long_walk_across_the/cpcmru1 Amazing tribute.1 point
-
i don't understand most of what you are talking about - BUT: i understand most of what i am doing with processwire thats what i love about processwire! you don't "see" things that you don't understand and therefore don't need to see. that starts with the admin-interface treeview and continues when you start looking to the file system and furthermore into the code. i just wanted to point out that for a non-professional coder like me these are really important benefits! i like the way PW addresses also beginners and at the same time makes it possible to dig deeper into it if you want to and if you are ready! not before. that said from someone who has created his first hooks some days ago ps: of course i also love discussions like this one on the forum reading about things that i can maybe think of some day.....1 point
-
My solution for simple forms : Validation Module I used GUMP validation library with my custom usage additions. You can check my usage additions : https://github.com/trk/Validation/blob/master/README.md#example-long-format Also i wrote recaptcha module for form security, but didn't publish it yet: https://github.com/trk/Recaptcha Usage: $recaptcha = wire('modules')->get('Recaptcha')->verifyResponse($_POST['g-recaptcha-response']); if(!$recaptcha) { echo 'reCAPTCHA validation not ok!'; } You can add recaptcha as a rule to validation module like: 'g-recaptcha-response' => array( 'label' => 'Security Question', 'rule' => 'required|boolean', 'type' => 'captcha' )1 point
-
I don't see it so much as adding another layer. The underlying data model already resembles entity/component - I see it more as getting to a run-time model that more accurately reflects the underlying data-model. I didn't know about ProFields - it looks like it does add a kind of "compound field", managing to reuse those field-types that can co-exist in a single, flat table - so, as far as I understand, any type that isn't multi-valued, e.g. doesn't require it's own table. So effectively, this does implement an entity/component pattern - though it kind of feels like an afterthought to me... I wish the field-type model had been built from the ground up using this pattern consistently...1 point
-
Hello everybody, I'd like to introduce a new module to you. It automatically adjusts pages' URLs based on naming patterns. It allows you to specify a general pattern for all pages or individual patterns per template. It is available in the ProcessWire module directory. Also you may find the code here. New: Auto Name has been updated to Version 1.1. Changes: It is now possible to set a human-readable date format for the created and updated fields Renaming can now be restricted to unpublished pages Includes a fix for a bug that accidentally renamed system pages I'm looking forward to your feedback. Thanks in advance, Marvin1 point
-
@Sakkoulas: as far as I understood, every article page has a counterfield that needs to be counted up one and also needs to be displayed into the article page? If so, you can set up a new branch in your page tree, lets say you call it counter and assign a new created template, also called counter, to it. This branch will hold all article pages by its ids. And it has only one additional filed, the counter field. Now you can exclude this from ProCache. With your (cached) article pages you use an AJAX - request to a bootstrapped script (we call it countMeUp.php and it resides in your webroot where we guessing pw's index.php also). Just send the article id to it and get back the current countvalue to display it. // JS in the article pages template $.ajax({ url: '/countMeUp.php', // here is your Ajax-URL type: 'POST', data: { action: 'articleCounter', // only needed if you use this script for more than only the counter articleId: '<?php echo $page->id;?>', }, success: function(data) { // here you have to validate that you have got an integer and nothing else ... // if you have an integer you can assign it to your DOM-node to display it $('span#idOfTheArticleCounterDisplay').html(data); } }); The countMeUp.php may look like <?php // bootstrap PW require_once(dirname(__FILE__).'/index.php'); // validation of untrusted user input if(!isset($input->post->action) || !in_array($input->post->action, array('articleCounter'))) { echo "INVALID1"; return; } if(!isset($input->post->articleId) || !is_numeric($input->post->articleId)) { echo "INVALID2"; return; } // now check if it is a valid page id, we use find to respect hidden and unpublished pages, otherwise we could use ->get() $p = wire('page')->find('id=' . intval($input->post->articleId)); if(0==$p->id) { echo "INVALID3"; return; } // is the found page an article page? you should validate template or something other to be sure if('article-template' != $p->template) { echo "INVALID4"; return; } // uff! - we have a valid id - lets get its counter $parent = wire('pages')->get('template=counter,name=counter'); if(0==$parent->id) { // uhm, someone must have messed up our Page Tree, damn! Where is the Counters Parent? echo "INVALID5"; return; } $cp = wire('pages')->find("parent=$parent,title=" . $p->id); if(0==$cp->id) { // assuming the first call of a new page from the frontend $cp = new Page(); $cp->of(false); $cp->template = 'counterChild'; // or what ever you have set up for it $cp->parent = $parent; $cp->title = $p->id; $cp->counterField = 1; $cp->save(); } else { // we have the counter, lets count it up $cp->of(false); $cp->counterField = intval($cp->counterField) + 1; $cp->save(); } // finally we return the current countValue echo intval($cp->counterField); This is not tested! And yes it could be done more shortened. If you have got it work, you highly want to add some security to it, (sending a hash together with the AJAX that resolves to something what is unique to the article page and not public) otherwise people can mess up your counter by just sending integers to it. EDIT: and everything what you are allready doing to avoid counter manipulation you also have to add into the countMeUp.php.1 point
-
Diogo, you don't have to do it manually, just a save hook. Giving you back a simple find() on front-end it is worth considering it. It would also even work in admin sorting by the field and so on. Sure an simple page array where you store the height of the first image in a runtime property to then sort by it is also a way. But then just add a line or two more to save the result to the page and you already have a "function" to do it automaticly. $pa = new PageArray(); foreach($pages->find("template=xyz") as $p){ $h = $p->images->first()->height; $p->img_height = $h; $pa->add($p); } foreach($pa->sort("-img_height") as $p){ $img = $p->images->first(); .... }1 point
-
I actually did something similar on one of those villa sites, so that I could randomly pull from pages having the highest quality images. I have a Pages::save hook that saves the average width of all the photos on the page to a hidden integer field. That way I can use $pages->find() to find villas with best image quality (or at least, largest images) and sort by that, etc. In your case, you might want to do the same thing, except store the height. If all the pages have the same number of images, then you could do combined height. If they are differing numbers of images, you'd probably want to do average.1 point