Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 02/14/2019 in all areas

  1. The TracyDebugger module and Processwire was mentioned on the PHP Weekly email newsletter http://www.phpweekly.com/archive/2019-02-14.html - It was the last thing mentioned at the bottom.
    9 points
  2. You can try this (temporarily) https://easyengine.io/tutorials/php/increase-script-execution-time/ or this https://modules.processwire.com/modules/tasker/ together with https://github.com/mtwebit/DataSet/ (and of course, you could split it up into smaller chunks...)
    4 points
  3. Just an quick note... Building a web app using processwire as backend serving JSON via an API to VUE. Works very well... just wondering about performance compared to Laravel or something similar. But at this stage the knowledge I have of Processwire is such an advantage that allows me to work really fast. Would absolutely recommend using it for prototypes... you can always migrate later on to another backend and you can keep the front-end exactly as it is.
    3 points
  4. Hi folks! I just released a new major (2.x) version of the module. Important things first: This version includes backwards compatibility breaks. At the moment, only Twig and the bundled ProcessWire engine work with the 2.0 version. I will now contact maintainers that implemented other engines (Pug, Jade etc.) and ask them to release a 2.x version as well. The 1.x version of the module is still available on the 1.x branch and continues to exist. So why a version 2.x? Basically it's the same concept, but done in the right way. ? The rendering via template engine is now integrated correctly into Page::render(). You can call the render() method on any page, and the module will render it via template engine. In version 1.x, this is only true for the current page. Automatic page rendering is now optional, you can use the module to only integrate a template engine, without hooking into Page::render at all. There are settings to enable/disable the automatic page rendering for templates. Because there might be templates where Page::render should not be replaced. The module provides hooks to customize it for your needs. I wrote a bunch of unit tests and use Travis for CI. Problems like "the 404 page is not displayed if a Wire404Exception is thrown in a controller" are now tested properly. I am writing a documentation on everything, you can read it here: https://github.com/wanze/TemplateEngineFactory/blob/master/DOCUMENTATION.md One important part is how to update from 1.x to 2.x. Depending on the feature usage of the module, this might involve some manual update steps, because the public API changed. If you try to update, please let me know about any issues you are encountering, so that we can add them to the documentation. Don't worry, you do not have to update, as the 1.x version continues to exist. For a new project, definitely start with 2.x! Last but not least, modules providing template engines must be updated too, but this should be quite easy. For Twig, I decided to support installations only via Composer, and I think that this should be the way to go for the other modules. 3rd party dependencies must be manageable in a reliable way, and Composer is the right tool for this job. Cheers
    3 points
  5. @gmclelland With AOS PageListTweaks you can add "{title} [em.my-template-class]{template.name}[/em]" to a template's "List of fields to display in the admin Page list" and they are shown only in the page tree and not in the breadcrumb dropdown. Note that this requires editing every template so it may not be the one you need. @Robin S I have some pages without title and they show up in the breadcrumb menu like this: I know it's not a common thing but apparently PW saves the page even if you don't fill the title, so the page name could be added as a fallback ($page->get('title|name')). Perhaps such pages could be surrounded with eg. square brackets to indicate that it's the name and not the title.
    2 points
  6. wire('log')->save("shopify", "collections = " . print_r($collections, true)); You missed the second parameter of print_r which instructs to use the return value rathern than echoing. http://php.net/manual/de/function.print-r.php
    2 points
  7. @flydev The module is registered and waits for approval ☺️
    2 points
  8. From which century is that site exactly? They sure could use a graphic designer ?
    2 points
  9. Check the .sql file that's in your PW site profile. There might be date ranges similar to 0000-00-00 00:00. Change them to something like 2019-01-01 11:22. Then go to your phpMyAdmin or whatever tool you use in your setup and delete everything in your database. Either import the .sql file manually or try another clean install. I have had that issue before with several profiles created with the Site Profile Export module I wanted to set up locally (within Laragon). Maybe that's similar to your case and setup even though you are using MAMP.
    2 points
  10. Have you tried hooking page::cloned()?
    2 points
  11. I added support for this in v0.1.16
    2 points
  12. Thank you. ? My solution was to include a script for converting PHP to ICS, if you visit the event template with the URL segment "/download/". Tricky was to format all data for the ICS format. Here is my version of the script mentioned above: <?php namespace ProcessWire; // Variables used in this script: // $summary - text title of the event // $datestart - the starting date (in seconds since unix epoch) // $dateend - the ending date (in seconds since unix epoch) // $address - the event's address // $uri - the URL of the event (add http://) // $description - text description of the event // $filename - the name of this file for saving (e.g. my-event-name.ics) // // Notes: // - the UID should be unique to the event, so in this case I'm just using // uniqid to create a uid, but you could do whatever you'd like. // // - iCal requires a date format of "yyyymmddThhiissZ". The "T" and "Z" // characters are not placeholders, just plain ol' characters. The "T" // character acts as a delimeter between the date (yyyymmdd) and the time // (hhiiss), and the "Z" states that the date is in UTC time. Note that if // you don't want to use UTC time, you must prepend your date-time values // with a TZID property. See RFC 5545 section 3.3.5 // // - The Content-Disposition: attachment; header tells the browser to save/open // the file. The filename param sets the name of the file, so you could set // it as "my-event-name.ics" or something similar. // // - Read up on RFC 5545, the iCalendar specification. There is a lot of helpful // info in there, such as formatting rules. There are also many more options // to set, including alarms, invitees, busy status, etc. // // https://www.ietf.org/rfc/rfc5545.txt $filename = page()->name . ".ics"; // 1. Set the correct headers for this file header('Content-type: text/calendar; charset=utf-8'); header('Content-Disposition: attachment; filename=' . $filename); // 2. Define helper functions // Converts a unix timestamp to an ics-friendly format // NOTE: "Z" means that this timestamp is a UTC timestamp. If you need // to set a locale, remove the "\Z" and modify DTEND, DTSTAMP and DTSTART // with TZID properties (see RFC 5545 section 3.3.5 for info) // // Also note that we are using "H" instead of "g" because iCalendar's Time format // requires 24-hour time (see RFC 5545 section 3.3.12 for info). function dateToCal($timestamp) { return gmdate('Ymd\THis\Z', $timestamp); } // Escapes a string of characters function escapeString($string) { return preg_replace('/([\,;])/','\\\$1', $string); } // 3. Echo out the ics file's contents ?> BEGIN:VCALENDAR CALSCALE:GREGORIAN VERSION:2.0 PRODID:-//Stadtkirche Pforzheim//NONSGML ProcessWire//DE <?php if (page()->template == "event"): $summary = page()->getUnformatted("headline"); $dateStart = page()->dateStart; $dateEnd = page()->dateEnd; $address = page()->place->getUnformatted("title"); $uri = page()->httpUrl; $description = strip_tags(page()->getUnformatted("summary")); ?> BEGIN:VEVENT DTEND:<?= dateToCal($dateEnd) . "\n"; ?> UID:<?= uniqid() . "\n"; ?> DTSTAMP:<?= dateToCal(time()) . "\n"; ?> LOCATION:<?= escapeString($address) . "\n"; ?> DESCRIPTION:<?= escapeString($description) . "\n"; ?> URL;VALUE=URI:<?= escapeString($uri) . "\n"; ?> SUMMARY:<?= escapeString($summary) . "\n"; ?> DTSTART:<?= dateToCal($dateStart) . "\n"; ?> END:VEVENT <?php elseif (page()->template == "ensemble"): $eventsPage = pages()->get("template=events"); $events = pages()->find("template=event, has_parent=$eventsPage, ensemblesSinging|ensemblesPlaying=$page, sort=dateStart, dateStart>" . time()); foreach ($events as $event): $summary = $event->getUnformatted("headline"); $dateStart = $event->dateStart; $dateEnd = $event->dateEnd; $address = $event->place->getUnformatted("title"); $uri = $event->httpUrl; $description = strip_tags($event->getUnformatted("summary")); ?> BEGIN:VEVENT DTEND:<?= dateToCal($dateEnd) . "\n"; ?> UID:<?= uniqid() . "\n"; ?> DTSTAMP:<?= dateToCal(time()) . "\n"; ?> LOCATION:<?= escapeString($address) . "\n"; ?> DESCRIPTION:<?= escapeString($description) . "\n"; ?> URL;VALUE=URI:<?= escapeString($uri) . "\n"; ?> SUMMARY:<?= escapeString($summary) . "\n"; ?> DTSTART:<?= dateToCal($dateStart) . "\n"; ?> END:VEVENT <?php endforeach; endif; ?> END:VCALENDAR I have never bothered to try any other calendar format than ICS, because ICS is the only standard calendar format I know of. I usually use the latest version installed with Yarn and then compile the source SCSS. The source SCSS files don't seem to have the comment.
    2 points
  13. Hi folks! I release a now major version 2.x of the TemplateEngineTwig module. This version is compatible with the newly released 2.x version of the TemplateEngineFactory (more details in this post). Note that the new version of the TemplateEngineFactory might break backwards compatibility, depending on the feature usage. Read the following guide on how to update, before you do so. So what's new in version 2.0? Updated Twig to 2.6.2 Added a setting to enable debug mode, independently from ProcessWire's debug mode. The Twig_Extension_Debug is automatically loaded if debug mode is active. Added unit tests and Travis for CI. Note that this version no longer bundles Twig. Therefore, installation is only possible with Composer. This makes sure that the 3rd party dependencies are handled correctly. If you update from 1.x to 2.x, please let me know any issues you have. If you do not update: The 1.x version of the module will stay available on the 1.x branch. For a new project, definitely pick version 2.x! Cheers
    2 points
  14. Hi @Robin S, thanks for your help making the module even better and more useable. I think I found a good solution to fullfill both requirements. With version 1.0.2 you can choose in module's configuration wether the fields should be added globally or only to selected templates. You can choose the templates via ASMSelect, if the checkbox is unchecked. I do check wether the fields were added manually in the template as well, and check the template if all fields were found. I actually find my solution with checkboxes more understandable for normal users. If you uncheck the option "Activate Releasetime from?", it is very clear that the no releasetime is active. If I'd use only the datetime fields without checkbox, I would at least add a notice that gives a hint about the possibility to leave it blank. Of course it's a trifle, but I've worked with customers who would otherwise have had queries about it. I've heeded your advice about explaining selectors in the documentation. For convenience, I added a constant with the selectorstring that is needed to filter unreleased pages. To filter unreleased pages, add the PageAccessReleasetime::selector to your selector: $onlyReleasedPages = wire('pages')->find('template.name=news, ' . PageAccessReleasetime::selector); I thought about manipulating the page's status to achieve this without adding a custom selector part to each query, but I haven't found anything useful yet. Extending the selector seems to be the best solution at the moment. Thanks again for your support! ?
    2 points
  15. ProcessWire InputfieldRepeaterMatrixDuplicate Thanks to the great ProModule "RepeaterMatrix" I have the possibility to create complex repeater items. With it I have created a quite powerful page builder. Many different content modules, with many more possible design options. The RepeaterMatrix module supports the cloning of items, but only within the same page. Now I often have the case that very design-intensive pages and items are created. If you want to use a content module on a different page (e.g. in the same design), you have to rebuild each item manually every time. This module extends the commercial ProModule "RepeaterMatrix" by the function to duplicate repeater items from one page to another page. The condition is that the target field is the same matrix field from which the item is duplicated. This module is currently understood as proof of concept. There are a few limitations that need to be considered. The intention of the module is that this functionality is integrated into the core of RepeaterMatrix and does not require an extra module. Check out the screencast What the module can do Duplicate multible repeater items from one page to another No matter how complex the item is Full support for file and image fields Multilingual support Support of Min and Max settings Live synchronization of clipboard between multiple browser tabs. Copy an item and simply switch the browser tab to the target page and you will immediately see the past button Support of multiple RepeaterMatrix fields on one page Configurable which roles and fields are excluded Configurable dialogs for copy and paste Duplicated items are automatically pasted to the end of the target field and set to hidden status so that changes are not directly published Automatic clipboard update when other items are picked Automatically removes old clipboard data if it is not pasted within 6 hours Delete clipboard itself by clicking the selected item again Benefit: unbelievably fast workflow and content replication What the module can't do Before an item can be duplicated in its current version, the source page must be saved. This means that if you make changes to an item and copy this, the old saved state will be duplicated Dynamic loading is currently not possible. Means no AJAX. When pasting, the target page is saved completely No support for nested repeater items. Currently only first level items can be duplicated. Means a repeater field in a repeater field cannot be duplicated. Workaround: simply duplicate the parent item Dynamic reloading and adding of repeater items cannot be registered. Several interfaces and events from the core are missing. The initialization occurs only once after the page load event Attention, please note! Nested repeaters cannot be supported technically. Therefore a check is made to prevent this. However, a nested repeater can only be detected if the field name ends for example with "_repeater1234". For example, if your MatrixRepeater field is named like this: "content_repeater" or "content_repeater123", this field is identified as nested and the module does not load. In version 2.0.1 the identification has been changed so that a field ending with the name repeater is only detected as nested if at least a two-digit number sequence follows. But to avoid this problem completely, make sure that your repeater matrix field does NOT end with the name "repeater". Changelog 2.0.1 Bug fix: Thanks to @ngrmm I could discover a bug which causes that the module cannot be loaded if the MatrixRepeater field ends with the name "repeater". The code was adjusted and information about the problem was provided 2.0.0 Feature: Copy multiple items at once! The fundament for copying multiple items was created by @Autofahrn - THX! Feature: Optionally you can disable the copy and/or paste dialog Bug fix: A fix suggestion when additional and normal repeater fields are present was contributed by @joshua - THX! 1.0.4 Bug fix: Various bug fixes and improvements in live synchronization Bug fix: Items are no longer inserted when the normal save button is clicked. Only when the past button is explicitly clicked Feature: Support of multiple repeater fields in one page Feature: Support of repeater Min/Max settings Feature: Configurable roles and fields Enhancement: Improved clipboard management Enhancement: Documentation improvement Enhancement: Corrected few typos #1 1.0.3 Feature: Live synchronization Enhancement: Load the module only in the backend Enhancement: Documentation improvement 1.0.2 Bug fix: Various bug fixes and improvements in JS functions Enhancement: Documentation improvement Enhancement: Corrected few typos 1.0.1 Bug fix: Various bug fixes and improvements in the duplication process 1.0.0 Initial release Support this module If this module is useful for you, I am very thankful for your small donation: Donate 5,- Euro (via PayPal – or an amount of your choice. Thank you!) Download this module (Version 2.0.1) > Github: https://github.com/FlipZoomMedia/InputfieldRepeaterMatrixDuplicate > PW module directory: https://modules.processwire.com/modules/inputfield-repeater-matrix-duplicate/ > Old stable version (1.0.4): https://github.com/FlipZoomMedia/InputfieldRepeaterMatrixDuplicate/releases/tag/1.0.4
    1 point
  16. I would like to just show my appreciation to ProcessWire and all the guys that have put work in to make it what it is now. I have use many, many CMS's in my time. Statamic, Drupal, WordPress, ConcreteCMS, CraftCMS etc... And they all have their strengths and weaknesses. But I can honestly say, ProcessWire is by FAR the best Content Management System I've ever, EVER used. I can honestly say the only weakness ProcessWire is the lack on eCommerce. But, that isn't even a weakness of ProcessWire. The tools are there for us to create an eCommerce system. I'm a front-end developer but with ProcessWire it empowers me to realise anything. Honestly, when one of the designers asks "Can we do this?" it feels so great to say YES! I, with very little backend experience built a real-estate system that completely runs on ProcessWire pulling in from an external feed (Vebra) and I did it with ease! I just wanted to say thank you, thank you for creating a framework in which, people like myself, who love front-end but find back-end daunting can pick it up and literally do anything with EASE. ProcessWire gives me so much confidence and makes me feel so good about myself. I've recently been working on an WooCommerce website, and I can't tell you how much I've been missing ProcessWire. Thank you @ryan for making a system that is so simple, even simpletons like myself can dream big. Lots of love, Tom Edit: Interestingly I feel like it would be easier to build an eCommerce system using ProcessWire than it would trying to completely reskin WooCommerce, like seriously, WooCommerce stop injecting markup and putting them in core functions.
    1 point
  17. Thanks, added in v0.1.18 I understand your thinking here, but I think it's clearest if Breadcrumb Dropdowns keeps to the conventions of the page labels in Page List as much as possible, and Page List falls back to the page name without adding square brackets.
    1 point
  18. In v0.1.17 I call the label method so hooks are not triggered - please update and report back if you're still experiencing issues.
    1 point
  19. Just tested the new feature in 0.1.16. It worked great except I had to disable the MarkInPageTree module from https://github.com/benbyford/MarkInPageTree I use that module to include the template name floated to the right of the Page name when viewing the Page Tree. Ideally, I only want the MarkInPageTree's Page Tree modifications to only show when I'm on the Page Tree at /processwire/page/. I've tried modifying the MarkInPageTree module's autoload key to the following: using a selector string 'autoload' => 'id=3', and using an anonymous function 'autoload' => function() { if((wire('page')->template == 'admin') && (wire('page')->id == 3)) return true; else return false; }, as seen from Both didn't seem to work. The labels on the Page Tree stopped showing on /processwire/page Any idea of how I can get the MarkInPageTree module to only show when viewing the Page Tree on /processwire/page and not show in the breadcrumbs when the BreadcrumbDropdown module is enabled? I also don't want the MarkInPageTree module to show when the sidebar is opened and the Page Tree is displayed when clicking on the tree icon.
    1 point
  20. If you are on a unix based system then you should give a try to Tasker/DataSet as @dragan said or look at the pcntl extension used in conjunction with the lib PHP League CSV. On windows (because the pcntl extension is not supported) I am used to write a custom import script with the same lib (PHP League) and calling `set_time_limit()` in the loop after importing X records. I import and create something like ~15k pages each night, it work pretty good.
    1 point
  21. Hm... Just got reminded about this post. Actually I think it's not the best idea to have a render() and renderReady() method in a Fieldtype module. That are methods that belong to an Inputfield module and I think it's not good to mix them up... I'd be more than happy though to have a good and extensive documentation about developing fieldtypes for ProcessWire...
    1 point
  22. It's just a default Mailchimp newsletter template shown in an online archive. ?
    1 point
  23. yes. to clear it up: for me it works only if the custom page module gets a dedicated permission, otherwise if the user has no superuser role, he wont have access. but with the permission it works good. you want to reinstall the module to install a permission and you want to refresh the modules cache after you add a permission to another module. it does not install a permission with a simple module cache refresh. thanks for the quick replies bernhard, much appreciate.
    1 point
  24. Is k31648_cms-pro3 a local database? Looks like your local installation tries to communicate with the database of a webhoster.
    1 point
  25. Nice! will you upgrade TemplateEngineSmarty also soon?
    1 point
  26. Maybe just add your hook in some hook of ProcessPageEdit, which is executed before your hook shall be triggered.
    1 point
  27. On mobile... $page->template == 'admin' $page->process == 'ProcessPageEdit'
    1 point
  28. Hey @kongondo - these changes seem to work well and prevent any unnecessary re-rendering of the output. In the fieldtype, I change these three methods to return true. public function ___sleepValue(Page $page, Field $field, $value) { //return $this->renderMarkup($page, $field); return true; } public function getLoadQuery(Field $field, DatabaseQuerySelect $query) { // prevent loading from DB return $query; } public function ___loadPageField(Page $page, Field $field) { // generate value at runtime rather than loading from DB //return $this->renderMarkup($page, $field); return true; } And in the inputfield I replace the ___render() method with the following which returns the wakeup value without re-rendering. public function ___render() { //if code field is empty return early if(!$this->runtimeFields) return; //so that $page and $pages are locally scoped to the eval $process = $this->wire('process'); if($process && ($process->className() == 'ProcessPageEdit' || $process->className() == 'ProcessUser')) { $page = $process->getPage(); return $page->{$this->name}; } else { return; } } Let me know if you have any questions / comments about this approach. Thanks again for an invaluable module!
    1 point
  29. Thanks for pointing this out, that looks like an acceptable workaround.
    1 point
  30. Gallery Claeys is a art gallery in Freiburg, Germany, with focus on exhibitions of female artists. Our agency designconcepts developed a website that features the latest exhibitions of the gallery as well as an archive of previous exhibitions. Every artist has its own page with an excerpt of their works and a vita of the artist. The website was build with help of the framework UIkit and Barba.js for smooth transitions between pages. www.galerie-claeys.de Features: Exhibitions Page transitions Exhibitions On the homepage you can find a preview of upcoming or current exhibitions as well as an archive of previous exhibitions. Based on the date the exhibitions get automatically sorted in one of the three categories (preview, current or archive). Each category has its own deep-link with URL segment. Page transitions The smooth fading page transitions are made with Barba.js. Modules used: Front-End Page Editor Markup Sitemap XML ProCache Tracy Debugger Upgrades Regards, Andreas
    1 point
  31. https://processwire.com/api/ref/config/
    1 point
  32. Very nice idea, thanks for sharing it with us ? Do not hesitate do register your modules in the modules directory.
    1 point
  33. Hello guys, Which version are you using ? I just tested it with Duplicator 1.2.9 and everything works fine on my side a part an issue already reported in dev thread which is related to the "restore" procedure. Is there anything in the Duplicator logs ? Or maybe something in the ProcessWire logs (errors or exceptions) and at least in the PHP error log file ? Please, feel free to post/report things there :
    1 point
  34. In case anyone is researching this topic, I can attest that this works beautifully on a live site! It was such a smooth and painless process! ?? I used Diogo's advice to go from Wordpress to Processwire on a site that I wanted to switch over. I had less than a minute or two downtime. Firstly, over a week or two, I built the Processwire version of the site in a subfolder (used a hard-to-guess-name) with the Wordpress version still running live in the root. Then when I was happy with the look of the Processwire version, I deleted the Wordpress installation via 1 click in Softaculous, which gets rid of the Wordpress database and the files, and leaves behind your own folders, like my staging subfolder containing the Processwire site. Then I just moved the contents of that staging subfolder up one level, into the document root. It renders just like it should. Done, and done. Thanks, diogo.
    1 point
  35. @Moebius Try to set useLanguages property to true. $field->useLanguages = true;
    1 point
  36. I don't fully understand the question, so a simple answer, yes with PHPUnit. And people was already doing it 6 years ago : https://github.com/niklaka/ProcessWireTests
    1 point
  37. Thx @Robin S, I had a look to those fieldtypes and you where partially right. I removed sleepValue and deletePageField since they should never get called on a non-db fieldtype. But your runtimeonly field does actually have too few methods if you want to keep it completely out of the db. Your fieldtype creates an empty db table. Not sure if that is intended? I've invested some more time and really like this approach of building new Fieldtypes! Is really simple, see this example of a new Fieldtype called "FieldtypeNow": I renamed the base fieldtype to "BaseFieldtypeRuntime" and it really does not do anything other than providing the boilerplate. It does not even show up in the list when you create a new field in your pw installation (screenshot later). This is the current code: Actually it does only define the inputfield and add some hooks to replace the render and renderReady methods by our own implementations and define all the functions necessary to keep the db out of the game: Simple, right? ? This is how the installation screen looks like: The BaseFieldtype is set as dependency, so FieldtypeNow can only be installed when the Base Fieldtype is available. Once installed, you can easily create a new field of that type: Notice that there is no Fieldtype "BaseFieldtypeRuntime" in this list as I mentioned above. You can then add your field to a template and edit any page of that template: <?php namespace ProcessWire; /** * Demo Fieldtype Extending the Boilerplate Runtime Fieldtype * * @author Bernhard Baumrock, 03.10.2018 * @license Licensed under MIT * @link https://www.baumrock.com */ class FieldtypeNow extends BaseFieldtypeRuntime { public static function getModuleInfo() { return [ 'title' => 'FieldtypeNow', 'version' => '0.0.1', 'summary' => 'Fieldtype showing the current time', 'icon' => 'code', 'requires' => ['BaseFieldtypeRuntime'], ]; } public function render() { return time(); } } Another Fieldtype rendering the content of a php file named like the field (very similar to the existing modules by @kongondo RuntimeMarkup, @Robin S RuntimeOnly and @kixe FieldtypeMarkup). You actually only have to implement the render() method, and if you need you can load scripts in the renderReady() method... This fieldtype loads files that are named like this: site/templates/FieldtypeRenderFile/{fieldname}.{templatename}.[php/css/js] site/templates/FieldtypeRenderFile/{fieldname}.[php/css/js]
    1 point
  38. @bernhard, you can actually remove a few more methods from such a fieldtype - FieldtypeFieldsetOpen is a good one to refer to for a fieldtype that doesn't store anything in the database. A while ago I made a simple runtime-only fieldtype that generates inputfield markup from PHP files in a subfolder within /site/templates/ - sort of like a stripped-back version of RuntimeMarkup without any config fields in admin. It was just intended for use in my own projects and I didn't think it was worth announcing publicly seeing as we already have kongondo's module, but I've moved it to a public repo in case it is interesting for you to take a look at: https://github.com/Toutouwai/FieldtypeRuntimeOnly
    1 point
  39. Little offtopic and self-promotion here, but you should definitely give RockGrid a try. It's such a great way to list all kinds of content, style it properly, add additional functionality. In the example below you get instant filtering, properly formatted currencies, referenced pages and some hover-action-icons that open that page in a panel or open the PDF invoice directly. The pagetree is great for websites, but it's definitely not for other more complex content management applications ? So true ? (y)
    1 point
  40. @ryan thanks a lot! I had a little use case where I couldn't resist to use the new feature. It was only for pages with text fieldtypes. I used two little bootstrap scripts to export & import some pages. export.php import.php
    1 point
  41. @netcarver I'm finding that the script is timing out on a large site I'm working on (there are ~1800 pages). I've tweaked the code to only find pages in which the found fields are in use and are not empty: ... // collect fields and cropsetting names $collection = array(); echo "<ul>"; foreach ($fields as $f) { if ($f->type != 'Fieldtype' . $oldFieldtype) { continue; } $collection[$f->name] = array(); echo "<li>{$f->type} : {$f->name}</li>"; $thumbSettings = preg_match_all('#(.*?),.*?\n#msi', trim($f->thumbSetting) . "\n", $matches, PREG_PATTERN_ORDER); if (!$thumbSettings) { continue; } $collection[$f->name] = $matches[1]; echo "<ul>"; foreach ($collection[$f->name] as $suffix) { echo "<li>{$suffix}</li>"; } echo "</ul>"; $field_names[] = $f->name; } echo "</ul>"; echo "<hr />"; $pages_visited = 0; $images_visited = 0; $variations_visited = 0; $variations_copied = 0; // now iterate over all pages and rename or copy the crop variations echo "<ul>"; $selector = implode("|", $field_names) . "!='',include=all"; $found_pages = $pages->find($selector); foreach ($found_pages as $p) { ...
    1 point
  42. There are several options: 1) The easiest option would be in the Console Panel in TracyDebugger 2) Converted to an action for the Admin Actions module - this would be a great option because I expect there will be lots of users wanting to convert from Thumbnails to Croppable image over the next few months - hint hint @netcarver, @horst, or @jacmaes 3) In a test hanna code 4) In a template file 5) In a bootstrapped script in the root of your site
    1 point
  43. I also have a copy of the script that optionally handles deletion of the source variations too. I'll post that when its had some more testing.
    1 point
  44. We'll what to say here ? Documentation depends on individuals who want to spare time and contribute. If something is not documented yet you can find it mentioned in threads, blog or just by looking for classes in the core. These threads can help you out what you are looking for: https://processwire.com/talk/topic/3145-multiple-views-for-templates/page-2#entry32876 https://processwire.com/talk/topic/4367-using-page-renderoptions-and-template-cache/ https://processwire.com/talk/topic/1102-to-render-or-not-to-render-thats-the-question/ http://www.flamingruby.com/blog/mapping-processwire-page-render-process/ https://processwire.com/talk/topic/1946-page-render-isnt-generating-the-same-output-as-viewing-a-page/ https://processwire.com/talk/topic/5394-page-renderfilename-confusion/ Camilo Castro documented and explains here how his wire render pattern works: https://medium.com/@clsource/the-wire-render-pattern-806bf6d6097a#.jquhbxejn https://github.com/NinjasCL/wire-render-pattern https://processwire.com/talk/topic/11199-mainphp-inflexibility/ https://processwire.com/talk/topic/11836-wirerenderfile-on-child-pages/
    1 point
  45. Hey Sérgio, I've read that too but after doing some research it's really not as clear cut at StackOverflow might want it to be. As far as I know crawlers don't use Accept-Language typically, and the plugin does absolutely no redirection when it is not set so it should not change their behaviour. This is what Google's documentation says, and others too, and it's also why I implemented the plugin the way it is implemented. From the "Location-aware crawling" page from Google, you can read this: This means that if your website is serving purely based on Accept-Language, there might be trouble cause Google isn't sending any typically, I've seen this happen in the past. The plugin does none of this, it's in your hands to implement a good solution. What you want to do : DO use <link> with hreflang to help the crawlers find other pages. Don't serve multiple languages from the same URL — always use lang.example.com/.. or example.com/lang/.. It's confusing to users not to and they can't send pages to their friends in the "right" language. Don't use GET parameters to set anything language related. Don't prevent the user (or crawlers) from switching languages and become trapped in a language that isn't their own — aka always have a language switcher in a prominent place and don't detect more than once. Read all the "International" section very carefully and find a solution that works for you. Localization is not an easy topic. Note tough that Google tells you what alternative methods supported (tough there's a huge red warning box at the top of the page) : In each case : 1) AutoDetect language isn't a location (geo-ip or else) aware plugin. 2) Discussed earlier, wouldn't recommend for various reasons but might still work. Google says "usually don't". 3) That's the firewall's job! However, if you guys still follow best practices and have trouble being indexed, I'm open to look at more "advanced" solutions. …But more complexity means more points of failure and that's something I usually want to avoid. Just want something that's accessible to beginners and works in the most common cases.
    1 point
×
×
  • Create New...