Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 08/18/2014 in all areas

  1. It's already very hard to do a good comparison between general purpose frameworks, like the ones you mentioned. What you see done a lot, is a "Hello World!" benchmark, where they measure stuff like requests per second and memory consumption, on the most basic configurations of the frameworks in the benchmark. Unfortunately, this doesn't say much about actual real-life applications and there are a lot more things to consider. Some of the newer frameworks like http://phalconphp.com/en/ show really great numbers (in fact, you could say that they blow the competition out of the water in a certain way). But it's not like everyone suddenly dropped the framework they use in favor of Phalcon. I would say that PW is a much more specialized framework, geared towards content management. PW also gives a nice admin interface application, built on top of the framework. If you would rebuild all of the functionality and power the PW API and admin gives you using some of the frameworks you mentioned then maybe you could make some kinds of representative comparisons. In general i think PW performs well. But if you start throwing around heavy and/or inefficient queries (using the api) things will slow down. So competent programmers/builders are important, but i think this is the case for whatever framework or CMS you use.
    5 points
  2. but if it has a single image in it, why do you try to select the ->first() ? I assume you have set the image field to allow only 1 image? Also, if you have set it proper to a single image field, it could be that you have a page without an uploaded image to that field. if($featured->Featured_Image) { echo "<img src=\"{$featured->Featured_Image->getThumb('thumbnail')}\" />"; } ------ Also my questions a post above was thought a bit different. I was trying to get you debug the output in your page, just above the line that raises the error. But I wasn't clear, so it doesn't . The error messages said that it isn't an object or the wrong object, so you can debug it to see what's going on. You expect it to be a cropimage field, therefore it should be an instance of type "FieldtypeCropImage". if($featured->Featured_Image->first() instanceof FieldtypeCropImage) { echo "\n<p>the Featured_Image->first() is a cropimage</p>\n"; } if($featured->Featured_Image instanceof FieldtypeCropImage) { echo "\n<p>the Featured_Image is a cropimage</p>\n"; } // imagefield is: FieldtypeImage Most collections in PW are based on WireArrays, so multiple images fields are too and you can look for that: // or checking for single vs multiple if($featured->Featured_Image instanceof WireArray) { echo "\n<p>it is multiple</p>\n"; } else { echo "\n<p>it is single</p>\n"; } You can also just dump a variable with var_dump($featured->Featured_Image->first()) to see what is in it, but that's mostly not very usefull in PW because objects in PW have way to many references to other objects so that var_dump results into very, very large outputs.
    3 points
  3. Looks like there's a problem with InputfieldPage. PageListSelectMultiple didn't originally support findPagesCode at all, until Ryan added that feature per my request -- but in that version it was actually broken and the fix was only introduced to dev branch. Since it's essentially a bug with with a module in wire directory, your options are .. a) using another input field type such as AsmSelect (works fine if you're only dealing with direct children of one page), b) using dev branch of ProcessWire (if this site is still a work in progress this might be a good idea anyway) or c) replacing /wire/modules/Inputfield/InputfieldPage/InputfieldPage.module with newer version of same file. Hope this helps a bit.
    3 points
  4. The concept A custom table module process (requires Jquery Datatables module by @soma) with configuration. Features: - Custom selector to find the pages. - Custom fields in columns. - Custom fields search. - Set the number of columns. - Create, View, edit, publish/unpublish pages. I´m working on it. Please correct my mistakes is my first processwire´s module have mercy Screenshots: The code: <?php /** * Administrador de Noticias * * Luis Santiago (blad) 2014 * ProcessWire 2.x * Copyright (C) 2012 by Ryan Cramer * Licensed under GNU/GPL v2, see LICENSE.TXT * * http://processwire.com */ class AdminCustomTable extends Process implements Module, ConfigurableModule { const adminPageName = 'AdminTable'; public static function getModuleInfo() { return array( 'title' => 'AdminCustomTable', 'summary' => 'Fully customizable administration table', 'version' => 110, 'permanent' => false, 'permission' => 'AdministrationTable', 'requires' => array("JqueryDataTables") ); } public function __construct() { $this->idparentnews = 'parent=1, include=all'; $this->campo1 = 'title'; $this->campo2 = 'body'; } public static function getModuleConfigInputfields(array $data) { $inputfields = new InputfieldWrapper(); $field = wire('modules')->get('InputfieldText'); $field->name = 'idparentnews'; $field->label = "Custom selector to find pages"; //$field->label = "Selector para encontrar las noticias"; //$field->notes = __('Selector para conseguir las noticias ejemplo: parent=1018, include=all .Se recomienda usar include=all para ver todas las páginas'); $field->notes = __('This selector will be passed to a $pages->find("your selector") Example: parent=1018, template=product, sort=name, include=all .Use include=all for publish/unpublish these pages.'); if(isset($data['idparentnews'])) $field->value = $data['idparentnews']; $inputfields->add($field); $field = wire('modules')->get('InputfieldText'); $field->name = 'campo1'; $field->label = "Custom field for first column"; //$field->label = "Selector para encontrar las noticias"; //$field->notes = __('Selector para conseguir las noticias ejemplo: parent=1018, include=all .Se recomienda usar include=all para ver todas las páginas'); $field->notes = __('Example: title'); if(isset($data['campo1'])) $field->value = $data['campo1']; $inputfields->add($field); $field = wire('modules')->get('InputfieldText'); $field->name = 'campo2'; $field->label = "Custom field for second column"; //$field->label = "Selector para encontrar las noticias"; //$field->notes = __('Selector para conseguir las noticias ejemplo: parent=1018, include=all .Se recomienda usar include=all para ver todas las páginas'); $field->notes = __('Example: body'); if(isset($data['campo2'])) $field->value = $data['campo2']; $inputfields->add($field); return $inputfields; } /** * Inicio del módulo * */ public function init() { $this->config->scripts->add($this->config->urls->AdminCustomTable . 'prog.js'); // $this->config->styles->add($this->config->urls->AdminCustomTable . 'style.css'); $this->modules->JqueryDataTables; } /** * Ejecución del módulo * */ public function ___execute() { $this->modules->get("JqueryFancybox"); $selector = $this->idparentnews; $campo1 = $this->campo1; $campo2 = $this->campo2; $noticias = wire('pages')->find("{$selector}"); $out = "<table id='mitabla' style='margin-top:20px; margin-bottom:20px;'> <thead> <tr> <th style='width:40%'>{$noticias->fields->$campo1->label}</th> <th style='width:50%'>{$noticias->fields->$campo2->label}</th> <th class='sin-orden' style='width:10%'>Actions</th> </tr> </thead> <tbody> "; $adminUrl = $this->config->urls->admin; $noticias->fields->title->label; /** * Nos deja buscar el id de la página * */ // if( $this->input->get->sSearch ) { // $q = $this->sanitizer->text($this->input->get->sSearch); // if (is_numeric($q)) { // $selector .= "id=$q,"; // } else { // $selector .= "title|body%=$q,"; // } // } /** * buscamos el selector * */ foreach($noticias as $noticia) { $out .= " <tr> <td>{$noticia->{$campo1}}</td> <td>{$noticia->{$campo2}}</td> <td> <a class='fancybox-iframe' href='{$adminUrl}page/edit/?id={$noticia->id}&modal=1'><i class='fa fa-edit'></i></a></br> <a href='{$adminUrl}page/delete/?id={$noticia->id}'><i class='fa fa-times'></i></a></br>" ; /** * botón de publicar-despublicar * */ if ($noticia->is(Page::statusUnpublished)) { $out .= "<i style='color:red' class='fa fa-square-o'></i>"; } else { $out .= "<i style='color:green' class='fa fa-check-square-o'></i>"; } $out .= "</td></tr>" ; } $out .= "</tbody></table>" ; return $out; } /** * Instalación * */ public function ___install() { $admin = $this->pages->get($this->config->adminRootPageID); $parent = $admin; $page = new Page(); $page->parent = $parent; $page->template = $this->templates->get('admin'); $page->name = "AdminCustomTable"; $page->title = "AdminCustomTable"; $page->process = $this; $page->save(); $this->message("You have installed AdminCustomTable"); if (!$this->permissions->get('AdministrationTable')->id) { $permission = $this->permissions->add('AdministrationTable'); $permission->title = 'AdminCustomTable permission.'; $permission->save(); } } /** * Desinstalación * */ public function ___uninstall() { $page = $this->pages->get('template=admin, name=AdminCustomTable'); $page->delete(); $permission = $this->permissions->get('AdministrationTable'); $permission->delete(); } }
    3 points
  5. Like a lot of people, processwire sites I work on started life in other CMSs like Joomla and Wordpress where they've outgrown the scope of CMS with clients asking for more and more bespoke content. For some of my clients, SEO is a big issue as we've spent year's building up these strong pages. When creating a new site in processwire the url structure can be vastly different from the original site meaning search engines will mostly have broken links damaging the sites ranking. There's many other techniques to achieve this such as using htaccess but that can become very complicated and way to complex for most clients to manage themselves so I use this technique. I create a template with two fields, title and redirect. 'redirect' is a page select field. The title must match the url of the old page and the redirect is as you might guess, the page to redirect to. You can build up the url with parent and child pages to match the old site url. My template looks like this: <?php /* * Template: redirectPage * * Used to redirect URL adress to other page with 301 HTTP code */ $session->redirect($page->redirect->url); ?> The 301 let's google know that the page has permanently moved. See here for their explanation. Then, just work your way through your pages and URLS. See this little screenomatic for a visual. Screenomatic youtube
    2 points
  6. Btw...yes you can; if that module comes with a permission (e.g. Batcher has a permission 'batcher')
    2 points
  7. Hey davo - nice work! I am curious - I think I might be missing something - what advantage does this have over apeisa's Redirects module? http://modules.processwire.com/modules/process-redirects/
    2 points
  8. here are some solutions for searching: google-custom-search...
    2 points
  9. You could set up a page field with a PageListSelectMultiple Inputfield Type - the user could choose the pages from anywhere in the page tree and sort as desired. Is that what you are wanting to do?
    2 points
  10. There is a plugin, but I'm also aware that a new version of the forum software is out in the next few months. Couple that with the fact that Google can't see hidden forums (for commercial modules) and I'm not sure it's the best solution. Still, there is a plugin for the forums that's a whole $6 so I might look into that, but there's also a built-in integration with Sphinx search to look into that might be more suitable. Lots of options - I just need to find time to look at them. And then there's the possibility that some people still won't search but we can keep steering them gently in the right direction
    2 points
  11. Hmm. I'd best get reading. Time to learn
    1 point
  12. It is definitely possible to set up a permission for modules. Actually, that might be a nice addition to the Redirects module. It's simply a matter of setting the permission required in the module config and then giving a role that permission. I was just going to suggest the batcher module. Here is how it is implemented: https://github.com/wanze/ProcessBatcher/blob/master/ProcessBatcher.module#L58 Then typically the module adds that permission when it installs. EDIT Perhaps you should make those changes to Redirects and submit a Pull Request!
    1 point
  13. Not a lot had I have found it first! The only advantage my method has for me, is the current site I'm doing has over 150 important links for redirection and I don't intend to do each of those myself. I share the content management jobs with the client's staff. My method means i can hand this job over to them without giving them access to other modules I wouldn't normally. Unless you can restrict user access to a per module basis?
    1 point
  14. @kongondo: sorry if this is unrelated (I don't have a proper test environment at hand right now) but sorting by dates is entirely doable using MarkupAdminDataTable too. It just requires a bit of extra work: prefixing actual, visible value with hidden, sortable value; something like yyyy-mm-dd etc. This is how I solved it in ProcessLoginHistory. Sorting multi-page values is another issue entirely, but as far as sorting visible results is good enough, no need to complicate things with new 3rd party components
    1 point
  15. I'm confused as to why you need *= . This should just work fine $pages->get("/places")->children("tags=foodID, tags!=accomodationID")
    1 point
  16. Does seem a tad slower though... Loaded up in just over 6 seconds this time around. Then again, yesterday's results were also a bit jumpy. First test was under 5 seconds, second test was as I mentioned before, and the third test was over 7 seconds... Nonetheless, load times are good enough, the way I see it.
    1 point
  17. This negative selector is for textfields. Also *= is for textfields. Maybe you are lucky and "!tags.title*=accomodation" works. Page fields work with ID's "tags=1233|1232" To search for a title within the selected pages you'd use a subfield selector "tags.title=abc"
    1 point
  18. Just want to share this with you guys, To commemorate the launching of our new website https://processwire.com/talk/topic/7170-ed-design/ we decided to share a title font that we used on one of our projects under the SIL Open Font License (OFL). The font is available for download as otf and as webfont package on our site here and open for collaboration on Github and Open Font Library (you can also embed it from there). If you like it, use it and enjoy
    1 point
  19. hi blad, thanks for sharing and congratulations on your first module! i hope i can also share my first module soon, but first i need a good use case / idea for it i think it would be great to stick to english in your comments - at least for me reading spanish is a real problem but anyway sticking to english is a good practise i think!
    1 point
  20. Absolute GENIUS!! K yes PageSelectMultiple is exactly what I want. Populate a box with a list of pages and be able to drag em around! So cool. Thanks so much for pointing this fantastic tool out. This is going to be so useful.
    1 point
  21. Enter all the heights as pages and make a Page field that renders as a Select field would be my suggestion. I think you've used Page fields before so I'm a little confused by the question as you're almost answering it as you're asking it if you see what I mean?
    1 point
  22. https://processwire.com/talk/topic/4680-block-access-to-settings-delete-and-view-tabs-for-page/
    1 point
  23. @diogo - I see, great stuff Works great. In terms of speed, from here in SA, an initial complete reload took 5.92 seconds over 34 requests, including render-time. DOMContentLoaded (before assets) was 1.41 seconds.
    1 point
  24. (This discussion is moved here from the GitHub issues board) The discussion ended by considering of moving the admin language files to a module (maybe even aware if the translations are for the regular version or the DEV version of ProcessWire). You comments and ideas are highly appreciated! --- DISCUSSION SUMMARY FROM GITHUB: tbba (ceberlin) wrote Today I had the honour to remove admin language translation files from the default language to have that back to English. That ment clicking the trashcan a 500 times while paying attention not to remove anything else but those admin language files. (Well I ended up doing this in the database directly as a workaround.) For the Wishlist: Why not adding a button where all instance that start with "wire--" have the trashcan seleced automatically. Or better: I would prefer at least to have them in a separate repeater list so that I find my own frontend translations and those settings by site--modules like supersmartypans easier. Or even better: why not separating Admin translation files to a module somehow so that installing/de-installiing, updating(via ModulesManager!) and switching them on and off is much easier? ryancramerdesign commented Double click the trash can and it'll mark them all for deletion. tbba (ceberlin) commented Thats cool. I did not know that. There is still the possibility of deleting too much (site-- stuff). What about the idea to separate the site-- files from the wire-- files? Wouldn't that be much easier? EDIT: And a module for the wire files would make the updates over the modules manager so easy. No more dropping of tons of files - and alerts when they are outdated. NicoKnoll commented I think it probably really makes more sense to change language packages to modules which are requiring "Language Support" to be installed. Pros: easy updatable makes my module "LanguageInstantInstall" obsolet because you just could list al of the languages which are in the module directory with "module manager" It's more the ProcessWire way of being modular Cons: How to add custom translations for e.g. modules?Maybe that's something for 2.6. tbba (ceberlin) commented A module would have another advantage: There could be something implemented that matches the translations to the PW version. Right now, using the DEV version could mean: not matching translations. But - thinking loud - there could be a DEV version of the language files on GIT that then matches with the PW DEV version - and the module selects the right one. ryancramerdesign commented I agree, language packs as modules would be nice for the future. Like Carl mentioned in splitting site and wire files, perhaps language pack modules would be for wire, and the existing storage system could be exclusively for site.
    1 point
  25. This needs to go on a tut somewhere then
    1 point
  26. "Komodo Edit" (not Komodo IDE) is a free Editor (OSX, Win, Linux) that supports FTP-Remote editing too: http://komodoide.com/komodo-edit/
    1 point
  27. Dear All, If one defines "Enterprise" as an environment of mission-critical websites that make money for a corporation, then I am already using ProcessWire in that fashion. My day job is as a Web Director for a New York magazine publisher that owns around fifty+ magazines. We have over 25 Linux and Windows servers, which I manage. I also write custom web database applications for the company, and recently wrote a "Web Help Ticket System" using ProcessWire. The ticket system receives its initial input via email, which gets piped to a PHP script, parsed, and then input into the ProcessWire help database. The script then emails the responses to various individuals that are in the database. I've created a front-end staff interface, with usernames and passwords, that displays the tickets and allows editing, searching etc. It's been running for a number of months, with tickets sent in from Editors, etc. So far, it's proven to be very robust. This is just one example of what I would call an Enterprise level web application, built using ProcessWire as the CMF. Of course, someone else may define it differently. I want to note that I had initially looked at Drupal for this purpose. I'm not yet a "Drupal developer" -- I just haven't spent enough time with it. But after spending *some* time with Drupal, and after seeing that many magazine sites that use Drupal seem over-heavy and bloated, I have to say that ProcessWire is lean and mean and fast and a complete joy to work with. It does have a learning curve, but I think it's less than Drupal's learning curve. (That would be a good survey.) I say that because once you wrap your head around PW's method of one data table per field and its "virtual data tables" (aka templates or field sets), then it becomes a piece of cake to use the API and PHP as the template language. The sky's the limit in terms of ProcessWire's power and flexibility. PW might seem arcane at first, but I don't really think it is, except for the table structure, and that ends up making sense after one digests it. I also built a complex, formula-based business app with PW, at http://thepivotstartup.com (in the members section). It allows entrepreneurs to plug in numbers about their business ideas and vet them, to see if they might work in the real world. Finally, I use ProcessWire as my own CMS, at http://significatojournal.com. My wife, who is a writer, but non-technical, does most of the article posting, using PW's admin back end. She finds it very simple to use. I don't need ProCache yet, but when I do, it seems to me to be a brilliant caching mechanism, since it dynamically writes each generated page to flat HTML files, and then uses clever .htaccess rules to serve them up. Because of all of the above, I would recommend ProcessWire for mega websites, and in fact, if it was "my do", I would build and/or convert many of the magazine sites that I manage in my day job to ProcessWire. I'm completely confident that PW would do as good a job as WordPress and Drupal, which the company currently uses. I believe that the reason that PW hasn't been adopted in the enterprise isn't support, but rather the lack of market share, mind-share, and enough usage for Big-Iron websites to prove to companies that they'll be safe using PW. I don't think Enterprise support is really the issue. We had one CMS, called "Nstein" and another called "Ekron" that both had expensive support packages. We left both behind with great sighs of relief. We use Drupal, WordPress and DotNetNuke, without any support contracts. All that matters is the confidence that: a) we can find developers who use it, and b) there are enough examples of high-powered, high-volume, Big-Iron sites that use it successfully. I think "B" is the real kicker. I read a Fast Company article about Drupal serving up hundreds of thousands of pages, and then recommended it to our VP. But, I wish PW had been around back then. That's the PW challenge, I think. Convince some VERY high-level, well know companies to make huge, heavily trafficked websites with PW, and then other folks will say, "Hey! Look at that! Let's use ProcessWire!" And then it shall be done. Peter
    1 point
  28. Can you please comment/reopen this issue or open a new issue on Github?
    1 point
  29. As you define the sizes by yourself when setting up a field, you may add this manually into the template code where needed. But you can also get it programmatically like interrobang has done it here: https://processwire.com/talk/topic/4437-delete-orphaned-filesimages-from-siteassetsfiles/#entry43750 search for this lines: $crops = $field->getArray(); $crops = $crops['thumbSetting']; $crops_a = explode("\n", $crops); // ie. thumbname,200,200 (name,width,height)
    1 point
  30. This subject is already been discussed so many times before and still has repeat = on. Don´t try to bring pw to the level where you want to use it. Instead bring your self to the level of pw and do what you want. Processwire is designed that way and maybe Ryan should put that somewhere clear during a pw install to set repeat = off.
    1 point
  31. I added a toolbar to profile the performance of partials/layouts. Check out the attached screenshot to see what it looks like when the toolbar is open, by default it collapses to just display the totals.
    1 point
  32. I came across this Wordpress Plugin which has a similar feature to what I was referring. The ability to search/filter without leaving the tree looks useful. Check out the video to see it in action: http://eskapism.se/wordpress/cms-tree-page-view/ What do you think?
    1 point
  33. I have several sites where existing InputFields for Page fields won't quite cut it. (asmselect, page autocomplete, etc) We have good options for searching by keyword (page autocomplete), good options for browsing (asm, page list select), The part that's missing is the combination of search and browse together, where you get more than just page titles as a result and where it's easy to select many results from the search. I'd like to build something that returns a grid of results, each row with a checkbox, with an option to select all, and the ability to shift-click and ctrl-click to select multiple items. There must be a jQuery grid that would be suitable for that. Maybe a read-only handsontable that kongondo and wanze are working on.For the search field part, I was thinking it would default to a normal keyword search, but would detect and accept a PW Selector string to get really granular results. landitus - does that sound like it would meet your needs as well? Any other ideas?
    1 point
  34. 1 point
×
×
  • Create New...