Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 03/09/2017 in all areas

  1. TLDR: Buy ProFields I don't understand why that brief list of fields is a "mess and a nightmare". I know the general advice given is to reuse fields where possible but I think people sometimes take this suggestion a bit too seriously. Create the fields you need and forget stressing about whether you have perfectly optimised the reuse of fields. If you have less than, say, 100 fields in your site you really have nothing to worry about. I think I saw a post recently where Lost Kobrakai was talking about a site of his with over 800 fields. But ProFields... You mention client editing experience, so I take that to mean you (like me) earn an income from developing websites. With that in mind here are some things to consider when making your decision whether or not to purchase ProFields... Have you thought about how lucky we developers are that we can earn an income with virtually no overhead costs? With so much fantastic open-source software made available to us at no cost we are in a very fortunate position. We could design and develop websites entirely with free software if we so choose. Hell, if we wanted we could go to the landfill and probably pick up a free old computer that would be perfectly adequate to develop a website on. Now think about the carpenters and dentists and all those other professions that must purchase real physical tools (that wear out) in order to earn a living. £100 doesn't go very far if you need to buy a table saw. On the topic of open-source, think about what Mr Ryan Cramer has provided us with in ProcessWire. People with his level of skill do not need to be contributing their time for free to open-source projects - they are in very high demand for all kinds of lucrative work. Purchasing a Pro module from Ryan is a way to show appreciation for the generous work he puts into PW. PW is not just great free software, it is great software full-stop. You mention previously having worked with Drupal and Craft CMS. Time is money, so think of all the money you have saved by the quick development workflow that PW allows vs Drupal. And Craft CMS costs USD$299 per website and is still not as powerful as the PW core. Ryan's Pro modules are insanely good value for money. The price that you can purchase a dev license that allows you unlimited use of the modules is more than reasonable. For comparison, here is one of the most popular addons for Concrete5: http://www.concrete5.org/marketplace/addons/block-designer-pro There is no unlimited license, and a license for 5 installations costs USD$276.25. And it requires "Block Designer" so that's another USD$120 for 5 installations, bringing the cost to USD$396.25. I haven't used it but it looks like it is basically the equivalent of Repeater Matrix. But probably not as elegant. And with ProFields you get another four modules bundled in. For unlimited use. For USD$129. Hope this has helped make the decision a little easier.
    5 points
  2. I don't want to live without ProFields anymore! If your fields have all the same requirements then ProFields Textareas is your friend. The name a bit misleading, because it covers more than just Textareas. Also oneline inputs and more(Email, Datetime...). Imagine 10 or more input type text with different sizes, titles and notes, all grouped together but just a single database field! My clients love it! And so do I. RepeaterMatrix is a work of art in itself. Those two fields alone are worth every Penny/Cent/CurrencyOfChoice!
    5 points
  3. I thought I would just pop by to say how much fun I am having. I don't really get the chance to put websites together at the moment for some complicated reasons, but I have put some days aside to nail together a new blog about something. And I have thoroughly enjoyed it. Especially all the little tweaks I have been making. For instance, I want the layout on the front page to be very neat, but that means the titles of articles have to be a certain length, as do the summaries and the images, where they are available. That particular constriction doesn't necessarily work in other areas of the site. With PW, the answer is dead simple. TWO title fields, both with the counter switched on and a little note reminding me of the ideal length. I also have two summary fields for the same reason. I have a similar thing with images. I have made up a Photoshop template with Artboards for all my various image sizes - featured image, summary image for the front page, story images for the article, sidebar images and the SEO image. Of course, the fact that I can have an assortment of images in my PW template means I can take advantage of this PS template. And, because some articles just don't have an image, I have a little note telling me to write a longer summary if there is no image. Oh, and a bit of PHP that looks for the short title and uses the long one if I forgot to write a short one ... and so on. I know this is all mundane stuff compared to some of the cleverer functionality Ryan and the various mod devs are coming up with, but for me, it is this simpler versatility that makes Processwire so powerful. That I can just shove in another field to get around a certain problem and bring it up as an alternative with one line of PHP makes sites a joy to develop. Enough so that I actually spent a happy hour today neatening up my code, indenting it nicely and putting helpful little comments everywhere. I didn't need to do it, but I have worked so much faster than I could have with any other system, I had the time - so I had my little bit of fun.
    3 points
  4. No mockery from this group. We're here to help. If you have a statement comparing two conditions (eg. variable to1037, and variable to 1038) then there are four possible combinations: FF FT TF TT. Basically, for every n elements there are 2^n possible outcomes. Example 1. If you want to perform a conjunction (AND) then the statement is true only when both components are true, as follows: Assume $page->id = 100 IF ($page->id !== 1037) AND ($page->id !== 1038) THEN TRUE Example 2. If you want to perform a disjunction (OR) then the statement is true when either component is true, as follows: Assume $page->id = 100 IF ($page->id !== 1037) OR ($page->id !== 1038) THEN TRUE The problem you are experiencing is wanting to use the disjunctive case, as in Example 2. Because when the $page->id does not equal one of the test values (1037 or 1038) the result will also be true, which is not the desired outcome. Hope this helps.
    3 points
  5. We have ListerPro's with 10.000's of pages (some up to 80.000 pages and counting) displaying 25 fields. Just make sure to limit/paginate around 50 or 100. Still quite fast (around 3 seconds loading time). This includes all kinds of Markup changes. So I would say: yes
    3 points
  6. In Soma's tutorial he covers the $options array - does setting 'forceDownload' to false achieve what you want?
    3 points
  7. @PWaddict I also think you shouldn't use javascript, instead do the formatting on the server. I feel I wouldn't trust the JS solution because it might not work as expected under certain circumstances. I put together a regular expression which might help you build another Textformatter which replaces "src" with "data-src" if thats the only thing to do: Have a look at the demo here: http://www.phpliveregex.com/p/jkp (On the right, click on preg_replace to see the replacement.) This is the code: <?php preg_replace("/(<iframe.*)src(.*)(youtube|vimeo)/", "$1data-src$2$3", $input_lines); (During my research I learned from: http://stackoverflow.com/questions/4898192/preg-replace-how-to-replace-only-matching-xxx1yyy-pattern-inside-the-selector) Hope that helps, if you need more advice you can also DM me and we will post the result later - cheers! PS: Or like @tpr mentioned you may put that modification directly into a copy of TextformatterVideoEmbed. That way you would have more control. (TextformatterVideoEmbed itself gets the embed code from an oembed url, so you can't easily intercept there ...) PPS: Oh, actually a simple str_replace("src=", "data-src=", $embedCode) in a copy of TextformatterVideoEmbed might actually be sufficient!
    3 points
  8. OR AND 1037 F T F T F T F T 1038 F F T T F F T T F T T T F F F T
    3 points
  9. It's those little things where you find some elegant, succinct way to do exactly what you want that make development so satisfying. The only frustrating thing is that unless you work in an office of fellow code nerds you don't get to share those "nailed it" moments. Like, in your home office you call your loved one over and gesticulate enthusiastically at the screen but they're all...
    2 points
  10. @MilenKo, my tip is that if you want to really accelerate your learning of ProcessWire and PHP the single most important thing you can do is install Tracy Debugger and start dumping variables. Whenever you are confused or curious about something, dump it and explore it in the debugger. Installing Tracy also makes sure you are seeing PHP errors when they occur. If you dump $page->recipe_rating you will probably find out where you are going wrong.
    2 points
  11. PHP doesn't let you use dashes/hyphens in variable names. Either $ground_equipment or $groundEquipment will work.
    2 points
  12. New Version 1.0.4: @Robin S use label tag if it isn't a multilangual site @jploch, @adrian changed hook InputfieldFile::processInputFile to InputfieldImage::processInputFile
    2 points
  13. https://github.com/benbyford/subscribers it probably needs some changes and updates. I've been using it with a client and building alot on top. I havent heard much from other people using it hence no new updates - but i would be keen to here from people wanting to use or contribute.
    2 points
  14. Ah @Robin S, you are a gentleman and a scholar... I missed this... thank you!
    2 points
  15. Ping @benbyf - see the above discussion about your Subscribers module.
    2 points
  16. I don't think this is a good solution. By the time your Js runs the iframe may start to load so making it useless. I think it would be better to edit the module itself, and maybe rename the module to avoid overwrite it later when updating. Or even better, submit a PR with a new setting for lazy load
    2 points
  17. @Robin S - I just committed a new version with the template restriction options. Let me know if you have any problems. Cheers, Adrian
    2 points
  18. Hi @Robin S - You're right, there is no option to not show it in an iframe. I am definitely happy to add an option for selected templates though. I'll see what I can do about getting this done for you tomorrow.
    2 points
  19. This is true. It starts to get a little more complex but with a few more steps you can filter out the non-public pages: $field = $fields->get('my_options_field'); $table = $field->getTable(); $query = $database->query("SELECT data, pages_id FROM $table"); $results = $query->fetchAll(PDO::FETCH_COLUMN|PDO::FETCH_GROUP); // get multidimensional array of results $results_page_ids = array_unique(call_user_func_array('array_merge', $results)); // get all the unique page IDs in the results $public_ids = $pages->find(['id' => $results_page_ids])->explode('id'); // find out which ones are public $filtered_results = []; foreach($results as $option_id => $page_ids) { // remove any page IDs that are not public $filtered_value = array_filter($page_ids, function($value) use ($public_ids) { return in_array($value, $public_ids); }); // for each option, count the public pages it is selected on if($filtered_value) $filtered_results[$option_id] = count($filtered_value); } arsort($filtered_results); // sort highest to lowest $all_options = $field->type->getOptions($field); echo '<ul>'; foreach($filtered_results as $option_id => $count) { $option = $all_options->get($option_id); echo "<li>{$option->title} ({$count})</li>"; } echo '</ul>';
    2 points
  20. v0.0.4 released. Adds config option to remove clone button.
    2 points
  21. What Adrian said. You need &&. Try it, it will work . If page ID is not 1037 AND it is not 1038 AND it is not 1039.....
    2 points
  22. Here are some preview screenshots from my pimped out version of this module... 1) Added the placeholder and collapsed attributed to the fields editor: 2) allow export of the fields setup, as well as restore, so that you can take huge sets of fields and import them into a site. 3) ability to export/backup the settings values themselves, as well as restore them from backed up json. still need more testing, but so far these things help make this module more usable; also i changed the default global api variable to g_settings, to avoid the conflict with Lister Pro.
    2 points
  23. A quick tutorial how to create file downloads using pages You will be able to create a new page using template "PDF" (or any you setup), upload a pdf file. You then can select this page using page fields, or links in Wysiwyg. The url will be to the page and NOT the file itself. This will allow to keep a readable permanent unique url (as you define it), unlike /site/assets/files/1239/download-1.pdf, and you'll be able to update/replace the uploaded file without worring about its filename. Further more the file will also have an id, the one of the page where it lives. Clicking those links will download or open the file (when target="_blank") like it would be a real file on server with a path like /downloads/project/yourfile.pdf. You'll be also able to use the "view" action directly in the page list tree to view the file. Further more you'll be able to esaily track downloads simply by adding a counter integer field to the template and increase it every time the page is viewed. Since the file is basicly a page. This all works very well and requires only minimal setup, no modules and best of it it works in the same way for multi-language fields: Just create the language alternative fields like "pdf, pdf_de, pdf_es" and it will work without modifying any code! Still with me? ok PW setup Download folder: Create a template "folder" or "download-folder" with only a title needed. Create pages in the root like /downloads/project/ using this template. Setup the template for the pdf files 1. Create a new template in PW. Name it pdf 2. Goto template -> URLs tab and set the URL end with slash to no. (So we can have /path/myfile.pdf as the URL) 3. Create a new custom file field, name it pdf. Set its maximal count to 1 under -> Details tab. 4. Add the pdf field created to the pdf template. Easy. 5. Create a new "pdf" page using the pdf template under a download folder you created earlier. 6. Give it the title and in the name field add ".pdf" to the end (could also leave as is) Template PHP file for the pdf files 1. Create the template file pdf.php in your /site/templates folder 2. add the following code: <?php // pdf.php if($page->pdf){ wireSendFile($page->pdf->filename); } Done. To see the options you have with PW's wireSendFile() you can also overwrite defaults <?php // pdf.php if($page->pdf){ $options = array( // boolean: halt program execution after file send 'exit' => true, // boolean|null: whether file should force download (null=let content-type header decide) 'forceDownload' => false, // string: filename you want the download to show on the user's computer, or blank to use existing. 'downloadFilename' => '', ); wireSendFile($page->pdf->filename, $options); } Simple and powerful isn't it? Try it out. Some thoughts advanced Create as many file types as you like. It might also be possible to use one "filedownload" template that isn't restricted to one field type but evaluate it when being output using $page->file->ext, or save the file extension to the page name after uploading using a hook. One last thing. You can add other meta fields or preview images to the template and use those to create lists or detail pages. It's all open to goodness. Again all without "coding" and third-party modules. Further more you can use the excellent TemplateDecorator to add icons per template and have a nice pdf icon for those pages. This as a base one could also easily create a simple admin page for mass uploading files in a simple manner, and create the pages for the files automaticly. ImagesManager work in the same way. Cheers
    1 point
  24. @ridgedale 1. check the URLs tab 2. you might be using delayed output, the template files are used to set some variables which are later echoed in another file included at the end of the template file Something like this <?php $header = "<header>...</header>"; $content = "<div class='content'><h1>{$page->title}</h1><div>{$page->content}</div></div>"; $footer = "<footer>...</footer>"; // echoing something here will display above the header include ("main.php"); The main.php file <?php // here we echo the variables set in the template file echo "<html><body>..."; echo $header; echo $content; echo $footer; echo "</body></html>"; 3. $stories = $page->children("limit=6, sort=-date"); the above takes the 6 latest child pages of the current page, so on pages using the news-index.php template it gets the 6 latest child pages . https://processwire.com/docs/tutorials/
    1 point
  25. Thanks Adrian - that solved the problem of the syntax error.
    1 point
  26. @Robin S Ok, back to the form builder issue. Please try out the attached version. I want to test myself a little more today before committing because I had to move a few things around to get this working. Please let me know how it goes. TracyDebugger.zip
    1 point
  27. 1 point
  28. Thanks @Robin S - I am bad at remembering that New version should fix everything and should also take care of that extra "\/" that you saw at the start. Can you please confirm that your CaptainHook panel output now looks like this - note the "Site Modules" (along with "Wire Core" and "Wire Modules" section headers) and the way the files now start with just their main folder, eg: AdminCustomFiles/AdminCustomFiles.module compared with the old: /site/modules/AdminCustomFiles/AdminCustomFiles.module I think this new way makes it much easier to scroll down to find what you are looking for. Regarding FormBuilder - yes, I use the forms API. I'll see what I can do about figuring out what the issue might be with the template detection shortly. I have a hunch that it's related to the way I am getting the template of the page - because I am in ini() and not ready() when I need to do this, it's a bit of a hack
    1 point
  29. I'm interested in the near future I will need something like this and I will be happy to help as much as I can.
    1 point
  30. Oh wow... Never knew there were filters in the backend.Thanks! Makes my life a whole lot easier!
    1 point
  31. Thanks @tpr & @blynx for the help. I replaced the 129 line of the module with this and it's working: $out = preg_replace("/(<iframe.*)src(.*)(youtube|vimeo)/", "$1data-src$2$3", $out); $out = str_ireplace('<iframe ', "<iframe class='lazyload' style='position:absolute;top:0;left:0;width:100%;height:100%;' ", $out); BUT on some fields I'm using the TextformatterMakeLinks module and the videos on that fields aren't loading cause it adds the video links with href inside of data-src.
    1 point
  32. Seems like the "class" attribute is the culprit, I guess there's some regex going on later somewhere but haven't checked. Could you try replacing this line with this? It seems to fix the issue in all 3 themes. $event->return = "<span data-pid='$page->id'>$markup</span>";
    1 point
  33. I think your time would have been better spent persisting with FieldtypeRate, which seems to be exactly what you are looking for. I installed it to test it and it works straight out of the box, so not sure how you have been going wrong. Just echo the field as per the documentation: echo $page->my_rating_field; // of course change this to the name of your ratings field There is a small error in the module code that will generate a PHP notice but it is an easy fix - delete line 66 as it looks like it is an accidental leftover from the FieldtypePoll that the module is based on.
    1 point
  34. Are you sure you don't want && rather than ||
    1 point
  35. Interesting module. Maybe a replacement for my module in the (near) future
    1 point
  36. There is another members register/login module here? http://modules.processwire.com/modules/subscribers/ https://github.com/benbyford/subscribers
    1 point
  37. I <3 PW but I'm definitely not in love with PHP
    1 point
  38. @Macrura You might not need the json export/import functionality anymore. See this new module
    1 point
  39. This is amazing and so easy to skin, I noticed a few CSS errors, I will put them on GitHub Great work Ryan!
    1 point
  40. Just be careful not to build a mystery meat navigation.
    1 point
  41. I less than question php... as long as ProcessWire is written in it .
    1 point
  42. $page->blocks->render() will output the content of the selected blocks page based on its template. Does that do what you need?
    1 point
  43. Thanks @Macrura for the info. I can live without such a module, but I see that it can be helpful in order to simplify things so I might start using it as it looks useful. I prefer modules being maintained, so I'm a bit cautious in cases like this, and that is why I'm happy to see you improving it
    1 point
  44. @szabesz i think it is fine to use, i first tested it on localhost, and then i started using it on 3 new sites; i did change the module to not use the 'settings' global variable though before installing it, because as far as i can tell, it somehow actually causes the listers in lister pro to all lose their settings; have not tested extensively yet, so i don't know if it happens only if you load the listers... i will most likely fork the module and then change out my new versions... there are still some things to iron out before it could be considered really stable, with the fields and settings import features..
    1 point
  45. Hello, If you use this module, you may be interested by my fork https://github.com/jlj/MarkupTwitterFeed, that adds the following features to the official MarkupTweeterFeed module: support of the recent Twitter extended tweet format (tweets longer than 140 chars); support of emoji characters in tweets; display of image in a tweet (only the first image is displayed in the curent version); display of video in a tweet (with a html5 video markup); for retweets, display of the original author and avatar in the tweet. Also, it allows a more flexible per-item rendering, as in the following example: $t = $modules->get('MarkupTwitterFeed'); $t->limit = 10; $renderOptions = array( 'showDate' => 'before, after', 'dateFormat' => __("M j, Y"), // Tweet block date format 'listItemOpen' => "\n\t<div class='tweet-item'>", 'listItemClose' => "</div>", 'listItemText' => "<i class='fa fa-twitter'></i> <span class='tweet-text'>{text}</span>", 'listItemDate' => " <div class='date'><i class='fa fa-calendar'></i> {date}</div>", 'listItemLink' => "<a rel='nofollow' href='{href}'>{url}</a>", 'videoAttributes' => "autoplay loop muted", 'preserveLineBreaks' => 'coalesce', ); foreach($t as $tweet) { echo $t->renderItem($tweet, $renderOptions); } Examples from my website: This module has been tested with pw 2.7.2 only, so I cannot guarantee the proper working with 3.0… Hope this will be useful for others here.
    1 point
  46. Hi @titanium, You might want to consider doing it in a different way, by creating field+pages for such settings, for example like this: http://processwire-recipes.com/recipes/create-custom-admin-settings-page-link-in-admin-menu/ Quite a different approach for sure but it might work for you.
    1 point
  47. Hi Kai, I don't see any requirements here that is not manageable by ProcessWire, the only limit will be knowledge of PHP. 1. You could implement OAuth easily with 3rd party libraries or integrate each provider's API into ProcessWire. 2. You can manage users by using API and/or by playing with roles, permissions into ProcessWire backend. 3. Yes - very easy, for example, you can just use "pages" and page filedtype for relations. 4. Yes - by playing with urlSegments. 5. Yes - you can implement this feature easily + there are one or two modules which might help you to achieve that. 6. Yes - you have to implement it. 7. Yes - by using the API . 1. Yes 2. Yes 1. Yes (hooks come to my mind). 2. No problem at all. 3. From what I've read on the forum, I want to say : superfast. (ProCache)
    1 point
  48. I had several clients request a version of this module that honors the aspect ratio of a video when using the responsive embed method. For now, the module is using a hard-coded 16/9 ratio. I decided to give it a go myself and forked Ryan's repo. I added functionality to calculate a video's aspect ratio from the oEmbed return values for width and height and made a change to the module's custom db schema to save the aspect ratio. In the (improbable) case the aspect ratio can't be determined, I added a fallback aspect ratio to the module's config. After looking around for a bit, this post about db schema updates for modules with custom databases provided excellent examples on how to handle the schema updates for existing installations. The changes have been tested on several live sites (3.0) and the update went without hiccups. If anyone's interested, here's the commit: https://github.com/[...]/commit/76e9a5e7bba79aef8fae35aaa7a1b7b79e970f90 I'd love to get some feedback on this! Especially from people running this on the 2.7 or 2.8 branch. If all works well, it'd be great to integrate this into @ryan's official repo at some point.
    1 point
  49. http://webdesign.tutsplus.com/tutorials/a-beginners-introduction-to-writing-modules-in-processwire--cms-26862 Based on work from here:
    1 point
×
×
  • Create New...