Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 06/30/2014 in all areas

  1. Hi, just wanted to say hello to PW. Some former WebsiteBaker users made me aware of PW, so I decided to give it a trial this weekend. From my past CMS experience, I decided to convert an existing SilverStripe template into PW from scratch. This way you will quickly get a feeling about the system itself, the backend, template system and available documentation. After watching two videos and reviewing the API documentation, I started over and had a clone of my SilverStripe site running in less than two hours. I started with WebsiteBaker back in 2006, did some sites with ModX and Contao (formerly known as TypoLight) and was even forced to deal with WordPress by one client, before I finally switched to SilverStripe around 2009. My first impression of PW was: cool little CMS with easy backend, awesome API. Somehow feels a bit like a mixture of WebsiteBaker, Contao and SilverStripe to me, taking the best from all of them while skipping the bad parts. Respect. Looking forward learning more about PW. Cheers cwsoft
    7 points
  2. ProcessWire has no theming system like Drumlapress - basically because it does not need one. Anything you can do with html/css/js can be used with ProcessWire. Dead Simple Example: Create a file in /site/templates/ called mytemplate.php Go to the admin, go to setup -> templates and add new. You will see mytemplate.php listed. Select it and create the template. It will automatically have the title field added. Now, go to the front end of the admin, to the pages list, click on Home and then click on New. This will create a new page under home. Select your new template from the drop down, fill in the title field (for example, "testpage") and save. Publish it. Go to the front end and go to yoursite.com/mypage/ It will be blank. Open your mytemplate.php and add this to the top: <?php echo $page->title; ?> Save and refresh the page - you will now see the page title, but with no formatting at all. However, you can now see that you can add any html formatting to mytemplate.php you like - use a framework like Bootstrap or work it out in dreamweaver, anything. All you have to do is to add the API like the example above to display content for that page. ProcessWire puts no limits on how you build your site and neither do you have to convert anything to work with it - you can create ANY design you like and not be tied up by someone elses design. What is more, you can do this by learning only the smallest amount of PHP (like, what you can learn in a morning) and by learning to use the very logical API. For a more detailed tutorial, go to http://wiki.processwire.com/index.php/Basic_Website_Tutorial
    4 points
  3. Nothing wrong with being careful, but luckily we're talking about free software here. If it's any more reassurance, we've got a lot of sites relying on this module already, so trust me: in the (unlikely) scenario that something was to happen and the module wasn't kept up to date, I for one would be more than happy (and forced, actually..) to catch the ball
    3 points
  4. Guys, Sorry I have been rather quiet in the recent past. You may have noticed I am in holiday mode and have been following, rather keenly, the trajectory of a certain spherical leather object ....Two more weeks to go and I should be back in play....(forgive the pun )
    3 points
  5. I find custard pies work fairly well.
    3 points
  6. This is a beta release, so some extra caution is recommended. So far the module has been successfully tested on at least ProcessWire 2.7.2 and 3.0.18, but at least in theory it should work for 2.4/2.5 versions of ProcessWire too. GitHub repo: https://github.com/teppokoivula/ProcessLinkChecker (see README.md for more techy details, settings etc.) What you see is ... This is a module that adds back-end tools for tracking down broken links and unnecessary redirects. That's pretty much all there is to these views right now; I'm still contemplating whether it should also provide a link text section (for SEO purposes etc.) and/or other features. The magic behind the scenes The admin tool (Process module) is about half of Link Checker; the other half is a PHP class called Link Crawler. This is a tool for collecting links from a ProcessWire site, analysing them and storing the outcome to custom database tables. Link Crawler is intended to be triggered via a cron task, but there's also a GUI tool for running the checker. This is a slow process and can result in issues, but for smaller sites and debugging purposes the GUI method works just fine. Just be patient; the data will be there once you wait long enough Now what? For the time being I'd appreciate any comments about the way this is heading and/or whether it's useful to you at all. What would you add to make it more useful for your own use cases? I'm going to continue working on this for sure (it's been a really fun project), but wouldn't mind being pushed to the correct direction early on. This module is already in active use on two relatively big sites I manage. Lately I haven't had any issues with the module, but please consider this a beta release nevertheless; it hasn't been widely tested, and that alone is a reason to avoid calling it "stable" quite yet. Screenshots Dashboard: List of broken links: List of redirects: Check now tool/tab:
    2 points
  7. Other people more experienced with storage than me always poo poo'd my rsync job and swore by glusterfs
    2 points
  8. We (Avoine) have the (hairy) balls also in ScheludedPages basket.
    2 points
  9. Scheduled publishing is an integral part of the workflow for many bloggers, so this would definitely make sense. I couldn't live without such a feature anymore.. @kongondo: if you're still pondering whether to use SchedulePages somehow or cook up your own method, I'd vote for SchedulePages. Admittedly I'm being somewhat selfish here (I'm sure we'll be using this module for our client sites and I don't like the idea of having to explain why and how scheduling posts is different from all other pages) but it's also a great module
    2 points
  10. Have you seen my post on setting up a web environment on Mavericks?
    2 points
  11. Hi Matthew - that is really bad luck mate! This sort of potential failure is something I have had to contend with my entire working life - not, admittedly from servers, but from the fact as a sound producer, I have always had to cope with cutting edge technology that is almost guaranteed to fail at the worst possible moment! And if remote connections are involved (especially anything satellite shaped), then the potential risks are increased dramatically. In those cases, I ALWAYS made sure clients knew the risks and always explained to them exactly what we had arranged as a backup plan. These were costed in. So, for instance, once when we were doing a live Q&A across the world between staff and their CEO, we actually did a short, recorded interview the day before with the chap as a backup. In that case, the line DID fail, and the client used a pre-prepared script that I had written for him to apologize to the staff and introduce the recorded interview. Although it was still embarrassing for the client, we at the production house looked great! You cannot prevent every problem and despite always having a backup plan, I have still ended up with egg on my face several times. I even had a client blame me for a lightning strike which took the power out at the hotel at which he was holding his conference; why was I unable to prevent it??? The only thing that might be worth considering is a server/website on a stick, given to the client in advance with instructions and to say to them, "Murphy's law says that the only time the line will ever go down will be tomorrow night - if it does, this is what we do.... It won't give the entire experience, but at least you will be able to carry on" The chances are that this sort of thing will be a rarity, but at least the clients will always know that you care enough to have had a back up plan. Some people think that admitting to a client that things can go wrong makes them look weak somehow and that they should not worry the client with that sort of thing. In my experience, it actually makes you look professional, experienced and well prepared. I do think the IT industry as a whole struggles more with this than other industries - partly because the technology is inherently unreliable (!) and partly because the industry is still very young and does not have the decades of experience and history of catastrophes that something like the broadcast industry has for instance. EDIT: Having just read your note that this was a competition site, I think your only true backup would be to have had a secondary hosting ready to go at an alternative location, and an already active cname address, so: mycompetition.com mycompetition.company.com (at alternative hosts) Again, with a preprepared statement for the client to read to explain that the gods were being unkind and this is what they would do. And of course, cost it in, telling the client in advance that things CAN go wrong and this is an insurance policy - he can go without the additional cost, but at his own risk.
    2 points
  12. Another option would be to add the various sidebars as (hidden, grouped under a hidden page) pages * Sidebars (hidden) * Sidebar A (hidden) * Sidebar B (hidden) * ... and include them in your templates using a Page field, e.g. called sidebar. Then something like echo $page->sidebar->body; should get you the selected page's body field etc. You could even have this be a Page field which allows to select multiple pages – that way, all pages below Sidebars could be sidebar widgets, and you could add multiple ones to one page. It really depends on what you need and what works best for you (which is usually the case with PW).
    2 points
  13. DNS made easy is the service I use. It's just a couple of quid a month but's is worth it for peace of mind. They provide a service that looks to your site to find a pre designated page with a string in it. In my case the page is called siteup.php, from memory it has a one line entry echo 'siteup'; the monitoring service just checks for that page once a minute and when it can't find it for whatever reason, it simply changes the DNS entry to the new server. It can also do a tertiary server should the second server fail. It keeps monitoring and when it finds siteup.php switches it back with short ttl settings. If I'm being super efficient I set up SQL replication. http://www.howtoforge.com/mysql_database_replication
    2 points
  14. Or do this in your sidebar file: <?php if($page->template->name == 'home') { // show some stuff if home template } elseif($page->template->name == 'page') { // show some other stuff if page template }
    2 points
  15. Hi Pravin, That would simply be a case of including a different bit of code for each template. So it could be: home.php // Main content here <?php include("./sidebar.inc"); ?> special.php // Main content here <?php include("./alternate_sidebar.inc"); ?> That's if I'm understanding your question correctly?
    2 points
  16. This module is improved and extended successor to Version Control For Text Fields. It handles everything it's predecessor did -- providing basic version control features for page content -- and quite a bit more. Download or clone from GitHub: https://github.com/teppokoivula/VersionControl. This module requires ProcessWire 2.4.1 or later, mostly because of the file features, which require certain Pagefile and Pageimage methods to be hookable. There's no sensible way around this limitation; for those stuck with < 2.4.1, Version Control For Text Fields will remain a viable option. What does it do? While editing pages, fields with old revisions available show up with a new icon in their header bars. By hovering that icon you get a list of available revisions and by clicking any one of those the value of that particular field is reverted to that revision. No changes are made to page until you choose a revision and save the page, which means that you can keep switching between revisions to get an idea what's really changed without inadvertently causing any content to change. The module also adds a History tab to page edit. This tab opens a view to the history of current page in the form of "revisions" -- each of which is a group of changes to page fields processed during one page save (similar to revisions in various source control applications). There are three actions you can perform on these revisions: adding comments, live previewing what the page might've looked in that revision and restoring the page to specific revision. One specific feature that has been a big thing for me personally is support for file (and image) fields, as the original version control module felt rather incomplete without it. I'm hoping to take this a lot further performance, stability and feature wise, but as it stands right now, it's already included here and should be fully functional. Watch the video preview here I prepared a little screencast outlining most of this: http://youtu.be/AkEt3W7meic. Considering that it was my first screencast ever, I'd like to think that it wasn't that bad.. but I might give it another shot at some point, this time planning a bit before hitting "record" Upgrading from Version Control For Text Fields For those already using Version Control For Text Fields, I've added something extra. If you upgrade that module to it's latest version, you should see a new checkbox in it's settings screen saying "Don't drop tables during uninstall". If you check this, uninstall the module and then remove it's files (this is required in order to install Version Control), your old data should be automagically imported to Version Control. Import has only been tested with limited amounts of demo data. Proper tests are yet to come, so please be careful with this feature! Update, 21.6.2015: as of today, this module is no longer in beta. While all the regular warnings still apply (making changes, including installing any new modules, on a production site should always be considered risky) Version Control has gone through pretty extensive testing, and should be as stable as any other module out there.
    1 point
  17. @davo: yeah, rsync probably would do it, but to keep sites in sync all the time would require this to be triggered after each change to assets etc.. or just to be executed regularly enough to achieve "good enough accuracy" Disabling edit sounds like a good idea to prevent unnecessary mess. Sounds like a good fit for demo mode too.. and just to be really clever, you could even make it dynamic using something like $_SERVER['SERVER_NAME'], so it'll be automagically turned on for the duplicate
    1 point
  18. Adrian, you can already change the author of the post..unless am not getting you? Check the settings tab when editing a blog post page
    1 point
  19. One nice thing that Wordpress has is the ability to change the author of a post from the person who is creating it and logged in. Maybe an author PageField that allows you to select from other PW users that have a blog author role, or something along those lines?
    1 point
  20. I followed these http://coolestguidesontheplanet.com/get-apache-mysql-php-phpmyadmin-working-osx-10-9-mavericks/ and these instructions http://coolestguidesontheplanet.com/set-virtual-hosts-apache-mac-osx-10-9-mavericks-osx-10-8-mountain-lion/ everything is working great. There's also ammps that I tend to prefer over mamp http://www.ampps.com/
    1 point
  21. Had the same problems when switching to a Mac. Installed MAMP, thinks are working fine since then. http://www.mamp.info/ - just in case.
    1 point
  22. I think the key thing is permissions on the assets folder - make sure that is writeable.
    1 point
  23. Works, and the following code should set the label in different languages (in combination with the code kongondo posted). $english = $languages->get("english")->id; $f->set("label{$english}","Date");
    1 point
  24. Looks like I have the same thing going on: https://processwire.com/talk/topic/6790-switch-to-language-field-type-errors/ I just did some more testing and discovered the problem appears on: PHP 5.3.28 MYSQL 5.6.13 but not on: PHP 5.4.30 MYSQL 5.1.73-1
    1 point
  25. Processwire does not have front-end themes, because for every website the front-end is custom made. https://processwire.com/talk/topic/6653-how-can-i-apply-a-new-theme-to-processwire/ The install.sql contains the default (admin) pages which are needed for the back-end, and some default pages for the front-end (Home, Basic Page, Search, 404) There is a module to export an entire site profile, this will create an sql export that together with the other file from the site folder can be used when installing new sites with that specific site profile. Site Profile Exporter http://modules.processwire.com/modules/process-export-profile/ A good read to get you started https://processwire.com/talk/topic/4173-grouped-forum-posts-links-articles-tutorials-code-snippets/
    1 point
  26. Hey Teppo, love the module, very smooth. I did have problems setting the name for the "to" header, ie $mail->toName = $name, or $mail->to( $addr, $name ). Neither seemed to work for me. I've replaced the top of the ___init() function as follows to make this work, may be of some use to you: public function ___send() { foreach( $this->to as $k => $v ) $toAddr[$k] = $this->toName[$k]; // create the message $message = Swift_Message::newInstance() ->setTo($toAddr) ->setSubject($this->subject); Thanks again for the module
    1 point
  27. This module looks awesome - thanks hugely for sharing Could I ask (pretty new to Processwire so apologies if this is easy or not possible or anything like that). Would it be possible to modify the post URI so that instead of something like /blog/posts/this-is-a-post you could have something like /blog/2014/06/this-is-a-post So essentially it'd categorize the posts into year and month. This is similar to how Wordpress and a couple of other CMS/Blog systems do it as default, and it's pretty handy as if you've got 2 posts with the same name, they are less likely to clash if you're also including/checking the month/year. Also, I read through the thread and saw a mention of having a publish date/time - has this been implemented? If not I'm probably going to be doing some work on a few of my own modules in the next week or two, so would be happy to see about doing a pull request with it as it's something I'll need to add anyway
    1 point
  28. Wouldn't it be better to do this with a $pages->find()? $pages->find("template=mytemplate, title|name|headline=$q");
    1 point
  29. Try $p->find() instead.
    1 point
  30. Hey Martin, basicaly you need to check for portrait or landscape oriented image first: $options = array('cropping'=>true, 'upscaling'=>false); // cropping => true is default and same like 'center' foreach($page->images as $img) { if($img->width > $img->height) { // check for orientation $thumb = $img->size(200, 100, $options); // we have a landscape oriented image } else { $thumb = $img->height(100, $options); // we have a portrait oriented image } // output your markup here echo "<img src='{$thumb->url}' alt='{$thumb->description}' />"; } In your special case you need to check for landscape oriented images that have a width more than two times the height: if($img->width > (2 * $img->height)) { // check for images with more than two times the width compared to the height $thumb = $img->size(200, 100, $options); // we have a landscape oriented image } else { $thumb = $img->height(100, $options); // we have a portrait oriented image }
    1 point
  31. For important clients I use dns failover. If the monitoring service can't make contact with the UP script on the site then failover switches dns to another server (in my garage!) Then when it comes back online it switches back again. The switch normally takes about 60 seconds. For not such important sites I use cloudflare.
    1 point
  32. hmm, since last update to 2.4.5 there are other odd things (e.g. theme switching). Could be the same reason? Maybe Ryan can take a look at this.
    1 point
  33. Based on second half i don't think it was pure luck. But not one of the best performances (especially first half). You don't hear me complaining though
    1 point
  34. Sorry for the delayed answer, Pierre-Luc! Been busy with other stuff and this totally slipped my mind. What you've described there wasn't really possible without direct SQL queries until just a few moments ago. I've just pushed to GitHub an update to VersionControl.module (0.10.0) that adds new $page->versionControlRevisions() method. This isn't properly tested yet, but something like this should work: // current value of field 'headline' echo "Headline for current revision: {$page->headline}<br />"; // value of field 'headline' in previous revision $revisions = array_keys($page->versionControlRevisions(2)); $page->snapshot(null, $revisions[1]); echo "Headline for previous revision: {$page->headline}<br />"; // return Page to it's original (current) state $page->snapshot(); echo "Back to current revision: {$page->headline}<br />"; Since snapshot() returns Page object to given revision or point in time ($page->snapshot($time, $revision)) you'll want to make sure it's back to it's original state in case you're going to make changes and save the page -- otherwise the revision you fetched with snapshot will be returned from history once you save the page. $page->versionControlRevisions() returns an array of revisions for current page and can optionally take one param, $limit, to fetch only that many revisions if more exist. It's return value is in the form of array([revision] => [timestamp]), i.e. array(4 => '2014-01-01 02:00:00', 3 => '2014-01-01 01:00:00') etc. so in order to get just the revision IDs out of that I'm using array_keys() in the example above. You could probably also do something like this, if you want to make sure that Page doesn't get accidentally returned from history (this'll consume more memory, though): $revisions = array_keys($page->versionControlRevisions(2)); $page->previousVersion = clone $page; $page->previousVersion->snapshot(null, $revisions[1]); echo "Headline for previous revision: {$page->previousVersion->headline}<br />"; Not sure if you're still working on this, but this kind of feature felt useful so I'm glad you brought it up..
    1 point
  35. @NooseLadder - thanks so much for your help with this. So if things are working with that file_exists check removed then I think we can assume it's a windows path issue. Weird that the addfile to the zip works, but file_exists fails. I am curious about the Directory not empty warning. Does the migratorfiles directory actually get removed? Again, this seems like a windows path issue because I am using a recursive directory delete function and it works here. I really might need that windows xammp setup to get all these sorted out. But for now, I have removed the file_exists check from the latest committed version as I don't really think it should be necessary as the $files array shouldn't contain any files that don't exist anyway. Another big enhancement this morning - I think all multi-language features should now be working! @tobaco - would you please check to see if the latest version fixes all the issues you were having with multi-language page names etc?
    1 point
  36. I don't know about you guys but that is the reason why I never register the clients domain by the same company that is going to host the website. Register by a register company and host at a hoster company. Hoster A down ? Point domain to Hoster B and upload a copy. These days DNS propagation is less than 6 hours. Edit: instead of changing dns settings, use url forwarding. It works instantly! Visitors won't even see the change in host url if configured properly and it is only necessary during the time of primary host fail. I do the same with my email accounts. I never register an email address with my ISP. Works for me. Would like to know though what works for you guys.
    1 point
  37. Shame I can't like myself.
    1 point
  38. ah ok, works this way. wire()->addHook("wireMail::sentLogReset", function(HookEvent $event) { $filename = wire('config')->paths->logs . 'wiremailsmtp_sentlog_' .wire('page')->name. '.txt'; @touch($filename); $res = file_put_contents($filename, '', LOCK_EX ); if(false===$res || 0!==$res || !file_exists($filename) || !is_readable($filename) || !is_writeable($filename)) { $this->logError('Cannot reset Content of the SentLog: ' . $filename); throw new WireException('You want to make usage of the SentLog-feature, but cannot reset Content of the SentLog: ' . basename($filename)); } $event->replace = true; $event->return = 0===$res ? true : false; });
    1 point
  39. Hi. (My first post in this forum after creating my first site with Processwire ) Only to let you know that the u-nikos's nginx configuration works perfect with Processwire 2.4 I think you can add "official" support and link to his comment for the configuration. I had doubts about how difficult it would be at the beginning and maybe there are people in the same position without knowing that it's really easy to make it works. I'll work a little more with nginx caching (or microcaching). I'll let you know if I do some advances in this area. Best
    1 point
  40. Exactly. so, the logic, in order of ascending precedence (i.e. 3 > 1, etc.) could probably go like this: 1. Comments are ON by default. 2. On each 'post' page (/blog/posts/my-post/), will include a checkbox: 'check to disable comments for this post'. This will ignore #1 3. On some settings page or on the 'posts' page (/blog/posts/) have a checkbox or similar that says: 'disable comments on all posts'. Ignore #1 & #2 So, #3 is 'greatest' and will ignore #1 and #2 but will NOT change their settings; checked boxes (#2) will remain checked and unchecked ones (#1) will remain unchecked but their 'directions' will be superseded by #3 . ################################# EDIT ################################# Oops warped thinking on precedence above!!! It should be the other way round! See edits below.. So, the logic, in order of ascending precedence (i.e. 3 > 1, etc.) could probably go like this: 1. Comments are enabled by default everywhere. 2. On the 'comments' page (/blog/comments/) have a select that says: 'disable comments on all posts/disable new comments on all posts'. Ignore #1 but respect individual post's settings (#3) 3. On each 'post' page (/blog/posts/my-post/), will include a select: 'disable comments on this post/disable new comments on this post/always enable comments on this post'. This will ignore #1 & 2. This is like a get() in ProcessWire: it is explicit and ignores 'hidden' status. So, #3 (individual post setting) is 'greatest' and will ignore #1 and #2. ################################# END EDIT ################################# Btw, you will notice very soon that there's very little 'do this the PW way' - in many cases, there is no PW way The system is so versatile yet powerful you will be amazed...
    1 point
  41. Comments on/off? Been thinking about a new feature. Ability to turn on/off comments both on a per post basis and on a Blog-wide basis. So, if a post has comments turned off, the user gets the usual 'Comments not allowed for this post' or something similar. Additionally, maybe also a feature to turn-off submitting of new comments on a post when approved comments hit a certain number, say '100'. What do you guys think? Need to think a bit more about how best to implement this...
    1 point
  42. Or use this script I created to create and send a zip to browser. https://gist.github.com/somatonic/6427247 /* creates a compressed zip file */ function create_zip($files = array(),$destination = '',$overwrite = false) { if(file_exists($destination) && !$overwrite) { return false; } if(is_array($files)) { foreach($files as $name => $file) { if(!file_exists($file)) unset($files[$name]); } } if(count($files)) { $zip = new ZipArchive(); if(!$zip->open($destination, $overwrite ? ZIPARCHIVE::OVERWRITE : ZIPARCHIVE::CREATE)) return false; foreach($files as $name => $file) { $zip->addFile($file,$name); } $zip->close(); return $destination; } else { return false; } } // get a language to export json files $lang = $languages->get("de"); $files_to_zip = array(); // "language_files" = file field on language page where json's are stored foreach($lang->language_files as $f){ $files_to_zip[$f->name] = $f->filename; } $zip = create_zip($files_to_zip, $config->paths->root . 'language_files_de.zip' ,true); if($zip) wireSendFile($zip); // send file to browser (/wire/core/functions.php) This would be put in a template file. Have fun. While doing this we might need a wireCreateZip() function in core as we also got a wireUnzipFile().
    1 point
  43. Hi Joshua I think you're right in that you can do anything with PW that you put your mind to. I've had the same experience you've had with clients wanting to use Drupal but with WordPress, and have vowed in another thread not to touch any more work that comes my way where the client wants to use it - it was just that unpleasant an experience last time I used it. The problem I find is when someone else has implemented a dozen plugins and you have to go into someone's work and find out where the issues are if something doesn't work as expected - you spend more time bug-hunting instead of developing. That said, a lot of it can be to do with familiarity of a platform. I've got no experience with Drupal and little with Wordpress, so I'm sure if the roles were reveresed I'd struggle a bit with ProcessWire at first, just maybe not as much as I have with other systems. It's just the frustration of forcing a system to do what you want when you know there's a quicker, better way for a given type of project that really puts me off using some other systems nowadays. With enough time I think you can achieve anything with ProcessWire. Whilst I've not built a site exceeding more than a few hundred pages yet, I have managed to integrate it with forum software and built a file repository. I've never found myself thinking I couldn't do anything with it - it's just a matter of working out how to do something rather than if you can. For one project I did have to do a little work to mock-up a small piece of a site to entice someone away from another system to ProcessWire and it worked, so one way to do this if you feel they're open to suggestion is to put together a small demo that's relevant to their content and show them how it could work out better for them. Of course, this has to take into account whether they're receptive in the first place, plus it's a case of weighing up the chance they'll switch against time when you're not earning money, but it comes back to the saying "a picture is worth a thousand words"... I think "a demo is worth a short novel" applies in this case It's always easier if you have time to show someone something than to try and describe the benefit. I'm also really excited about a lot of the modules that have been released recently - for example some members here are talking about some interesting things with regards to Antti's shop module that look amazing (had a quick peek at the example linked in this particular post and loving it: http://processwire.c...isa/#entry18784 ). I'd love to soon be able to use ProcessWire for any type of site because I believe it's flexible enough to fit pretty much any role.
    1 point
  44. I'd say that thing is everything here is relative; They use Drupal, because they (the developers) probably invested huge amount of time into learning all the ins and outs and quirks of that system. Also, Drupal allows to do things fast…, but relatively compared to how long it takes to untrained person. And then, it really is fast afterall. That being said, there are two different ways I think about this whole 'Drupal can do big things': Some companies thinkg 'big' when they talk about hundreds of pages, which, when IA is done well, isn't really that much (even might be easy to navigate) Big part of these Drupal sites are membership sites, which I admittedly can't really imagine that easily being built on PW Regarding membership sites: Yeah, have registered members isn't really a problem. But having real membership/social site is a different thing, and Drupal has this already… take http://openatrium.com/ for instance. That said, I despise drupal, I think it's a behemoth, it's ugly, the HTML is horrible and if you need to debug/change the HTML, you can straight up kill yourself (since there is like 12 entry points where modules can change something, and not all of them are equal).
    1 point
  45. All image fields are technically multi-image fields. The single-image access (when a field is set to 1 image max) is a type of outputFormatting for convenience on the front-end. All pages on the front-end of your site have outputFormatting turned on by default. When outputFormatting is on, it means the page is in a presentation-mode as opposed to a saveable mode. In presentation (outputFormatting) mode, pages are setup for presentation convenience and safety. The distinction exists so that content can be modified at runtime with custom formatters and such, without worry of that runtime-info ending up saved back into the database. This is why ProcessWire throws an error if you try to save a page with outputFormatting on. outputFormatting is also what converts an images field with a 1-image max to a single image rather than an array of 1 image. That's because I thought people would find it confusing on the front end to have to use an array when all they are dealing with is 1 image. Whereas, when coding for administration of any image(s) field, it's more convenient to treat them all the same way. When you are in the admin, pages don't come with outputFormatting on by default. Since it sounds like you are presenting content in the admin kind of like how you would on the front end, you can either turn on outputFormatting for those pages you are presenting content from, or better yet: treat all image fields as multi-image fields. If you do that, just remember that all text-based content is in a raw state. For instance, if you want to output an <img> tag with an alt attribute: <?php foreach($page->images as $img) { $alt = htmlentities($img->description, ENT_QUOTES, "UTF-8"); echo "<img src='{$img->url}' alt='$alt' /> } When building admin stuff, it's generally actually always better to have outputFormatting off.
    1 point
×
×
  • Create New...