Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 01/02/2015 in all areas

  1. I have been spending some long evenings building PadLoper. It is my personal project to challenge myself as a developer, but also something I believe ProcessWire really misses: a solid eCommerce platform. I am happy to announce, that I am not very far away from public release, so I did create a little teaser site and email list for all of you that are interested: https://www.padloper.pw/ As many of you now, I also have bunch of eCommerce modules called "shop for processwire". Those remain open source modules, but I am not actively maintaining them (like I really haven't since 2012). All the code in PadLoper is new and it's totally build from ground up. If someone wants to maintain or develop shop for processwire further, I am more than happy for that. There will be some open source components coming from PadLoper also: at least payment modules, but I might also open source the shopping cart module. Padloper released 4th October, 2015: https://www.padloper.pw/
    2 points
  2. For sure, would like to do this. After we try adding some modules we can check to see if changes are reflected in the remote as they are in the local environments. For now the database is working marvelously and Amazon has a simple code push that we have perfected and this process would be valuable to pw fans.
    2 points
  3. The bottleneck could be the filesystem when you reach more then 30.000 pages with assets. But ProcessWire has you covered with the pagefileExtendedPaths setting. When you expect your site to grow beyond 30.000 pages with images or/or files enable this setting in /site/config.php Ryan states that this feature is beta but I confirm it's working without any quicks. /** * Use extended file mapping? Enable this if you expect to have >30000 pages in your site. * * Warning: The extended file mapping feature is not yet widely tested, so consider it beta. * * Set to true in /site/config.php if you want files to live in an extended path mapping system * that limits the number of directories per path to under 2000. * * Use this on large sites living on file systems with hard limits on quantity of directories * allowed per directory level. For example, ext2 and its 30000 directory limit. * * Please note that for existing sites, this applies only for new pages created from this * point forward. * * @var bool * */ $config->pagefileExtendedPaths = false;
    2 points
  4. I didn't leave Wordpress but have migrated away from one site, upgraded (and instantly broke due to plugins) another and am pushing to migrate a third. An issue I have run into with the third is that the client understands the security implications but cannot afford to migrate the site yet despite being on an older version. Interestingly I did see Google flag at least one Wordpress site that had been hacked with a security warning in bold red letters in a search result. I can only applaud them for this and suggest they start adding amber warnings for sites not hacked yet but that pose a security risk if you hand over any data to them. Easy enough with most systems where you can determine their version I think but would probably go down like a lead balloon with many people.
    2 points
  5. Hi kongondo, Thanks for the quick reply and the welcome. I had actually already read the topic that you mention, and this is what prompted my need: I would like to save a "stock" field for each product, but this field would have to be calculated each time a stock movement is saved, and calculating this field is precisely what takes so much time. In the meantime, I continued looking into the problem, and I think that I came up with a solution with the following module: class PagesSum extends WireData implements Module { public static function getModuleInfo() { return array( 'title' => 'Pages Sum', 'version' => 1, 'summary' => 'Adds a $pages->sum($selectorString, $fieldName) function to sum the value of a specific field over a list of pages selected by a selector string.', 'singular' => true, 'autoload' => true ); } public function init() { $this->addHook('Pages::sum', $this, 'sum'); } public function sum($event) { $selectorString = $event->arguments(0); $fieldName = $event->arguments(1); // Find all the pages associated with the selector string $pageFinder = new PageFinder(); $idQuery = $pageFinder->findIDs(new Selectors($selectorString), array('returnQuery' => true)); $idQuery->set('orderby', array()); $idQuery->set('groupby', array()); $idQuery->set('limit', array()); $stmt = $idQuery->execute(); $idArray = $stmt->fetchAll(PDO::FETCH_COLUMN); // If no pages were found, return 0 if (count($idArray) == 0) { $event->return = 0; return; } $idString = implode(',', $idArray); // Get the table name for the given field name $field = $this->fields->get($fieldName); // If no field with this name is found, return 0; if (!$field) { $event->return = 0; return; } $tableName = $field->getTable(); // Run the SUM query $sumQuery = new DatabaseQuerySelect(); $sumQuery->select("SUM(data)"); $sumQuery->from($tableName); $sumQuery->where("pages_id IN ($idString)"); $stmt2 = $sumQuery->execute(); list($total) = $stmt2->fetch(PDO::FETCH_NUM); $event->return = $total; } } In my tests, it is about 60 times quicker to calculate the sum with the function $pages->sum($selectorString, $fieldName) than looping over the pages (for about 12000 pages). I would appreciate any feedback, in case there are any other optimizations to be achieved, or any errors I haven't thought about. And I hope that this might maybe be useful to others too!
    2 points
  6. Markup Simple Navigation Module While there was a lot of people asking how to make navigation, and there were many examples around already (apeisa, ryan...) I took the chance to sit down 2-3 hours to make a simple navigation module. It has even some options you can control some aspects of the output. Installation: 1. Put this module's folder "MarkupSimpleNavigation" into your /site/modules folder. 2. Go to your module Install page and click "Check for new modules". It will appear under the section Markup. Click "install" button. Done. Technically you don't even need to install it, after the first load call ( $modules->get("MarkupSimpleNavigation") ) it will install automaticly on first request if it isn't already. But it feels better. However, it will not be "autoloaded" by Processwire unless you load it in one of your php templates. Documentation: https://github.com/somatonic/MarkupSimpleNavigation/blob/master/README.md Modules Repository processwire.com https://processwire.com/modules/markup-simple-navigation/ Download on github https://github.com/somatonic/MarkupSimpleNavigation Advanced example with hooks creating a Bootstrap 2.3.2 Multilevel Navbar https://gist.github.com/somatonic/6258081 I use hooks to manipulate certain attributes and classes to li's and anchors. If you understand the concept you can do a lot with this Module.
    1 point
  7. You can use a simple helper module to rename a page to its ID. You can find the techniques required for that in this thread: https://processwire.com/talk/topic/1648-ok-to-change-page-name-path-after-save/?p=15232
    1 point
  8. Yes, again I have confirmed that everything is working fine now and successfully rebuilt the website again. Its not too bad if I must say myself. I've noticed things like the images and other items in the assets directory need to be deployed from the local environment to take effect. I can't tell you how happy I am to have a development procedure down now. Looking forward to learning more about PW.
    1 point
  9. Yes! Just use the ID! I never would have guessed!
    1 point
  10. Joss, Thank you for your assistance with this article: https://www.otreva.com/blog/deploying-wordpress-amazon-web-services-aws-ec2-rds-via-elasticbeanstalk/ It took a little more to understand the cantankerous elastic beanstalk environment, to configure the local eb git deployment tools but it is all very clear now! One of the biggest thing to know is that you should not mess with the elastic beanstalk environment; it is made with insane environment restrictions that in some ways makes it good because you just need to deploy the code with a few command. But this is also the hardest thing to learn because messing with it will potentially destroy your code. Nevertheless this is the system we have chosen and see some advantages and again are super excited about rapid development of content we can now do through Processwire. We have even found a PW module that will help us back up the PW code to an Amazon S3 bucket here: https://processwire.com/talk/topic/1368-save-files-in-amazon-s3-cloud/ Thanks again for all your help. I suppose learning the hard way has its merits because you don't forget as easy but then again I've never measured learning easy against learning hard but for some reason I think learning hard retains memory a little better. What we like about PW is it makes learning easier, yeah! Cheers, and again happy new year, March
    1 point
  11. Thanks for taking the time to create this, ESRCH! You should throw this on GitHub and add then add it to the modules directory. I'll let you know if I experience any problems with it.
    1 point
  12. I'm very much in Joss' boat here - for me, PW is a true all-rounder, ready for anything. I stumbled upon PW a few years back when I was looking for a system that allowed me to seamlessly work with multiple content-types. This was my big issue in my search. I used WordPress for about a year. In that short time, I found myself judging it more often that I would judge anything. I say that without the intent of throwing flames. Since my career in web development began, I'd been looking for a great platform on which to do great things. As time went on, I found various different options - of course, like with most things, they all did at least one thing good to suit my needs. Problem was, it was only partial - no system before PW did what I wanted it to do the way I wanted it done, and in a seamless and effortless (no, I'm not lazy) manner. I had stumbled onto PW before - back in the 2.0 days, but I didn't like the interface, at all. I believe it was 2.4 that changed the interface (it's design; UI, specifically) - it was at that point that I fell for it. I'm now at the stage where I can't look back. PW does everything that needs to be done, and then some. And it does it in an elegant way. This is what I was searching for. WordPress didn't do that for me. Joomla didn't do that for me (granted - I didn't use Joomla for very long at all). Nor did Drupal. Granted, those are all beast systems - but they are advertised that way - in a way, that can make them quite scary. Bolt, a reasonably new system, did most of what I wanted, but it's very limited, and, as such, should probably only be used for small sites. PW is more of a beast than the big three above to me. The silent beast. I'm sure you all know what I mean. I'd also like to ask something: I see more and more, around the internet and mostly in forums, that developers seem to choose their CMS based on what CMS the client wants. I find that quite interesting, because I've never had that experience. I have small and medium sized businesses in my portfolio - a decent amount of them quite knowledgeable in the web development field - and none of them asked me to use a specific CMS. They all just say, "use what you wish, as long as it gets the job done." So I ask, is this common elsewhere in the world? And if so, how do you deal with it?
    1 point
  13. This might help https://www.otreva.com/blog/deploying-wordpress-amazon-web-services-aws-ec2-rds-via-elasticbeanstalk/ It covers wordpress, but talks about things like not being able to upload images directly or install plugins and so on - in otherwords, as it is stateless, you are uploading a complete solution from git. After that I get completely lost!
    1 point
  14. I have used both Wordpress and Joomla for client sites in recent years and the reason I look to ProcessWire is the same for both - if I am to develop fully a solution then addresses both a client's technical and editorial needs and also their brand and their presence (from the advertising point of view) then I need to move as close as possible to the blank piece of paper as a starting point - it probably says as much for me being an old advertising bloke as anything else Processwire allows me to do that where as both WP and Joomla restrict me before I even start by determining what my content should be and how it is managed. Again, from the front end point of view with both Wordpress and Joomla, I find I either fight to get a decent template out of them or I am trying to bend an existing one. With PW I have complete freedom - so much so that I have now developed my own personal SASS development framework. But the main selling point for me and what I have been telling potential clients is that PW is a TRUE business class CMS, and as they have business needs, that should be their number one criteria. By the way, I don't make comparisons with Wordpress, I just present it as a fait accompli and simply speak about the functionality and the final presentation. It is only when they login that they even know it is something called processwire.
    1 point
  15. Make sure the image field is set to 1 image only, otherwise it will be an array. You have taken the right route to get to the image field, though you don't really need to set up a separate $rating variable. $page->classification->image_field, and then add ->url to output the url echo "<img src='{$page->classification->image_field->url}' alt='{$page->classification->title}'>";
    1 point
  16. Keep up the good work @apesia, I'm absolutely sure PadLoper will be the e-commerce solution of choice for everyone in here using Pw!
    1 point
  17. Getting closer to the release: please all you that are interested, subscribe into PadLoper newsletter to get early access invite and discount: http://www.padloper.pw/
    1 point
  18. I think hanna code makes the most sense here, but of course if you'd rather avoid that for some reason (maybe no other needs for it on the site, or whatever), you can always do your own replacement. Have your editors enter [[gallery]] somewhere in the body copy and then in your template do a simple: echo str_replace("[[gallery]]", $galleryCode, $page->body); You just need to define $galleryCode in your template code somewhere before the body is output.
    1 point
  19. Looks like they've completely changed it to the point where this module would have to be largely re-written. I'm looking into that. Is anyone already familiar with API v3 of Calendar?
    1 point
  20. When I need a calculated field that will be used for sorting, I like to add a hidden (or regular, doesn't matter) field to the template to store the calculated value. The value gets automatically calculated on page save. A hook like this in your /site/templates/admin.php can do the work for you: $pages->addHook('saveReady', function($event) { $pages = $event->object; $page = $event->arguments(0); if($page->template == 'rider') { $miles = 0; foreach($page->rides as $ride) { $miles += $ride->miles; } $page->miles_ridden = $miles; } }); Then when it comes to sorting, you just sort on your calculated field: miles_ridden. If you are adding this to an existing PW installation, then you'd need to establish the initial values for each rider's miles_ridden. This could be done with a quick bootstrapped script: /setup-riders.php <pre><?php include("./index.php"); foreach(wire("pages")->find("template=rider") as $rider) { $rider->save(); echo "$rider->name: $rider->miles_ridden miles ridden\n"; } Then you'd just load domain.com/setup-riders.php in your web browser, and then delete the file when done.
    1 point
×
×
  • Create New...