Leaderboard
Popular Content
Showing content with the highest reputation on 10/28/2012 in all areas
-
Warning: Still a work-in-progress. Still has quite a lot to be done. At Tom Reno's request I started work on a module that allows you to setup various watches on fields in your PW installation. You get to choose a field and can then specify when a change to the watched field should trigger a notification email to various interested parties. Pictures might help, so here we go... I intend adding a further restriction so fields in certain templates can be watched.4 points
-
In a autoload module you could hook the page render and replace all img tags. public function init() { $this->addHookAfter('Page::render', $this, 'hookPageRender'); } public function hookPageRender(HookEvent $event) { $out = $event->return; if(strpos($_SERVER['REQUEST_URI'],$this->config->urls->admin) === 0 ) return; $img_regex = '%(<img.*/>|</img>)%ixU'; $event->return = preg_replace($img_regex, "<div class='img'>$1</div>", $out); } If you want to only replace certain images in the body you could use some markers or a html parser like php simple html dom http://simplehtmldom.sourceforge.net/3 points
-
I just setup a complete new install with this module, and it also didn't work with pagination. I only enabled urlSegments to the proxy template (as in manual) and as soon as I enabled page numbers also it started working again. Can you check if you have url segements and page numbers enabled on the language proxy template. Works all fine here.2 points
-
Solved. Thanks for the replies. It had indeed to do with css. I use the Blueprint css for templates (generated by Boks AIR) and found out that certain print style rules interfered with PW main.css. Step by step I´m learning. When I´m a little bit further I will show some results.2 points
-
As a quick fix, you could add it to the top of /wire/templates-admin/default.php. If you want to write a module for doing that, a simple autoload module which hooks right before Page::render and just sends the header there should be enough. The Helloworld.module that ships with ProcessWire default theme is a nice starting point for this (it's already autoload and demonstrates how hooks are used.) The only code you'll need in init() would look pretty much like this: $this->addHookBefore('Page::render', $this, "sendHeader"); And your sendHeader() method would only need to contain that header you've posted above: public function sendHeader() { header("Content-Type: text/html;charset=UTF-8"); } Hope this helps!1 point
-
This continues to look really great! One possible suggestion would be to use the PageAutocomplete Inputfield for the individual users, just because some people might actually have thousands of users. This may be too much for an asmSelect.1 point
-
You would just need to setup the cdn hostname so that it points to the same thing as www (and that your server recognizes it). This is not something you'd setup in htaccess, beyond what's already mentioned. But I would suggest not doing that, as it's not ideal from an SEO perspective to have two hostnames pointing to the same thing.1 point
-
Correction to Diogo's example: if($user->hasPermission('page-view', $page)) { ... } Assuming that $user is the current user, you can also do this: if($page->viewable()) { ... }1 point
-
Thanks Soma, that was it! I enabled "Allow Page Numbers?" on the language gateway template and now it works.1 point
-
Without SQL you could do it with simple bootstrap or in a template: foreach($pages->find("template=basic-page") as $p){ $p->body = str_replace("/newsite/","/",$p->body); $p->save(); }1 point
-
Page Link Abstractor is a splendid module, but it also introduces a rather big change to the way PW handles links. If you "just" want a one-time fix for changed links, it might be easier to run a simple SQL query for fields that contain changed links, replacing old links with new ones. Something like "UPDATE field_yourfield SET data = REPLACE(data, 'href="/newsite', 'href="');" should do the trick. Since I'm not sure how familiar you are with MySQL / SQL in general, this may be self-evident to you, but still: a) if you're not absolutely sure about what you're doing, don't try method I mentioned above and b) always make a backup of the table you're working with before making any changes to existing data (CREATE TABLE backup_field_yourfield LIKE field_yourfield; INSERT INTO backup_field_yourfield SELECT * FROM field_yourfield;) By the way, Page Link Abstractors description says that "This module hasn't yet been tested with migrating a site from subdirectory to root, but I will be testing this soon." Old information perhaps?1 point
-
1 point
-
I think eventually we will have a few very different site profiles that, combined with some good marketing videos, may do a lot of the convincing for us. For example, with the shop module I love the point "any page can be a product". Plus once there are enough totally different profiles its easier to show prospective clients that you can do anything without hacking the core at all. I know this has been mentioned elsewhere, but I think the profiles in my head would be Shop, Blog, Member-driven content and of course the default basic site. If you can show more then that's awesome of course but when trying to get across the point that it can do anything, having these varied examples to fall back on would make it so easy. Then to sell it to those heavily invested in other systems you could just change a few fields and tweak a template right in front of their eyes and show how simple it is. People are wary about having to learn anything new when they've spent a lot of time (even forgetting about the money they have probably invested years of time) so if you can get across how simple it is then I think you can win them over. So variety + simplicity + power = panther (which still sounds like it should be a bad aftershave ).1 point
-
Is it possible to replicate a field in a template? Let me give an example. 1) I create a field named "article" (textarea multi language) 2) I insert the field "article" in a new template "page news" 3) I create a new page with the template "page news" 4) I enter my body, title, and ... 5) I want to put 3 fields "article", another page in 5 fields "articles", in another 20 fields "article" and so on ... using the same template. there is a method? FIND NOW -> http://processwire.com/api/fieldtypes/repeaters/ Thank u...1 point
-
1 point
-
Interesting topic, thanks for creating it Joshua. We have had similar talks since Drupal seems to be a platform that many organisations know in Finland. Big boys only talk about Drupal or Sharepoint. I have had my talks with our clients about "PW vs Drupal"... today I just do what Ryan once suggested: show them PW - build something quick, let them see how you develop with it and how quickly you can make things. You know you can build the whole backend of "events management" or "custom application never build before" in just about 30 minutes. Just build it. But if you do want talk about PW and Drupal, you should mention these things (I am by no means a Drupal expert and too lazy to check all the facts, so take this with grain salt and please do correct me if I am telling lies): Drupal release cycle is too fast for many. They try to get new major release every two year and only two latest are supported. Also major releases do break APIs, so probably most of the custom development need to be redone at least every four year. This might be fine on some projects, but for our clients that is usually an impossible schedule. It helps a little that new versions usually don't ship on time, though - and also some community efforts are trying to keep older versions secure. Ask people about their Drupal projects... most are not too proud of those: "This is little hacky" or "We didn't follow most of the best practices here, since we were in hurry". Those comments we got from the company, that we bought to teach us Drupal development and wanted them to show us their best work... Many people build sites with Drupal without really knowing how it works... which is understandable since it takes about 6 months to learn that beast (heard that 6 months estimate from CEO of biggest Drupal company in Finland and my initial feeling and personal experience suggest that it is pretty accurate). Drupal development is very different from normal PHP coding: If you (and your co-workers) have invested 6 months to "unlearn" PHP development and learned Drupal, you don't want to think about alternatives on that point. Drupal projects are expensive. In Finland ie. "The cost of Drupal web projects usually begins at about 20,000 euros, but projects best suited to Drupal generally cost more than 100,000 euros." (source: http://northpatrol.c...nal-products-2/). I usually draw a picture where PW is lots of tiny blocks, that cover 80% of needs and very little goes away. So you just build the remaining 20% and you get exactly what is needed. With Drupal (or any other "big" platform) you do get big block that goes well over 100%, but has more than 20% of holes. So you do have to build the remaining 20%, but also end up more than what is needed. So if you want to get rid of all the bloat, you do have more work to do. I have personally tried and wanted to learn Drupal for many many times. I always end up with big frustration and sites that were "nearly there". That was before PW, of course. EDIT: This was all very technical, so might want to talk this language only with tech orientated clients. With others, I would focus on PW admin usability and flexibility on frontend.1 point
-
I've never seen a panther fly... but if they would it would be more elegantly than a pig for sure1 point
-
1 point
-
I respect Drupal, but strongly dislike using and developing in it. This comes from a couple years of developing sites in it. The problems with Drupal have certainly been a motivation in making ProcessWire happen. Out of the box, ProcessWire is going to be a lot better at the large scale than Drupal. ProcessWire's architecture, foundation and API are far better than Drupal (captain obvious). People may use Drupal at large scale, but I don't believe the product itself was ever truly designed for it. Like with WordPress, being used at the large scale is something that happend to Drupal rather than something it made happen. Drupal is a pig that people have affixed wings to because there wasn't any other way to do it at the time. You see similar things happen with the other big platforms (WordPress, Joomla). As far as pigs go, Drupal is a good one. There are some things to respect (though not necessarily agree with) about Drupal's roots and the original thinking behind it. There's no doubt that it is far better than Joomla, for anyone that cares about this stuff. Beyond that, where it excels is in all the 3rd party stuff written for it, to do just about anything. It's a diesel-powered cuisinart in that respect… whatever you need to blend, it will blend… but it'll be messy. Working at large scale, 3rd parties have built all kinds of caching, CDN and load shifting things to throw on top the pile (and likewise with WordPress). Even a pig can fly if you strap wings on to it. And Drupal has a lot of folks thoroughly invested in it to the point where they are making that pig fly. Drupal is also such a household name that it represents a low-risk position for decision makers (low risk of job loss from choosing Drupal). None of this makes it a good product, just a safe one for people that don't know any better. But for people that do know the difference, we want a panther, not a pig.1 point
-
The TextformatterVideoEmbed module has been updated to support responsive embed codes. To enable, grab the latest version (v1.0.4) go to the module configuration screen and check the responsive box. Now when your videos are embedded, they will be output in a width-flexible format that adjusts to the container.1 point
-
Firstly, I am not against any help we can get to get this baby shipped and tweak along. Secondly, I don't wish to take much credit at all, since due to my mistakes along the way it is currently in this sorry state it is (and by that, I mean "v1" not shipped still, and "v2" prepared already). We've gained a lot of traction along the way, but we lost a lot as well (lately). So anything to get the ball rolling again would be great.1 point