Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 03/06/2018 in all areas

  1. Hi, So today I will writing a small tutorial on developing templates in Processwire using Twig Template, Processwire is a highly flexible CMS which gives developers/designers/users options and allows easy extension of the platform. So here goes the tutorial What is Twig Template ? Simply put in my own words, Twig is a modern templating engine that compiles down to PHP code, unlike PHP, Twig is clean on the eyes , flexible and also quite *easy* to have dynamic layout site with ease ,without pulling your hair out. Twig is trusted by various platforms. It was created by the guys behind Symfony. Take this code as an example {% for user in users %} <h1>* {{ user }}</h1> {% endfor %} This will simply be the equivalent in PHP World <?php $userArray = ["Nigeria","Russia"]; foreach($userArray as $user): ?> <h1><?= $user ?></h1> <?php endforeach; The PHP code though looks simple enough however, you start to notice that you have to be concerned about the PHP tags by ensuring they are closed properly , most times projects gets bigger and comes complex and harder to read/grasp, and also in PHP you can explicitly create variables in the template making it very hard to read as it grows and prone to getting messy WordPress is a major culprit when it comes to that regard. Have you ever wanted to created separate layouts for different pages and break your sites into different parts e.g Sidebar, Comment Section, Header Section ? the regular approach would be to create individual pages for each section and simply add them as templates for the pages and with time, you can end up having tons of templates, however Twig allows you to easily inherit templates and also override the templates where you can inject content into the block easily. Don't worry if you don't understand the concept, the following parts will explain with an example of how to easily inherit layouts and templates. Layout <!DOCTYPE html> <html lang="en"> <head> {{include("layout/elements/header.twig")}} </head> <body> <div class="container-fluid" id="minimal"> <header id="pageIntro"> <div class="bio_panel"> <div class="bio_section col-md-6"> <h1>Okeowo Aderemi</h1> <h2>{{ page.body }}</h2> </div> </div> <div class="clearfix"></div> </header> <section id="page-body"> <div class="container"> <div id="intro" class="col-md-7 col-lg-7"> <h1>About me</h1> <h2> {{ page.summary }} </h2> </div> {block name="content"}{/block} <a style="font-size:1.799783em; font-style:italic;color:#d29c23" href="{{pages.get('/notes').url }}">Read more articles</a> </div> <div class="clearfix"></div> </div> </section> </div> <footer> <div class="header-container headroom headroom--not-top headroom--pinned" id="header-container"> {{include("layout/elements/footer.twig")}} </div> </footer> </body> </html> This is basically a layout where we specify blocks and include other templates for the page, don't panic if you don't understand what is going on, I will simply break down the weird part as follows: Include This basically is similar to native PHP 'include', as it's name suggests it simply includes the templates and injects the content into the layout , nothing out of the ordinary here if you are already familiar with php's include function. {{ output }} This simply evaluates the expression and prints the value, this evaluate expressions, functions that return contents , in my own short words it's basically the same as <?= output ?> except for the fact that it's cleaner to read. {% expression %} unlike the previous this executes statements such as for loops and other Twig statements. {% for characters in attack_on_titans %} <h1> {{characters}} </h1> {% endfor %} This executes a for loop and within the for loop, it creates a context to which variables in that context can be referenced and evaluated, unlike dealing with the opening and closing PHP tags, Twig simply blends in with markup and makes it really quick to read. I will simply post the contents of both the header and footer so you can see the content of what is included in the layout header.php <meta charset="utf-8"/> <meta content="IE=edge" http-equiv="X-UA-Compatible"/> <meta content="width=device-width, initial-scale=1" name="viewport"/> <title> {{ page.title }} </title> <link href=" {{config.urls.templates }}assets/css/bootstrap.min.css" rel="stylesheet"/> <link href="{{config.urls.templates }}assets/css/main.min.css" rel="stylesheet"/> <link rel='stylesheet' type='text/css' href='{{config.urls.FieldtypeComments}}comments.css' /> <link rel="stylesheet" href="{{config.urls.siteModules}}InputfieldCKEditor/plugins/codesnippet/lib/highlight/styles/vs.css"> <script type="text/javascript" src="{{config.urls.siteModules}}InputfieldCKEditor/plugins/codesnippet/lib/highlight/highlight.pack.js"></script> <script src="{{config.urls.templates }}assets/js/vendors/jquery-1.11.3.min.js"> </script> <script src="{{config.urls.templates }}assets/js/vendors/bootstrap.min.js"> </script> <script src="{{config.urls.FieldtypeComments}}comments.js"></script> <link rel="stylesheet" type='text/css' href="{{config.urls.templates}}js/jquery.fancybox.min.css"> <script src="{{config.urls.templates}}js/jquery.fancybox.min.js"></script> {block name="javascriptcodes"}{/block} footer.php <nav class="site-nav pull-right"> <div class="trigger"> <a class="page-link" href="{{pages.get('/about').url}}"> <span>{</span> About <span>}</span> </a> <a class="page-link" href="{{pages.get('/notes').url}}"> <span>{</span> Journals <span>}</span> </a> <a class="page-link" target="_blank" href="https://ng.linkedin.com/in/okeowo-aderemi-82b75730"> <span>{</span> Linkedin <span>}</span> </a> <a class="twitter page-link" target="_blank" href="https://twitter.com/qtguru"> <span>{</span> Twitter <span>}</span> </a> </div> </nav> There's nothing special here, other than twig simply injecting these fragments into the main layout , the next part is the most interesting and important concept and benefit that Twig has to offer {% block content %}{% endblock %} This tag simply creates a placeholder in which the content would be provided by the template inheriting this layout, in lay terms it simply means child templates will provide content for that block, the 'content' simply uses the name 'content' to refer to that specific block, so assuming we were to inherit this template it would simply look like this. Inheriting Template Layout {% extends 'layout/blog.twig' %} {% block content %} <div class="container blog-container"> <section class="blog"> <header class="blog-header"> <h1> {{page.title}} </h1> <h5 class="blog_date"> {{page.published|date("F d, Y")}} </h5> <br> </br> </header> <div class="blog_content"> <hr class="small" /> {{page.body}} <hr class="small" /> </div> </section> </div> {% endblock %} {% block nav %} <div class="col-md-4 col-xs-4 col-sm-4 prev-nav"> <a href="{{page.prev.url}}"> ← Prev </a> </div> <div class="col-md-4 col-xs-4 col-sm-4 home-nav"> <a href="{{homepage.url}}"> Home </a> </div> <div class="col-md-4 col-xs-4 col-sm-4 next-nav"> <a href="{{page.next.url}}"> Next → </a> </div> {% endblock %} In this snippet you can easily notice how each blocks previously created in the header and layout are simply referenced by their names, by now you will notice that twig doesn't care how you arrange the order of each block, all Twig does is to get the contents for each blocks in the child templates and inject them in the layout theme, this allows flexible templating and also extending other layouts with ease. Twig in Processwire Thanks to @Wanze we have a Twig Module for Processwire and it's currently what i use to build PW solutions to clients https://modules.processwire.com/modules/template-engine-twig/ The Modules makes it easy to not only use Twig in PW but also specify folders to which it reads the twig templates, and also injects Processwire objects into it, which is why i can easily make reference to the Pages object, another useful feature in this module is that you can use your existing template files to serve as the data provider which will supply the data to be used for twig template. take for example, assuming I wanted the homepage to display the top six blog posts on it, TemplateEngineTwig will simply load the home.php ( Depending on what you set as the template), it is also important that your twig file bears the same name as your template name e.g home.php will render into home.twig here is an example to further explain my point. home.php <?php //Get the Top 6 Blog Posts $found=$pages->find("limit=6,include=hidden,template=blog-post,sort=-blog_date"); $view->set("posts",$found); The $view variable is the TemplateEngine which in this case would be Twig, the set method simply creates a variables posts which holds the data of the blog posts, the method allows our template 'blog.twig' to simply reference the 'posts' variable in Twig Context. Here is the content of the 'blog.twig' template blog.tpl {% extends 'layout/blog.twig' %} {% block content %} <div class="block_articles col-md-5 col-lg-5"> {% for post in posts %} <div class="article_listing"> <span class="article_date"> {{post.published}}</span> <h2 class="article_title"> <a href="{{post.url}}">{{post.title}}</a> </h2> </div> {% endfor %} {% endblock %} So home.php sets the data to be used in home.tpl once Twig processes the templates and generates the output, twig takes the output from the block and injects it in the appriopriate block in the layout, this makes Processwire templating more flexible and fun to work with. The major advantage this has; is that you can easily inherit layouts and provide contents for them with ease, without the need of running into confusions when handling complex layout issues,an example could be providing an administrator dashboard for users on the template side without allowing users into the Processwire back-end. You can also come up with several layouts and reusable templates. Feel free to ask questions and any concerns in this approach or any errors I might have made or overlooked. Thanks
    3 points
  2. Aha. I see from the code in your OP that you are bootstrapping ProcessWire? If that's a yes, in bootstrap situation (because output formatting is off), image fields return arrays irrespective of your settings, i.e. similar to module context mentioned above . https://processwire.com/api/fieldtypes/images/
    3 points
  3. Not currently. You will be able to do this in the next version of Media Manager (v12) which will be out in the next couple of weeks. Media editing has been changed. Editors can now edit the media page directly, meaning, you can edit the image and other fields directly in the page where it lives using native ProcessWire features. ProcessWire now allows the editing of a file name by clicking on it. By editing the media page directly, you will be able to do this and lots of other stuff. See the gif below for an illustration.
    3 points
  4. I found that the real cause is the php method realpath() used inside Duplicator.module. Reference: http://php.net/manual/en/function.realpath.php#example-2719 The method is generating the backslashes in Windows, which makes the zip extraction look like this. Here is my fix. $source = realpath($source); //search this line $source = str_replace('\\', '/', $source); //add this line $file = realpath($pathname); //search this line $file = str_replace('\\', '/', $file); //add this line The installer runs nicely now.
    3 points
  5. I've quickly had a look at the Hanna Code page and couldn't find any API to achieve what you are after. The only things I can think of are cookies or session. You can save the ID of Page B in a session or the values of Page B that you are after (modified, created, etc) $return = $attr["url"]; $id = (int) $return; $embeddedPage = $pages->get($id); echo $embeddedPage->body; $modified = $embeddedPage->modified; //echo date("l jS \of F Y h:i:s A", $modified); $session->set('my_page_id', $id); // $session->set('my_page_modified', $modified); You can then grab the value using $modifiedDate = $session->get('my_page_modified');
    2 points
  6. ...and if you need a break from reading, take a look at this if you haven't seen it already. It's a very old video that Ryan did for PW 2, but very much recognisable even now. It covers some of the content management aspects of the PW backend.
    2 points
  7. If you gave us some more background infos about the "big picture", I'm sure we could come up with more ideas. e.g. Is it always the same CSV you want to parse/display? Does your client frequently upload CSVs (updates)? Are you doing this in just one particular place, or in dozens of other areas / pages? How big are those CSVs? There's a great module (Handsontable) by @bernhard that you could use. The client could copy+paste from Excel to PW, and with little code you could display that as an HTML-table. If it's data that don't need to be synced every day (with a cron job), you could do a one-time CSV-to-PW conversion (build a page that holds data/fields equivalent to the CSV data structure), and then let the client update this data inside PW. re: speed / performance / caching etc. If the server has to process a huge CSV every single time the page is requested, you could run into problems. So... depending on your needs we might suggest going this route or another, and avoid to have bottlenecks, and probably making the UX for your client better. re: Hanna Code https://modules.processwire.com/modules/process-hanna-code/
    2 points
  8. Well, there are many tutorials out there. Since I don't know which ones you already have read, I'll just urge you to read (or re-read) these basic overviews: http://processwire.com/about/what/ http://processwire.com/api/ The "holy trinity" (imho) in PW consists of: templates pages fields The API glues it all together. Once you realize how those things play together, it'll click. Now, and this is what most people might confuse: Pages inside the PW admin (page-tree) don't have to represent typical "web pages". Pages can be used for simply creating attributes for a select dropdown in a template, as a reference. They don't need to be published (publicly visible). Templates can store any number of fields - if you're just building "normal" websites, these would be called "page type". But you can also control permissions with templates (and much much more). The hierarchical page-tree seems simple at first (some folks might think "so what?"), but you can use the page/parent-children relations for all sorts of stuff, like categories. If you're building web apps / sites for an international audience, you'll be surprised how simple and thought-out the multilang handling is made inside PW. Lots of systems force you to create a JSON/XML file for strings that are not directly editable in your template (button/form/JS strings). With PW, everything is editable right inside the PW-admin. PW selectors are powerful. Everything is relational. You can query, fetch, cross-reference anything easily (fields, pages, sub.field.values etc.). You can build your own custom modules or dashboards, and don't even bother with a "classic front-end". People have built huge CRM systems or similar where everything is happening only in the so-called backend. For lots of people, the "click" comes when they realize how bloat-free PW is. It doesn't assume anything. It gives you lots of freedom, and people accustomed to frameworks with a steep learning curve, at first don't really see the benefit of it. Because most ppl tend to think "more complicated probably equals better". So, perhaps ask yourself what exactly do you plan to build. Ask questions here, and we'd be happy to point you in the right directions.
    2 points
  9. Got to agree with Kongondo: if that is doable for you, i.e. both sites sit on the same server, bootstrapping ProcessWire is probably your best bet. Otherwise I'd recommend checking out the REST API site profile and/or ProcessGraphQL. To my best understanding both provide the ability to create content via the API, and both have some sort of authentication mechanism available. Authentication is basically the main thing here: it's really easy to create a ProcessWire page that takes POST requests and creates pages etc. but you don't want, under any conditions, that to be publicly available without some sort of authentication. This is why I'd recommend checking the existing solutions first, and only rolling out your own solution if it's absolutely your only option
    2 points
  10. In a project I had to add the attribute 'disable' to some options of a select field (page reference) to show them but make them unselectable. Since I could not find an integrated solution, I wrote a tiny module and a hook. This could also be a POC to similar needs. Install module Add the Module to InputfieldPage in the module settings to make it selectable as Inputfield for page reference fields Create a hook in ready.php to manipulate attributes of the <option> tag for specified items Module <?php namespace ProcessWire; /** * POC Inputfield Select Hook Add Option -- Replacement for InputfieldSelect * * Selection of a single value from a select pulldown. Same like InputfieldSelect * except this version provides hookable addOption() function which allows to modify * attributes of the <option> tag (i. e. 'disabled' to show items but disallow to select them * * @author Christoph Thelen aka @kixe * */ class InputfieldSelectHookAddOption extends InputfieldSelect { /** * Return information about this module * */ public static function getModuleInfo() { return array( 'title' => __('Select Hookable Add Option', __FILE__), // Module Title 'summary' => __('Selection of a single value from a select pulldown. Same like InputfieldSelect. except this version provides hookable addOption() function which allows to modify attributes of the <option> tag (e.g. \'disabled\' to show items in dropdown but disallow to select', __FILE__), // Module Summary 'version' => 100, ); } /** * Hook in here to modify attributes */ public function ___addOptionAttributes($value, $label) { return array(); } /** * @see InputfieldSelect::addOption() * */ public function addOption($value, $label = null, array $attributes = null) { if (!is_array($attributes)) $attributes = array(); $attributes = array_merge($attributes, $this->addOptionAttributes($value, $label)); return parent::addOption($value, $label, $attributes); } } Hook /** * This example hook modifies the attributes of the selectable options of a Pagereference field named 'test'. * The selectable pages have the template 'test' assigned which includes a checkbox 'disallow'. * The attribute 'disabled' will be added to the selectable page if the user does not have the role 'user-extended' and 'disallow' is set. * */ $wire->addHookAfter('InputfieldSelectHookAddOption::addOptionAttributes', function($e) { // quick exit if ($e->object->name != 'test') return; if ($this->wire('user')->isSuperuser()|| $this->wire('user')->hasRole('user-extended')) return; // disable items (pages) in select $restrictedPageIDs = $this->wire('pages')->find('template=test,disallow=1')->each('id'); if (in_array($e->arguments[0], $restrictedPageIDs)) $e->return = array('disabled' => 'disabled'); });
    1 point
  11. Hi, I see that you asked a similar question in 2016: Have you seen this topic (and the pages that it links to), for example?:
    1 point
  12. You can achieve something (that I think is better) using a the Repeater Matrix (profield). I was actually playing with this the other day. I created several "blocks" ie image/text, quotes, slideshow etc etc and with very little effort (output styling not included) had a homepage built. I like this approach better than Visual Builder as it allows the developer to have a bit more control of the output (styles/layout). In my experience, vb can lead to bloat, and a very fractured site structure. It also, at times, makes it difficult to find where pieces of the site are located.
    1 point
  13. ok, here is my clean (hope so) code that I currently have but not working. Ok what I have done in detail. I have template (portfolio-list) with the above code. Each of the single item has the template (portfolio-detail) I created a page field with name category (Type=PageReference, Details=Multiple, Input -> AsmSelect, Parent of selectable page(s)=Kategorije(created hidden page with children), Selectable template= portfolio-detail, Allow new ... (field is added to portfolio detail template) That is all I have done, or do I need to have any additional templates for this ... Looking at the HTML on my first post it should work, or am I missing something. Not a coder and new to PW, also first time making this kind of sorting. Thank you R
    1 point
  14. I had watched it, but it was at the very beginning of my survey of the CMS scene. In other words, I needed to watch it again, because I got a lot more from it this time around. Thanks for the tip. @alxndre I'd sure like to see more content like this, obviously... I'm not typically a video guy, because I find them frustrating in that you have no choice but move at the presenter's pace, but this video was very balanced in that regard. There are a couple of PW tutorials (the very first one in the tutorials section on the Docs page, for example) that have animated gifs of certain concepts and I found those extremely effective. With that approach, I was able to watch a gif repeatedly to see what was being referred to, if necessary, or not watch it at all if the still was enough, or if I already understood the information. Also, I just want once again to thank each and every person who's contributed to this topic to assist me - it's been as encouraging as it has enlightening.
    1 point
  15. I answer your questions here. Yes, it's always the same. The CSV I only upload once by me (in the page that I create, I have the option to upload a file, and that file is the CSV ), I show to the user the data in a table. Yes, is only in one of my pages. In the CVS I have like 5500 (in total) data. I will try to solve it with your advices. So thank you very much for your time.
    1 point
  16. What do your image settings look like? You might have a max of 1 but with a formatted value setting of array of items. It also depends whether you are in a module context or output formatting is turned on/off
    1 point
  17. On an unrelated note, why don't we have more videos like this? This is the kind of thing that really grabs people's attention. I think the intro video for Vue.js was short and simple but effective enough to get people (at least me) excited. Is it beyond us as a community to work on something like this?
    1 point
  18. I must be missing something then. Do you: Want to grab $embeddedPage and use it later on in your page or Want to echo $embeddedPage properies (body, created, etc) right within your Hanna Code? If #2, you are already doing it by echo $embeddedPage->body. E.g., the following works correctly for me (code in the Hanna Code itself) $return = $attr["url"]; $id = (int) $return; $embeddedPage = $pages->get($id); echo $embeddedPage->body; $modified = $embeddedPage->modified; echo date("l jS \of F Y h:i:s A", $modified); I have this Hanna Code Tag in Page A, where 1049 is the ID of Page B. [[test url=1049]] That outputs Page B's modified date. But this seems too easy. I have a feeling I'm still not getting you.
    1 point
  19. Could you please post your current ("cleaned up?") code? When you post it, you might want to put long blocks of code in a "spoiler" (eye icon in the toolbar) so that the whole thread is easier to follow.
    1 point
  20. Actually, what do you guys @netcarver @FlorianA @bernhard think about putting 00:00:00 in the placeholder attribute - that way editors know what format to enter, but the value is still blank.
    1 point
  21. Thank you kongondo & Robin S! Use of your suggestions led to the following successful code (in case it may be helpful to others): $entries = $page->children("sort=$subcats, sort=page_headline"); $subtitle = ''; foreach($entries as $entry) { if($entry->$subcats->title !== $subtitle) { $subtitle = $entry->$subcats->title; echo "<h3>$subtitle</h3>" } echo "<div class='listing'>"; echo "<img src='{$entry->page_main_image->url}' alt='{$entry->page_main_image->description}'>"; echo "<h2>$entry->page_headline</h2>"; echo "<p>$entry->page_summary <a href='$entry->url'>Read on</a></p>"; echo "</div>"; }
    1 point
  22. Thank you - I found the information on the page you provided the links to VERY helpful...
    1 point
  23. Thank you I will try to keep it clean. I'm still lost on this one any help on how would be the best way to do this kind of sortable portfolio. I tried everything nothing sems to work. Thank you R
    1 point
  24. In your Hanna code, the page that your Hanna tag exists on is accessible as $page. So if your CSV file is in a "single" file field named "csv_file" then you could get the file like this... $csv_file = $page->csv_file; if($csv_file) { // A file exists in the field, so make your table by parsing $csv_file }
    1 point
  25. Yes, it is possible, either using MSN, your own recursive function (there's loads in the forum), or using Menu Builder. Could you point us to a link with example code? The ones I have seen have <ul> as well as the <div>. You seem to be saying that the <ul> is not required? If you are still stuck and wish to try something else, I can guide you how to build the menu using Menu Builder .
    1 point
  26. I get the same result and the installation cannot proceed further. The package was built in localhost using Laragon. The destinated server is Ubuntu 17.10. I did the transfer from the same Ubuntu server to localhost for the same site before. EDIT: I test the same package in the Windows Laragon localhost. It works nicely. The issue is happened in step 3. Does the backslashes that generated by Windows matter? Maybe DIRECTORY_SEPARATOR should or should not be used?
    1 point
  27. I think you need to concentrate on parsing the CSV file with a library like this one. Or also this function is built in PHP which takes a string as input: http://php.net/manual/en/function.str-getcsv.php
    1 point
  28. Hey guys, for some reason the forum has not been notifying me of new replies in this thread, so I apologize for my absence. @Robin S Thanks for the info on the new InputfieldPage::renderReadyHook method. I will update the module asap. I think that as it stands right now, the module does work in a repeater as long as the main page also has a page field that is using the module. The problem is that the js and css assets are not included by the repeater. @Ipa it looks like the javascript for these two modules is conflicting. I am not familiar with HelperFieldLinks. Can you explain its purpose? Also, can you get me a larger screen shot of this in context of the rest of the field? I don't think this would be too difficult to add. Good idea.
    1 point
  29. Or Stripe Checkout: https://stripe.com/checkout https://stripe.com/docs/checkout (Integrating Checkout, etc.) https://stripe.com/docs/checkout/php Edit: http://modules.processwire.com/modules/payment-stripe/
    1 point
  30. You should note that while the template editor is mainly for the developer, the page editor where you actually put content is mostly for the users (writers, ads/seo managers,business owners, etc). So the value is that you could have a functional and customized content editor with just a few clicks. It is also important to note that ProcessWire is a content manager. For me, and for most cases i think, this is much more "valuable" than a WYSIWYG front-end because while front-end design trends/frameworks come and go, the back-end would remain the same. It would be much more wasteful to support all of these trends/frameworks with drag-and-drop support only for them to be unpopular in a few months. And it's also been argued countless times that a well-crafted website design is many, many times better than a "customizable" but inescapably bloated front-end. I still cringe remembering the markup regurgitated by Dreamweaver and the likes. Not to say that the concept is without merit, but it does not fit all use cases, and goes directly against ProcessWire's unopinionated nature. Would you mind giving other examples? I've been using ProcessWire for some years on a daily basis, and I haven't once thought, "hmmm, this doesn't do anything, we should just remove it". That being said, each project is still unique, and if you think the way ProcessWire works is inadequate, that's where modules come in. Or other CMSs, for that matter. For me the strongest reason for choosing ProcessWire is simple: with what it does it does so well, and with what it doesn't it doesn't stand in the way.
    1 point
  31. Maybe processwire could harness tus for chunked uploads. Integrating the existing js/php components into processwire might be simpler than writing a custom backend for resumable.js.
    1 point
  32. Maybe it is easier (even better?) to instead bootstrap ProcessWire inside your WP and use ProcessWire to create ProcessWire pages. https://processwire.com/api/include/
    1 point
  33. I don't think you need a full webshop system such as Padloper or Snipcart for 4 products. Make it easy on yourself and use PayPal buttons - your work will be finished in 30 minutes.
    1 point
  34. Just as a heads up if someone needs database testing: I am trying a different approach at the moment: I simply added a database configuration to the config.php which is used if PW is called from PHPUnit. in config.php if(isset($_ENV['UNITTEST']) && $_ENV['UNITTEST'] == true) { $config->dbHost = 'localhost'; $config->dbName = 'db-test'; $config->dbUser = '...'; $config->dbPass = '...'; $config->dbPort = '3306'; $config->httpHosts = array('localhost'); } and my PHPUnit configuration.xml looks like this <phpunit ... some settings here ... > <php> <env name="UNITTEST" value="true" /> </php> </phpunit> maybe this will save someone a headache in the future
    1 point
  35. I disagree, Horst. It seems, that the most participants in this thread are convinced, that the installer (and that's what I like to talk about) has the best functionality, which is possible. In my humble opinion an installer should protect the superuser from warning after the installation. I think the usability of an installation process around language issues is ideal, when during the installation process the user has to decide about that. Example: We recognize, that your computer is located in Germany. 1 Do you like to use the language [German] (menu to choose another) for the GUI of the backend? [OK] 2 Do you like to use the language settings of PHP for [German] (menu to choose another)? [OK] * 3 Do you like to use the language [German] (menu to choose another) in your first website? [OK] That's all I suggest. That behaviour is good practice in many software I installed in the past. I hope you regard my arguments not at all as an "ungratefulness" from a newbie. The contrary is true. Because I appreciate the project a lot, I think is worth to be honest and give a constructive criticism. *Of course the questions 2 and 3 could be written in that language which has been choosed in question 1. But of course only than, when the project has enough resources for translation work.
    1 point
  36. Preview of upcoming Media Manager Version 012 Better, cleaner, ProcessWire 3 UI! Custom columns (add custom fields to media templates; frontend access via API: e.g. $m->email; $m->body, etc) Edit media page directly Ajax update of Media Manager field on a page Disable media views centrally (e.g. manage only image media) Add extra images to image media field (e.g. front, back, top, side views, etc of an image) Better media previews More..... ETA: 3 - 5 weeks Early screenshots (some stuff subject to change)
    1 point
  37. You can search for the text string that makes up the start of the tag (to allow for varying attributes). // Get fields with TextformatterHannaCode applied $hanna_fields = array(); foreach($fields as $field) if(is_array($field->textformatters) && in_array('TextformatterHannaCode', $field->textformatters)) $hanna_fields[] = $field->name; // Implode for use in selector string $hanna_fields = implode('|', $hanna_fields); // Find pages with a given Hanna tag $has_hanna = $pages->find("$hanna_fields*=[[your_tag");
    1 point
  38. This module is on Github, https://github.com/outflux3/ProcessDocumentation in case any one wants to test it; will wait till i have time to run test cases before releasing..
    1 point
  39. hi abdus, thanks for your effort on helping others maybe i can suggest you to take a tool that lots of people are using here for creating micro-screencasts as animated gifs: http://www.cockos.com/licecap/ very easy, very helpful
    1 point
  40. Searching larger page sets can be critical in PW. I had experience with 100'000+ articles that searching 3-5 text fields suddenly takes 5-8 seconds (this is on a very fast server). Reducing it to 1 fields only would take 0.1s. But how would you go if you want to search multiple attributes and all. So for a product site I only have experience with 2-3000 artikels that already takes 2-3 seconds to search and an index ain't going to help here. So PW comes to a limit very quickly when searching large sets with multiple fields. It just creates lots of joins that can hurt your search. Also importing and handling such large sets can be very time consuming. I have a site where 45'000 members need to be snyched every day. Doing that with the API takes around 45m+ and takes lots of memory quickly. It has to deal with loading comparing, creating objects and may produce lots of work for the DB. Compared to have a CSV directly imported to a table would take a couple seconds.
    1 point
  41. The audience for making Process modules is small enough that time for documentation is getting put towards broader scope stuff first. I think there might just be 4-5 of us that have an interest in making Process modules. But this will be in the documentation at some point, especially as interest for it grows.
    1 point
  42. I think this is more likely to be a component of the 2.3 version with form builder. However, I don't think you need to wait for that. I would say to build something custom for your need, because this isn't particularly hard to do. When you are dealing with image uploads, you'll want the original uploaded image to be placed in a non-web accessible quarantine location. Then after confirming that it is indeed an image (by checking the extension and using php's get_image_size() to confirm it's valid) then you'll want to use ProcessWire to create a resized copy of it (using the ImageSizer class in /wire/core/). To the best of my knowledge, the resized copy is safe to be web accessible (i.e. okay to add to a page). Once you've done that, delete the original one that they uploaded. At this point, the main concerns would be copyrights (who owns the imagery) and content (inappropriate imagery, if applicable to your case).
    1 point
×
×
  • Create New...