Leaderboard
Popular Content
Showing content with the highest reputation on 10/07/2015 in all areas
-
9 points
-
Place something alike in your init and user with role 'your-role' won't see Pages $this->addHookAfter('Page::viewable', function($event) { // 3 is the ID of Pages if ($event->object->id === 3 && $this->user->hasRole('your-role')) { $event->return = false; } }); ps, code is not tested...5 points
-
Yeah 50eu for a shopping cart system that doesn't take a cut on sales, and is totally extensible and customizable. I use it, and I am really excited about using it on a project.4 points
-
@adrianmak, Consider https://www.padloper.pw/ as it is beautiful and cheap4 points
-
3 points
-
Welcome to the forum Paschalis. This is not the usual way of getting repeater Items, but since you know the ID and repeaters are pages just like any other page, it's as easy as: $pages->get($repeater_id)->title3 points
-
I skipped millenium and vista, now happily using win 10 at home and win 7 at work. Both are excellent systems! I feel so lost when I have to try helping my mom to use her macbook air (good salesman told it is easier than windows...). I have never googled so much in so big frustration... Things just don't work2 points
-
It's kind of that way, but a page is always joining data, as each field's data is in a separate table, no matter how you build your structure. But regarding the structure. This isn't the most optimal approach. According to the tutorial it would be much more flexible to have the categories as pages (mostly the title, maybe with an description) and the translations as pages, with catergory (page field), german and english (both text fields). This way you can easily update both types of entities independent of each other. I'm not sure about the scale of your project, but repeaters aren't as efficient as normal pages and lack e.g. options like the hidden/published states, which is to keep in mind as a project might grow. If you need a nice listing of categories you could use pagetables on the categories or lister/listerpro lists.2 points
-
1) I found the problem and the solution. Processwire cannot read post_max_size if it is defined in bytes (see here). It sets it to 5M in that case instead. Define your php_ini variables as 100g, 50m, 1200k, but not as 104857600. 2) And I have not been able to redefine the value due to little typo: it had to be $f->maxFilesize instead of $f->maxFileSize.2 points
-
You could build upon https://github.com/Da-Fecto/CustomHomeRedirect. You could select a page in the configurable interface to redirect to. There's no support for that module however.2 points
-
I absolutely need a solid front-end user system solution. Of the 20+ PW sites I've built, 2 have required extensive front-end user systems and I've had to kludge together crazy solutions built from bits and pieces of code strewn throughout this forum. It's hack, bad and just waiting to fall apart. PW is such an awesome solid system and it makes me sad that it's so let down by this one critical area. Almost all other major CMS/CMF's ship with some decent front-end user management. I would easily pay $100 for an up-to-date decent system. Or $30 with a yearly subscription like Ryan's other modules. Ryan could probably bang this out in one night (haha ok I'm kidding, but I'm sure he could do it easy enough). Ryan please! There's a desperate need for this. The existing half-implemented modules and bits of code are NOT a solution at all! Please save me from having to use ModX again just because of front-end user management.2 points
-
Hi matjazp A late answer to your question. I came across the same issue as you. I wanted to set the width attribute of my images to 1280. But what I found was that CKEditor has a maximum allowable value for the width attribute. And that maximum value is 1200 pixels. If you go to: wire/modules/Markup/MarkupHTMLPurifier/htmlpurifier/standalone/HTMLPurifier/ConfigSchema/schema.ser There look for this bit... "HTML.MaxImgLength";i:1200 Change 1200 to your desired maximum value. Worked for me at least! Hope that helps Regards Zahari M.2 points
-
OK it didn't work this way but I find this https://processwire.com/talk/topic/2089-create-simple-forms-using-api/ And https://processwire.com/talk/topic/4788-creating-pages-via-api-but-show-error-when-duplicate/ test and working great $out = ''; $form = $modules->get("InputfieldForm"); $form->action = "./"; $form->method = "post"; $form->attr("id+name",'family-form'); $field = $modules->get("InputfieldText"); $field->label = "Name 1"; $field->attr('id+name','family_firstname'); $field->required = 1; $form->append($field); // append the field $field = $modules->get("InputfieldText"); $field->label = "Name 2"; $field->attr('id+name','family_secondname'); $field->required = 1; $form->append($field); // append the field $submit = $modules->get("InputfieldSubmit"); $submit->attr("value","Subscribe"); $submit->attr("id+name","submit"); $form->append($submit); if($input->post->submit) { $form->processInput($input->post); if($form->getErrors()) { $out .= $form->render(); }else{ $p = new Page(); $p->template = 'family-form'; $p->parent = wire('pages')->get('/family/'); $p->name = date('y-m-d-H-i-s-u'); $p->title = $form->get("family_firstname")->value." - ".$form->get("family_secondname")->value; $p->family_firstname = $form->get("family_firstname")->value; $p->family_secondname = $form->get("family_secondname")->value; $p->save(); $out .= "<p>You submission was completed! Thanks for your time."; } } else { // render out form without processing $out .= $form->render(); } echo $out; very beautiful2 points
-
Google today announced it's competitor to Facebooks "Instant Articles": "AMP"(Accelerared Mobile Pages)HTML. Based on open source technologies (Basically it's a set of Web Components and a JS-Framework that loads and caches resources) it seems very promising. As far as I understand media is cached, served and proxied by google (and some tech partners). Btw: processwire as a system could benefit from/partner with it, too: https://www.ampproject.org/faq/#accelerated-mobile-pages-9 I'm really looking forward to playing around with it. Anyone else already fired up his editor and started fiddling around?1 point
-
Not a module, just a little function for applying effects to images if you have the Imagick PHP extension installed. This started out as a need to blur an image and then I expanded it to accept more of the Imagick methods. Not all Imagick methods are supported. The function takes the URL to a source image, the name of an Imagick method and an array of arguments for that method, and returns the URL to the processed image. The processed image is saved to same directory as the source image, with the method name and arguments appended to the name of the source image. Images are cached in that the function checks if an image with that name/method/arguments exists already to save recreating it on every page load. function imagickal($imagePath, $method, array $arguments) { $path_parts = pathinfo($imagePath); $dirname = $path_parts['dirname'] . '/'; $filename = $path_parts['filename']; $mod = $method . '-' . implode($arguments, '-'); $mod = wire('sanitizer')->filename($mod, true); $savename = $dirname . $filename . '_' . $mod . '.jpg'; if (!file_exists($_SERVER['DOCUMENT_ROOT'] . $savename)) { $image = new Imagick($_SERVER['DOCUMENT_ROOT'] . $imagePath); call_user_func_array([$image, $method], $arguments); $image->writeImage($_SERVER['DOCUMENT_ROOT'] . $savename); } return $savename; } I'm a PHP novice so happy to receive suggestions of how this could be improved. Imagick reference: http://php.net/manual/en/class.imagick.php Examples of some effects possibilities...1 point
-
I'd love to see the next Pro module provide an easy way for front end visitors to register an account and edit their profile.1 point
-
Greetings, Is it just me, or did Microsoft just kick Apple's ass today? Thanks, Matthew1 point
-
1 point
-
Just using a variation of this and, although I'm importing a large amount of posts and pages (pages was quite interesting - not a lot of changes required to import the tree structure as well! ) I do still of course have to go through and check all the pages just in case. This has been a huge help - thanks Ryan!1 point
-
yes, good point... would be keen to see it. Mostly though, i never seem to be able to use stock systems, because the business logic is hard to encapsulate into one system, which is why if you build this with PW backend, then you are really tailoring it for specific use; I also say this because i just alighted from a 200+ hr asp.net project (where my part was only a fraction of the total labor) in building a custom app, and never a day went by when i observed how so many of the things we needed to constantly build and rebuild and fix could have been handled simply by pw admin;1 point
-
A textformatter works on text, as the name suggests, and not on images. It should work like that: $img_markup_srcset = $modules->get("TextformatterSrcset")->formatValue(new Page(), new Field(), "<img src='…' />");1 point
-
1 point
-
Sorry about that - accidential input appeared on that line when attempting a grep. Issue has been resolved - please replace Jumplinks.module with the one from Github.1 point
-
No response to my private message here in the forum. @Macrura Maybe, but templates and styling is done and if all works fine why it should be build from scratch? With a purchased licence or if it will be provided as open source we could upgrade it.1 point
-
Off Canvas in Foundation is not really half-assed, but rather a mediocre compromise. I've yet to find any off canvas solution which works well in every situation (without js).1 point
-
The reason I mention structured data is because in ProcessWire it's fairly simple to use that to import pages.1 point
-
I suppose... Data structure is fairly straightforward (at least, it is in my opinion). 4 different org types, each in their own subfolder/template. One type of individuals (aren't we all just the same ) I'll have a look at how it registers in the mysql, might see if i can make heads and tales of it from there. And that side note: As i haven't updated my FB Profle pic in 6 years... i don't see me putting an avatar on anytime soon. (als je begrijpt wat ik bedoel (en ik mis die olie b bommel film))1 point
-
Depend on how you have your data. When you have your data structured some how, you could write a script to do it for you. side note: It's scary to have no avatar, someone will come up with one when you aren't quick enough:-)1 point
-
I had to uncomment the middle rewrite_base shown in .htaccess using xampp on windows 10. Yours appears to have an emedded space in the alias/directory name, maybe that's causing the rewrite to fail for you? Just guessing, but I'd try renaming the site alias without any space, and editing your .htaccess accordingly.1 point
-
The instant search is blazing fast . Could you mind share the techniques behind the scene ?1 point
-
YOU SAVED MY LIFE TONIGHT... works if i changed from "AUTO" to "SINGLE ELEMENT".....seems to be a issue with 2.6.19. I know it's alpha state but it works on all my other instances and servers just this problem is caused by the dev version of PW! Thank you again - now i can go sleep1 point
-
From your post it sounds to me like you are talking about migrating content from one PW site to another - is that correct? If so, it should simply be a matter of migrating template files and the DB. If however, you are talking about migrating a WP site to PW, we do have a migration tool: https://github.com/NicoKnoll/MigratorWordpress1 point
-
Two WiP images: I planned to add only auto-optimize. But if you don't start using the module when starting the development then many images will remain unoptimized, requiring manual optimization. So there's a bulk optimize feature which works, though it can be really slow. I may take the effort and add a "stop" button but I don't want to overcomplicate this thing. Currently it overwrites original files, which is dangerous, I know. Should it create a backup of the images? Any suggestions on how? I also plan to add an exclude (or include?) list feature, just to make sure. Which one would you recommend (if any)?1 point
-
Looks nice, and search seems incredible fast. Do you use caching for the search queries?1 point
-
You seem to have a $page->template = 'something' in your template.1 point
-
Incidentally, when I set out to achieve a blurred image effect I initially thought I would do it client-side. Each client-side option I tried had issues: CSS filter - not supported in IE SVG filter - blur effect noticeably less smooth JS stackblur plugins - difficult to use as a CSS background image supporting background position and background size properties In the end it was so much easier to do it server-side, and browser support is 100%. Edit: for those interested in client-side image manipulation, CamanJS is pretty cool. It's an absolute breeze to use on inline images using the "data-caman" attribute, just a bit of a hassle to use it for CSS backgrounds.1 point
-
this piece from adobe...is some sort of mini photoshop on every webapp working (even simple websites) https://www.aviary.com/ https://developers.aviary.com/docs/web it is used within this imagemanager plugin for CKE/Tiny/HTML and looks great for such fast/little image edits. http://www.responsivefilemanager.com/ (It's on the third slide i think) and this module i've tested sometimes ago and works even great, too https://processwire.com/talk/topic/1703-pixlreditor/ This are all only solutions where the user/editor has the role to use them - your snippet provide the force to preset effects by the admin/developer...so everything has it's own benefits. regards mr-fan1 point
-
1 point
-
Number 15. Above the symfony author. http://www.cloudways.com/blog/php-influencers-to-follow/1 point
-
The default installation profile of processwire does include a _func.php with an renderNav() function. I suggest taking a look at that one, as it does create that exact structure.1 point
-
That would be the reason then - I'll let Ryan know that the logic is going to need to be changed to handle these special DB tables.1 point
-
I found that table 'field_comments_votes' (created by FieldtypeComments module) has no 'pages_id' column.1 point
-
Is there any update on the matter, using the module on not just body images? Unfortunately I can't get the somas method working.1 point
-
I'm sorry I was under the impression I couldn't select time, only days, with SchedulePages. After your comment I double checked and well... problem solved. I guess I'm ready to go (and ditch WP) Thank you.1 point
-
Here's how it worked for me in CKEditor (in case you persist on this route - but I would go for Hanna Code as Adrian suggested. As usual, the "culprit" is our friend HTML Purifier (read from here up to and including Ryan's comment here about its pros and cons before deciding whether to implement #5 below!) For iframes, the Extra allowed content seems to have no effect - btw, the correct syntax here is for example, div(*) not div[*] Add 'Iframe' (note the spelling) to your CKEditor Toolbar Leave ACF on No need to switch the field's "Content Type" from "Markup/HTML" to "Unknown" Turn HTML Purifier off (gasp! ) Enjoy your embedded video1 point
-
I think you understood Soma but he will speak for himself. As for my bit, have a look at my ProcessBlog module. I use both ___execute() and wire('input')->urlSegment1 (your $this....etc). ___execute(), in a sense, gives you 'virtual pages view'. They don't really exist but are created on the fly on view (if that makes sense). In my case (in Blog), in the method blogMenu(), I use urlSegment1 to set the css class for the active ___execute() page, i.e. what the user is currently viewing. It's basically grabbing a 'GET' query string (in a loose sense)...Otherwise, there was no other way to know what the active page was given that they don't actually exist. ... So, if you want a viewable 'page' in your ProcessModule, use ___executeSomething()...urlSegment1 just gives you the 'name' (something) of that virtual page... my 2p...1 point
-
For your first scenario I can't quite see what the big benefit of session would be, though that depends on the structure of your page and the way you build this thing in the first place. Some possible solutions I'd consider: If the edit view opened in modal box is an external page (not part of this page or put together on the fly) then you'll have to somehow let it know what it is that you want to edit.. and in that case I'd rather provide it with page ID and field ID (or name) as GET params. If the edit view is generated and filled out on the fly (and submitted by AJAX, I'd assume) you can just grab the content from page using JS without the need to store anything in session variables. In your second scenario I'd also consider using GET params (specify comment ID to quote from) or storing either the comment ID or even the whole quoted text (unless you really need to support storing *a lot* of data) in JS cookie. This is an example of situation where you probably don't need to make sure that quoted text is somehow protected (in most cases user can edit it upon posting anyway), so storing that data in session provides very little extra value. -- Considering sessions vs. other methods of storing run-time data in general: Biggest reason I tend to avoid sessions is that as the amount of data stored in session grows in size, so do the memory requirements (and, in extreme cases, also the disk space requirements) of your site. At least some PHP versions load whole session data to memory when session is started, so you can imagine what having tens of kilobytes, hundreds of kilobytes or even megabytes of data (a worst case scenario, but still) does on a site with a lot of simultaneous users. With sessions you'll also want to make sure that you're cleaning stored session files properly (which, by the way, isn't always as trivial as it may sound) and preferably clearing stored values run-time too, especially if you're storing a lot of content. GET params, on the other hand, don't consume any extra memory.. and storing stuff in JS cookies only consumes client resources. As for why one would prefer to use sessions, biggest benefits are that a) session variables make it possible to "hide" the mechanism behind this all from the user and b) session data is much harder (practically impossible, unless you've made it possible yourself) to tamper with (it's easy to try out different values for GET params or alter data stored in JS cookies). Ease of use is a very real benefit too, of course. Storing data in session variables is often the least painful route. Tradeoffs, tradeoffs.. but then again, isn't that what web / software development is always about?1 point
-
I suppose this is down to scalability in the end. If you have a very clear idea what you need and how much power you want, then a dedicated machine might prove a very controllable option. If however, you may want to increase scalability, then a VPS or cloud solution may give more versatility, both in price and power. Although things like Amazon can be pricey, I like the idea that you can scale DOWN as well as up! Also, there is the clients' needs (business-wise rather than technical). If they have no need for a dedicated server for themselves as such, then they may or may not be happy being tied into a developers machine; if the relationship goes sour, it gets very, very complicated. I look at this from the point of view of buying a car from a dealer. When you buy, it makes sense to take advantage of the dealers servicing options and so on. But you can choose to make that a contractual relationship or a casual one - if you just tend to use them out of habit rather than because you have welded yourself to them, when they mess up you can simply go somewhere else; you don't have to first of all get the car and the car keys back from them. In my main business (music production and writing), clients use me because they like me, not because they are contractually or technically bound to me. If I tried that, then they would go elsewhere pretty damned quick! I think at least part of the IT world has got itself into a mess because it has tried to enforce client loyalty rather than keep the client by offering good services and building a good relationship.1 point
-
You can always reset your password just by pasting this temporarily into any one of your templates, and then viewing a page that uses the template: $u = $users->get('admin'); // or whatever your username is $u->of(false); $u->pass = 'your-new-password'; $u->save();1 point
-
You could also do this in your homepage template: echo $pages->get('/path/to/page/')->render();1 point