Leaderboard
Popular Content
Showing content with the highest reputation on 11/19/2016 in all areas
-
This week we've got a new master version 3.0.41 and this post covers what's new. We also take a look at the API Explorer module from the ProDevTools set of modules, which will be released next week. https://processwire.com/blog/posts/processwire-3.0.41-and-a-look-at-api-explorer/8 points
-
6 points
-
Image & File Dependencies Allows Image and File fields to be used in inputfield dependency selectors. Note: prefix field names with an underscore in your dependency selectors. Usage Install the ImageFileDependencies module. You can now create an inputfield dependency based on the number of images or files added to a Image or File field. When you create an inputfield dependency for a Image or File field, prefix your field name with an underscore. Example for a field named 'images': _images>3 Note that you do not include a '.count' subfield in the selector. https://github.com/Toutouwai/ImageFileDependencies Demo5 points
-
This happens when the user PHP runs as isn't the owner of the cache files. The file compiler tries to update the cache files with the modification time of their originals, and while writing to that file can succeed through group permissions, updating the modification time fails unless issued by the owner. Clearing the cache removes the cache files and recreates them with the PHP user as the owner, so the problem is gone.3 points
-
ConnectPageFields Allows the connecting of two related Page fields so that changing one updates the other. Purpose of module An example: suppose your website is about movies. You have a template "movie" with Page field "actors". For each movie you add the actors that appear in the movie. All good, but what if you want to find results like... the 10 actors who have appeared in the most movies actors who haven't appeared in any movies since 1990 You cannot retrieve these pages with a single efficient $pages->find() query, and must load a large PageArray into memory in order to iterate or filter it. For the sake of making these types of queries more efficient you could structure your templates/fields so that movies are added to actors instead, but this may be a less comfortable workflow and can run into equivalent problems (e.g. "find the 10 movies with the largest cast"). The solution is to have a two-way relationship so that movie pages have an "actors" Page field and actor pages have a "movies" Page field. This module will keep these two Page fields in sync so that adding "Ryan Gosling" to "Drive" automatically adds "Drive" to "Ryan Gosling". Also, you can select the same Page field in both Page field A and Page field B. For example, create a "Related" Page field for related pages. Choose "Related" for both fields in a pair in the module config. Now when you add "Orange buffoon" to Related for "Donald Trump", "Donald Trump" is automatically added to Related for "Orange buffoon". Usage Install the ConnectPageFields module. If you haven't already done so, create the two Page fields you want to connect and add them to templates. In the module config select the two Page fields in a "Connected field pair" row as Page field A and Page field B. You can add rows as needed using the "Add another row" button. Troubleshooting Make sure you have set the "Selectable Pages" settings for each Page field correctly: The settings for Page field A should allow pages using the template(s) that Page field B has been added to. The settings for Page field B should allow pages using the template(s) that Page field A has been added to. http://modules.processwire.com/modules/connect-page-fields/ https://github.com/Toutouwai/ConnectPageFields Module config: Demo showing how changing one Page field updates the other:2 points
-
Hello, This is a very simple module that helps you asserting if the server has all the requirements for running ProcessWire. Helpful if you are developing in local and then have to upload to a production server. https://github.com/NinjasCL/ProcessServerAssert2 points
-
2 points
-
File Editor GitHub https://github.com/f-b-g-m/ProcessFileEdit matjazp version https://github.com/matjazpotocnik/ProcessFileEdit A module that allows you to edit file directly in the in the admin area. First module and first time doing a file editor so the way i do it might not be the best. Feedback is welcome. Editor page Setting page1 point
-
A feature request here in the forums prompted me to shape a piece of code I had been tinkering with into a usable module. Template Parents What it does: The list of possible templates for new pages in ProcessWire is purely based on other templates in parent/child relationships managed in the involved templates' family settings. This is most often okay, but sometimes you want to limit creation of pages with a certain templates to individual spots in the page tree, and there's no clear parent/child relationship to go with. The initially quick solution would be to duplicate parent templates for the different spots, but then any change on one of these templates has to be made to the others too, which gets tedious and error prone. Template Parents adds an entry in the Setup menu where you can assign allowed parent pages to templates. These rules are enforced after the regular family settings have been executed, so it builds upon instead of replacing PW's built-in mechanism. There's also an option in ProcessTemplateParents' to enable inheritance, then entries in the Template Parents assignment are inherited down the page tree and also grant template permissions to children, grandchildren and so on. The module can be downloaded from the GitHub repository. It has been tested with PW 2.7 and 3.0.1 point
-
ImportPagesPrestashop You can download it here: ImportPagesPrestashop With this module you can import your categories, products, features and images of the products to your new Processwire website! What does it? Once you've installed this module, a new tab will be under the Setup named Import Products from Prestashop. When you click on it, you can make connection with your Prestashop DB. After making the connection you can import first the categories, followed by products and the features and the images will be inserted in the fields of the product that is linked to these features and images. You can choose whether you import your categories et cetera in as much languages as possible or only in your default language. You can also choose to import the EAN-number and/or the products and the Reference code of the products. Requirements Only tested it so far on Processwire 3.x. Installation Download the zip file, upload it to your Processwire site and install it. Languages If you want this module to run as smooth as possible, name your languages like in the screenshot below. If you want to execute this module in dutch, download the .zip file, go to your languages tab in processwire, go to your dutch language and upload that .zip file to your site translation files. Credits to djuhari NL-Translations.zip1 point
-
Captain Hook ProcessWire Hooks Cheatsheet http://somatonic.github.com/Captain-Hook/ or on processwire.com http://processwire.com/api/hooks/ I created a simple list with a live search for all hookable methods available in the core. All methods prefixed with a "___" (3 underscores) are hookable. Methods can be made hookable by simply adding those ___ to it. ------------------------- I usually don't really need this, but thought it would be good to have an official list for reference. I used Sublime Text2 for searching and dumb a file with a search for " ___" in wire core. From this list I created a html file with a php script and added some fuzzy live search, similar to the API cheatsheet. If you use Sublime Text 2 like me you can simple use Goto Anything command super+p to show a fuzzy search for files. Enter a class name you want to search for. For example "fields" or "process page edit" you will recieve a list of files found in PW. Highlight the file and typ a @ to see the symbol list quickly or select the file and super+r the get the symbol list.1 point
-
A: They're both big in Germany Not a scientific measure for sure, but for forum members who choose to disclose their location Germany seems to be the most common country. I'm curious about why ProcessWire would be especially popular in Germany. Was PW featured in a popular German-language publication or something like that? For German members (or any members actually): how did you first hear about PW?1 point
-
Yesterday I got frustrated that it's hard to rename existing link that I looked into ProcessPageEditLink module and pwlink CKEditor plugin and added a "Link text" feature. The modal window doesn't have a field for this that I've added now: Anyone knows why it's missing there? Judging from the code it seems it was intentionally left out.1 point
-
I started to get my hands on hooks for the first time and think that Captain Hook (like the Cheatsheet) are great resources. Unfortunately (or fortunately if you want) has the documentation inside the files moved the line numbers of the linked hooks, so that the links on Captain Hook don't point to the right direction anymore. Also they use the old repository. If the links could be updated, that would be great. To be future-proof I saw recently this thread: Maybe with APIGen and the API Reference there is not much need for Captain Hook anymore, but as it is cross linked in many places (f.e. AdminThemeReno), this would be great for beginners like me. Regards, Andreas1 point
-
Hello Can, I am using TextareaLanguage field as my body field. Therefore I got fe an error message at "$value->getLanguageValue($user->language)" - this could not be used with a string. Anyway, I have written my own image markup manipulation module using simplehtmldom. I am using UIKit as my framework and I have to include the UIKIT CSS classes and markup for images inserted with CKEditor. I have used your module as starting point for mine. Best regards1 point
-
It's not working, if the module has it's own install method. I added that in v1.6.1 to check for mbstring and iconv support. To overcome this you have to either remove your own install method or create a page by yourself, like this: public function ___install() { /* try { $this->installPage('file-editor', 'setup', 'Files Editor'); } catch(Exception $e) { $this->error("Can't create a page."); } */ parent::___install(); if(!extension_loaded('mbstring') || !function_exists('iconv')) { $this->message("Support for mbstring and iconv is recommended."); } } Thank you both for the report, v1.6.4 is up & running Edit: I forgot to call parent::___install();1 point
-
@matjazp i can confirm the fact that the page is not created, tested on both windows 10 and debian 8 with PW 3.0.40 and PHP 5.6 It worked with version 1.5.4.1 point
-
Hi, adrian! I added a warning to the readme file for next versions, so that everyone should be aware that they need a backup solution in case they cut himself off the admin. I'm not creating the page by myself, I'm letting PW do it for me: $info = array( 'title' => 'Files Editor', 'summary' => _('Edit files'), 'version' => '1.6.3', 'author' => 'Florea Banus George, Matjaž Potočnik, Roland Toth', 'icon' => 'file-o', 'href' => 'https://github.com/matjazpotocnik/ProcessFileEdit/', 'requires' => 'ProcessWire>=2.5.5, PHP>=5.3.8', 'permission' => 'file-editor', 'permissions' => array( 'file-editor' => _('Edit Files (recommended for superuser only)') ), 'page' => array( 'name' => 'file-editor', 'parent' => 'setup', 'title' => 'Files Editor' ), ); @adrian,would you be so kind and PM me, I would appreciate if you could give me more info about your server.1 point
-
@thomas, I created a module that allows image and file fields to be used in inputfield dependencies.1 point
-
This is working for me (PW 3.0.40)... /site/config.php $config->imageSizes = [ "foo" => ["width" => 200, "height" => 200], "bar" => ["width" => 400, "height" => 0], ]; /site/ready.php $this->addHookAfter('InputfieldFile::fileAdded', function($event) { $inputfield = $event->object; if($inputfield->name != 'images') return; // needs to match the name of your images field // alternatively, to use for all image fields... // if($inputfield->class != 'FieldtypeImage') return; $image = $event->argumentsByName("pagefile"); $sizes = isset($this->config->imageSizes) ? $this->config->imageSizes : []; if(count($sizes)) { foreach($sizes as $size) { $image->size($size["width"], $size["height"]); } } }); You won't see the variations immediately inside PageEdit, but you can see them after you save the page.1 point
-
Hi everyone, I just installed this for the first time to help debug something on someone's site and thought this would be the easiest way to edit module files without asking for FTP access. It worked great until I saved the file with a syntax error and then needed FTP access to get anything working. This is more of a heads up than anything. Not sure what a workaround might be. Tracy's TemplateEditor Panel allows testing file changes, but this only works for the template file of the current page. Not sure how this could be done for other files - seems unlikely, but I'll have a think. The other thing I wanted to report is that the Setup > Files Editor page is not being created on install. I tested on another PW site and the same thing. Once I manually created it, everything worked fine.1 point
-
Oh, I'm sorry about the missing opening tags, added them to the gist The ready.php part was more thought to be added to an probably existing file rather then being a file, that's why I wrote "it's placed in my ready.php" and it's more like a boilerplate and not a proper module, so the post was mostly to see if people like it ;-) I'm currently using it with PW 3.0.39 and everything works fine what errors are you getting? maybe we can figure out the cause.. Hopefully I'll find some time to stuff all of it in a module or similar and make a proper repository and readme soon.. The cke additions are already in a custom cke plugin because the above code wouldn't work with TextareaLanguage, the plugin takes care of applying the contextmenu extensions to all cke instances of every language and handles insertion properly.. and actually I need to ensure it's working with single language cke, because right now the js selector are based on the language ids/classes okay I've just initiated a local repo, but I need to test things further and play around with a single language pw install to have it support both because selectors seem to differ and I still need to figure how to make it as easy to install as possible which dictates the structure and readme of the repo ;-)1 point
-
but he also says; the search goes on, still cant't be found... so something is fishy... btw, the clip is a lot worse than the photo (even thought I have to agree that the photo is indeed horrendous), so so far you are the winner!1 point
-
I can think of a few reasons, and while some are purely technical and some are related to what Ryan already explained before, think about it this way: if a page is omitted from URL because it's currently not viewable, what happens if it becomes viewable later?1 point
-
Sorry for the wrong topic. Yes, my goal is to create a PR, just wanted to know if there's something I should know before. This seems a trivial feature to me, wonder why it was not added so far.1 point
-
If there really is a reason for this, I would seriously question it's sensibility. This should really be changed in the core. Care to create a pull request or feature suggestion at GitHub? Edit: I've just moved this topic to the Wishlist & Roadmap section of the forum. The Modules area is mainly intended for module release / support threads, and while this question is technically related to a module, it's a core module with no support board of it's own.1 point
-
Interesting thread and nice picture. Maybe you should make a request for ProcessWire to include more breast hair. In my case, I was introduced to PW by an co-worker who saw, that it won the CMS Critic 2014 Award for Best Free PHP CMS. At this time he was looking for a flexible field based CMS similar to Contao, which we used before. I quickly became a fan, because I only used to know WordPress and enjoyed the freedom I had as an developer + the friendly community. Or like The Hoff used to say:1 point
-
Added the hint to use the hook before "save" to get the changes saved to the user.1 point
-
Basicly this boils down to the fact that with processwire you dont make website the cms way but your way. And you are not going to find your way until after you have made a dozen websites with processwire. Everytime when I finished a website with processwire I saw a better way to organize things in the templates folder in combination with "everything is a page" in your admin folder tree. The delayed output way fits best with organizing things your own way in the templates folder. There are really many posts about this in the forum I cant recall of them now I recommend you look for them, but here is a good example to start with from Camilo Castro: https://medium.com/@clsource/the-wire-render-pattern-806bf6d6097a#.rk8g785m91 point
-
This module comes in handy when you need related pagefields that are dependant on each other. Example: you have a sports team and team members belonging to that team. you need 2 fields: one on the team-page, one on the member-profile. this module keeps both fields in synch. Other examples would be hierarchical company structure or any other kind of membership relation. Demo: settings in this example: Gitlab: https://gitlab.com/baumrock/PagefieldPairs Modules Directory: asap only tested on PW3 and reno theme. Please test it faithfully before using it. please report any issues1 point
-
I use my own utility function files in my site-profiles in a subfolder called for example: 'mylibs' I include them once in the site/config.php file: include_once(dirname(__FILE__) . "/mylibs/myfunctions.php"); This way I can use all what is in my utility files every where, regardless if I run PW in the webserver or if I bootstrap it for CLI operations.1 point
-
Actually in this case /cities/ is not just about admin organization, it's an important landing page in the site's navigation and breadcrumb trail: http://processwire.com/skyscrapers/cities/ In ProcessWire we really try to push that URLs are structure and should represent actual structure. What makes sense for the site's structure also makes sense for the URLs, because they are one in the same. If there's a strong desire to have actual city pages off the root level, then you can create them off the root level. While I would question whether that's really the best strategy for either side, there's nothing stopping you from doing it. You can always take the URL segments route too, but when URL segments are used as beginning points (foundations of structure) rather than ending points, you always have to question whether it's really what is best for structure and URLs, or whether it's giving preference to short-term style over proper structure.1 point