Jump to content

Leaderboard

Popular Content

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

  1. As I mentioned in this issue, I've create a new textformatter for ParsedownExtraPlugin, which adds some oomph to your markdown. Repo: Parsedown Extra Plugin Unlike the built-in textformatter for Parsedown and Parsedown Extra, this should be used when you want to use Extra with additional configuration/customisation. Some examples: ### Test {.heading} - A [external link](https://google.com/){.google} with `google` as a class that opens in a new tab if the config property is set. - [Another link](/page){target=_blank} that opens in a new tab even though it isn't external. ```html .html <p>Test</p> ``` There's some config options available to you, such as setting attributes on all/external images and links, setting table and table-cell alignment classes, adjusting footnote classes and IDs, adding <code> attributes to their parent <pre> elements, and changing the <code> class if your syntax highlighter does not use language-*. I was thinking about adding the ability to make links open in a new tab by appending a plus to the link syntax, but only external links should be opening in a new tab anyway. Further, this would add extra, unnecessary processing time. Please let me know if you bump into any problems. ☺️
    4 points
  2. One of the greatest Finnish inventions, IRC, is still evolving. It even has a working group pushing things forward. I thought I would create a topic with curated open source tools to maybe inspire more people to join #processwire @ Freenode network. I have selected the tools on the basis that they seemed to be under active development. Awesome IRC is a nice list, but too detailed for this context and listing many unmaintained projects. Desktop clients (cross-platform) HexChat Irssi KVIrc Quassel (has the unique feature that one (or multiple) client(s) can attach to and detach from a central core) WeeChat Multi-protocol Swiss army knives Pidgin Smuxi Thunderbird Android clients HoloIRC qicr iOS clients Mutter Colloquy Web-based clients These should be quite interesting to the PW crowd as hosting web applications is your bread and butter Glowing Bear (web frontend for WeeChat) Kiwi IRC (currently being rewritten) The Lounge Quassel webserver Bouncers (don't lose chat history even though going offline) Firrre - get a free bouncer for free & open source community networks. See the guidelines: you need a 60-day old registered NickServ account and a Github.com account. See the Freenode guide to nickname registration. ircb ZNC
    3 points
  3. Hi @Harmen - how do you envision all the languages being formatted in the CSV - using a "|" or some other separator, or do you have some other approach in mind? Currently BCE only supports direct children of a page. I am not sure how to come up with a standardized approach for handling sub-pages/grandchildren in CSV format. Perhaps if you could explain (or provide an example) of how you'd like the CSV to look I could implement it, or you could provide a PR
    3 points
  4. I've added simple svg backgrounds to show values as guidelines. It's not 100% perfect but close
    3 points
  5. Just to chime in: Fantastic Module @adrian
    3 points
  6. Happy New Year to everyone! For a project that I'm working on, I needed to have dependent checkboxes on page edit forms in the admin. Just like dependent selects but for checkboxes. I couln't find anything and decided to write my first Inputfield module. I have only tried it on PW > 3.0. But it should also work on the 2.x branch. Would be great if some of you could try it out and give some feedback. You can find the module InputfieldDependentCheckboxes at github Here's some screenshots of the module in action and instructions on how to use it. ##An Inputfield for ProcessWire admin interface that handles the display of dependent checkboxes in page fields Sometimes we need checkboxes to depend on other checkboxes in our page edit forms. This module adds this functionality to standard page field checkboxes for 2 or more checkbox fields. ## Installation 1. Copy all of the files for this module into /site/modules/InputfieldDependentCheckboxes/ 2. In your admin, go to the Modules screen and click "Refresh". Under the 'Inputfield' section, install the 'InputfieldDependentCheckboxes' module. 3. Open Modules->Configure->InputfieldPage. Under 'Inputfield modules available for page selection' add 'DependentCheckboxes' from the select dropdown and submit ##Field Setup This inputfield extends the standard checkboxes for page fields. Therefore you need to have page fields configured already that you can extend with this Inputfield type. ###Prerequisites You need to have at least 2 fields of type page that have 'Checkboxes' defined as Input field type and live on the same template. A real world example: There are different types of instructors. Each instructor type can have multiple different certifications. For this to happen, we need 2 page fields (multiple): A) instructor_types: lists pages with template 'instructor_type' B) certifications: lists pages with template 'certification' The certification template needs to have the instructor_types page field to assign one or more instructor_types to a certification. ###Setup (link checkbox fields) 1. Edit your page field A and go to the 'Input' Tab. Under 'Input field type' choose 'DependentCheckboxes'. Hit save. Now under 'Choose the target checkboxes field' choose the name of your field B. Hit save again. 2. In your page field b make sure to choose a template under 'Input' Tab under 'Selectable Pages'->'Template of selectable page(s)'. Your fields should be setup. If you now edit a page that contains the 2 fields, the dependent checkboxes should be working. EDIT: And yes, this is working for multiple dependent checkboxes, too. (I have tried it with 3 so far) Some notes on how the module works behind the scenes: - parent checkboxes (actors) that have dependent checkboxes (targets) get custom data attributes applied which contain arrays of the targets' IDs - some Javascript is initiated on acxtors and targets to handle the display based on the id arrays in the data attributes. EDIT: since this module's mention in ProcessWire Weekly it might get some more attention. I just wanted to point out that it is still in alpha state. I will continue development and more thorough testing while implementing it in an ongoing project within the next 3-5 months or so. I will eventually release a stable version then. If you use the module with only 2 dependent checkbox fields, it should work smoothly. There are still some quirks when using 3 or more and I need to figure out how to best resolve them. So please be patient (or jump in with ideas ).
    3 points
  7. Not sure about this, it wouldn't save too much time imo. Auto save would be also an issue because users could have edited other fields and perhaps they wouldn't like to save.
    2 points
  8. Hi Lena, If you update to the latest development build you can use the new limit features in your selector. http://processwire.com/blog/posts/pw-3.0.46-stocking-stuffers/#support-for-negative-limit-and-start-values-in-selectors $children2 = $root->children("limit=-2") Notice the minus(-) before the 2. Hope this helps!
    2 points
  9. Thank you @adrian! It is amazing to watch something being created with such an amazing pace by people like you and ryan. And so much to learn from. I recommend everybody to go through these guys' code to learn how you can be really powerful using ProcessWire. Another little idea. Not sure it is necessary, but seems logical to me to separate "core" actions and those specific to the site. Like core ans site modules. I can see this module to be a base to easily create little things that would other way need their own process modules. In that case, most of the time I would use only custom actions... A filter option or a tab. What do you think? I know, that for everybody but admin I can achieve about the same with by-action role assignment. But as I almost always login a superuser myself...
    2 points
  10. Some of my thoughts but I really don't know if it's feasible or too much error-prone. For sub-levels: Having a new field (in the CSV): sub-levels. I discovered this approach in the Menu Builder module. However, since this field doesn't exist in template, it could be confusing if we forget to add it when add or replace data. For multi-language: According to me, it shouldn't use | since they are already use for many images/pages. Furthermore, I used CSV in Excel to fill quickly in column format, so I need different CSV fields. I guess the best option is having for example: body_en;body_fr. But I'm not sure how to order the CSV since there is maybe non-multi-language fieldtypes in the template. And/or, since not applicable to CSV import-export, to add data, it could be a multilanguage area (it used when you edit a ML option's fieldtypes). But I have no idea how those things works, so I let you decide how good they are...
    1 point
  11. Thanks @Martijn Geerts - glad you're finding it useful - I appreciate the feedback! Hi @Ivan Gretsky - just to clarify - are you talking about simply separating the "core" actions in the module's "action" folder from those "site specific" ones in the /site/templates/AdminActions/ folder? I think tabs sounds like a good approach - I'll take a look at doing that. Also something else to consider is the tables filter feature of @tpr's awesome AOS module - that will make finding actions nicer once there are lots more, although to be honest sometimes I just like good old CTRL/CMD + F Just an FYI - if you don't want certain/any core actions available, you can remove the superuser role from those actions and they won't clog up your list of actions.
    1 point
  12. The additional settings will be very useful, thanks. The core inclusion of Parsedown and your module renders my module from 2014 redundant. I'll take it off.
    1 point
  13. Thank you grimezy, i tried and I found another method to solve my problem: with slice() $root = $pages->get("/"); $children = $root->children->slice(4, 3); foreach($children as $child) { if($child->id == wire('page')->id) { echo "<li class='active'><a href='{$child->url}'>{$child->title}<span class='sr-only'>(current)</span></a></li>"; } else { echo "<li><a href='{$child->url}'>{$child->title}</a></li>"; } }
    1 point
  14. thank you tpr for the new update also thank you for the css fix. didn't think about that! what do you think of adding often used widths as a clickable shortcut to the form? clicking it could also save + close the modal shortcuts could be 20 25 33 34 40 50 60 75 80 100
    1 point
  15. Hi everyone, I have committed a new version that takes care of @Ivan Gretsky's issues with guest access for calling actions via the API. The new version also includes the ability to add actions to the Setup > Admin Actions submenu which could be really handy for quick access to key actions that you use regularly. At the moment you could add them all if you want, but perhaps in the future we'll have too many to make this usable, which is why I have made these configurable. See the new "In Menu" column:
    1 point
  16. Probably something to do with the php garbage collection. Check this out: 1, 2.
    1 point
  17. I can only concur that this has been a great year. It was nearly impossible not to get infected by the momentum of PW's development. Love (that's an understatement) the JS $pages API plan, and the pages export/import function could even be a solid base for native staging support, just by hooking into the proper PW actions and filling a staging actions table. You're absolutely right, @apeisa, PW is much more than just a brilliant website platform. Our intranet site really does some "heavy lifting", consolidating information from the ERP system, the DMS, personnel and operational time keeping, financial accounting and a few proprietary databases. That way, it also serves as the middleware for a big, distributed test run database. Like Sense, it drives a few chained workflows, e.g. for bridging the feedback gap between dunning proposals and our sales managers. All our intra-company course scheduling/booking runs on PW too, including supervisor approval, and it was surprisingly easy to implement. HR was over the moon with PW's ease of use. For 2017, we're planning a site that provides our customers with all the publicly available documentation for the machines and plant parts we sold them, requiring just a QR code scan on their side. Setting up a working (UIKit styled, multilingual) prototype only took me a few hours and really impressed our sales guys If 2017 is going to be anything like this year, it's going to be a blast. Thank you @ryan! A happy, healthy and inventive new year to everyone!
    1 point
  18. Great blog post Ryan, thank you! Great year behind and even better coming! What comes weekly news, I think maybe @teppo and PW Weekly could report interesting new stuff from dev branch - instead of full blog post by @ryan each week? Also I think what would really help PW as a community project is that modularity would be more easily seen from code repositories also. I mean separation of /wire/ from rest of the stuff, keeping admin as own project and making several core modules as their own projects (although they could be "essentials" that would always be installed with ProcessWIre). What comes to Avoine, I hope I found time to write case story about how we use ProcessWire as backend solution to our member register platform Avoine Sense. Sense was released early 2016 and it already hosts about 10 member registers that together hold about 150 000 members. Feature-wise Sense already has newsletters, custom reporting tool, invoicing, model based templates/fields, background jobs, client specific procedures build by chaining actions (ie. create excel, connect ftp, deliver file and finally send sms to admin), full read/write REST API with Oauth2 authentication, mobile application, embeddable login/edit forms etc... ProcessWire has been amazing platform for our application development (currently we have 4-5 developers working on it). I strongly encourage that you all consider ProcessWire as a viable alternative for serious application development also. It is perfect platform for building dynamic websites, but it is also pretty brilliant platform for application development!
    1 point
  19. Edit: Feature has been removed. See next post. Bumped to 0.1.1 and added styles(): <?= $modules->get('TextformatterTypographer')->styles(); ?> Outputs the following default style-set: span.caps{font-size:96%} span.numbers{font-size:96%} span.dquo{margin-left:-.41em} span.squo{margin-left:-.06em} To configure this, add a config array as the first parameter. For caps and numbers, Typographer will detect if you're specifying a string or integer-based value and name the property accordingly: <?= $modules->get('TextformatterTypographer')->styles([ 'caps' => 'Charter SC', // some fonts don't render well when their font-size is changed, so using a small caps font is better. 'numbers' => 'Charter SC', 'dquo' => '-.29em', // depends on your font ]); ?> This outputs the following: span.caps{font-family:'Charter SC'} span.numbers{font-family:'Charter SC'} span.dquo{margin-left:-.29em} span.squo{margin-left:-.06em} Or, you could well use your own stylesheet. Also, I haven't done anything about ampersands. Not many people style those, and so there's no sensible default. (GitHub)
    1 point
  20. You like to keep me busy don't you How's this? That along with a few tweaks/fixes has been committed. Don't forget to fork and contribute
    1 point
  21. @joe_g Setting 'Maximum length' to '0' (indicates no maximum) under the 'Input' tab in the textfield setup will do the trick. Works for inputfieldText, but not for InputfieldTextarea. Setting 'Maximum length' to '0' is not meant for this and the missing trim() in InputfieldText::setAttributeValue() could be added in future PW versions. If you need the spaces in the output in general, its better to add via template file.
    1 point
  22. New version now supports running actions via the API. Here's an example of copying content of a field from one page to another. Simply load the module, and call the action class name as a method while passing the required options as an array: $options = array( 'field' => 99, 'sourcePage' => 1131, 'destinationPage' => 1132 ); $modules->get("ProcessAdminActions")->CopyFieldContentToOtherPage($options); Hopefully you'll find a use for this in your hooks or template files.
    1 point
  23. Quick update to the CreateUsersBatcher action. It now allows two options: 1) Define Username and email address (requires EmailNewUser to generate password). 2) Define additional user template fields (whichever ones you want). If you use this option and include the password, then you don't need the EmailNewUser module. You could even given all staff at a client's office the same temp password and let me know by phone (this way there is no security risk with emailing even a temporary password that will be changed) - it's your choice. Hopefully this screenshot will help to explain it better - note that the "New Users" textarea lists the fields from the user template and the order they need to be entered. In this example I have additional "first_name" and "last_name" fields, as well as the field added by the PasswordForceChange module which you can set to 1 to enforce this if you want.
    1 point
  24. For those of you who are experienced with the PW API (and those looking to learn), there is now an "Action Code" viewer that shows the executeAction() method of the action you are about to execute. It is of course collapsed by default and only available to superusers. Anyway, hope you'll find it useful and either reassuring (if you're worried about what code it about to be executed on your site), or informative as to what can be done with the API.
    1 point
  25. Ok, the optional author links are now available. These are the current options: protected $authorLinks = array( 'pwforum' => '985-adrian', 'pwdirectory' => 'adrian-jones', 'github' => 'adrianbj', );
    1 point
  26. Thanks for the answers @kongondo. Both Media Manager and Visual Page Selector look like useful and clever modules, although the cost/features ratio favours MM. I think what would be really fantastic is something in between the feature set of MM and VPS, and this could perhaps be accomplished by borrowing some of the features developed for MM into VPS. To explain, something I think PW is missing is custom fields for images (and I'm not alone: this GitHub request from today has 4 upvotes in 2 hours). There are loads of use cases for this, but one example: you are using images in your site that have a Creative Commons Attribution license. To fulfill the terms of the license each image needs the following fields attached: Author (text), Source link (URL), License (Page select), License link (URL, although in fact you'd probably store the URL for each license in the License page field). The ImageExtra module only supports textarea custom fields so it's not the right solution. What would work is a page-per-image approach with the custom fields for the image stored in the image's page. VPS is a big step towards making this a workable solution, but to use this as a replacement for a standard image field some extra features are needed beyond what is currently offered... 1. There needs to be an easy way to edit the image's custom fields from the Page inputfield. A modal link to Page Edit is all that's needed to begin with - this is something that's possible with existing inputfields such as AsmSelect. Somewhere down the line this could maybe be enhanced with AJAX loading of the custom fields into the list view of VPS, as per repeaters (just dreaming here). 2. There needs to be an easy way to add an image (page) from the inputfield. This is possible with most existing Page inputfields if the template and parent for allowed pages is defined. Basic support for this would be to open the Add Page form in a modal (the Page Field Edit Links module does something like this). But to be a closer match to existing image field functionality it would be nice to be able to upload multiple images at once. This feature is in MM - could it be added to VPS? (when template and parent are defined for the field). 3. There needs to be an easy way to embed an image into CKEditor. This feature is in MM - could it be added to VPS? Really keen to hear your thoughts on this. Thanks!
    1 point
  27. I would give it a little bit more time. It's not always true that no older files than 'current time - 86400 seconds' should exist. probability/divisor = 1/100 = 1% : The garbage collector will run once per 100 new sessions, and then clear all files older than 86400. Although, if you already have 7000 session files, it should be pretty close to exactly 86400 seconds.
    1 point
  28. Soma is owed so many kegs of beer by the folks he's helped — he can afford to give some away.
    1 point
  29. You can't do this just out of the box but with a autoload module you could easily accomplish this. Also there's useful needed features in there for an editor. Why is this a problem? It may not necessary in most cases... In PW, almost all of these things can be changed modified using hooks on what builds them in the admin. So if you really want to do it, the best way would be through a module like the /site/modules/HelloWorld.module It shows some example of hooks and is worth a look and have a play anyway. This following module hides the InputfieldWrapper "Who can access this page"? in the settings tab for user having a role "editor". <?php class AdminHelperHooks extends WireData implements Module { public static function getModuleInfo() { return array( 'title' => 'My Admin Helper Hooks', 'version' => 1, 'singular' => true, 'autoload' => true ); } public function init() { // add hook to the page edit module and the method that creates the wanted fieldset $this->addHookAfter('ProcessPageEdit::buildFormRoles', $this, "removeSettings"); } function removeSettings(HookEvent $event){ // check what role the user has, if not has editor role do nothing if(!wire("user")->hasRole("editor")) return; // $event->return being the inputfield wrapper $wrapper = $event->return; // set the inputfield wrapper to hidden $wrapper->collapsed = Inputfield::collapsedHidden; // we're done } } Create a new file AdminHelperHooks.module with this code in a new folder /site/modules/AdminHelperHooks/ Install and test with editor user.
    1 point
×
×
  • Create New...