Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 12/16/2016 in all areas

  1. FieldtypeFields Fieldtype for storing field references with various filter possibilities. See Modules directory Download at GitHub
    5 points
  2. Been there done that. I proudly present a ProcessWire 3 compatible version with the latest HybridAuth (only tested with Facebook). The code can be found on Github https://github.com/jmartsch/processwire-social-login with installation instructions. Please add your suggestions or create pull requests. The module and its dependencies are installed via composer. Have phun!
    5 points
  3. This latest version on the dev branch includes several tweaks, fixes, upgrades and some nice optimizations. This post covers them all, plus a look at our new Page field configuration. Then we conclude with some fun API tips and tricks. https://processwire.com/blog/posts/pw-3.0.45/
    4 points
  4. Hi, Here is a recent discussion (with some other links to related topics) that might get you started:
    3 points
  5. @renobird We planned to do a view things with it: Put the field a 'repeater like field' to allow a user to set the columns for ListerPro. Build stylesheets for the visuals for listerPro. Changing Field labels within ListerPro. The Fieldtype will be used inside other Modules, where you want to give the user some 'controlled access' to field properties.
    3 points
  6. Some more resources you might also find useful: http://modules.pw/ https://gist.github.com/blynx/92f9472712a823ef01180509b3e36ae1 https://processwire.com/api/ref/module/
    3 points
  7. Google is your friend, lots of results in there. Some of the more useful... Ben's beginner's tutorial on tuts+ Teppo's articles on textformatter modules and hooks (you'll need hooks if you are writing modules.) The example "Hello World" module that ships with PW. Other threads from the forum: A, B & C. Hope that helps!
    3 points
  8. Hi everyone, Here's a new module that I have been meaning to build for a long time. http://modules.processwire.com/modules/process-admin-actions/ https://github.com/adrianbj/ProcessAdminActions What does it do? Do you have a bunch of admin snippets laying around, or do you recreate from them from scratch every time you need them, or do you try to find where you saw them in the forums, or on the ProcessWire Recipes site? Admin Actions lets you quickly create actions in the admin that you can use over and over and even make available to your site editors (permissions for each action are assigned to roles separately so you have full control over who has access to which actions). Included Actions It comes bundled with several actions and I will be adding more over time (and hopefully I'll get some PRs from you guys too). You can browse and sort and if you have @tpr's Admin on Steroid's datatables filter feature, you can even filter based on the content of all columns. The headliner action included with the module is: PageTable To RepeaterMatrix which fully converts an existing (and populated) PageTable field to either a Repeater or RepeaterMatrix field. This is a huge timesaver if you have an existing site that makes heavy use of PageTable fields and you would like to give the clients the improved interface of RepeaterMatrix. Copy Content To Other Field This action copies the content from one field to another field on all pages that use the selected template. Copy Field Content To Other Page Copies the content from a field on one page to the same field on another page. Copy Repeater Items To Other Page Add the items from a Repeater field on one page to the same field on another page. Copy Table Field Rows To Other Page Add the rows from a Table field on one page to the same field on another page. Create Users Batcher Allows you to batch create users. This module requires the Email New User module and it should be configured to generate a password automatically. Delete Unused Fields Deletes fields that are not used by any templates. Delete Unused Templates Deletes templates that are not used by any pages. Email Batcher Lets you email multiple addresses at once. Field Set Or Search And Replace Set field values, or search and replace text in field values from a filtered selection of pages and fields. FTP Files to Page Add files/images from a folder to a selected page. Page Active Languages Batcher Lets you enable or disable active status of multiple languages on multiple pages at once. Page Manipulator Uses an InputfieldSelector to query pages and then allows batch actions on the matched pages. Page Table To Repeater Matrix Fully converts an existing (and populated) PageTable field to either a Repeater or RepeaterMatrix field. Template Fields Batcher Lets you add or remove multiple fields from multiple templates at once. Template Roles Batcher Lets you add or remove access permissions, for multiple roles and multiple templates at once. User Roles Permissions Batcher Lets you add or remove permissions for multiple roles, or roles for multiple users at once. Creating a New Action If you create a new action that you think others would find useful, please add it to the actions subfolder of this module and submit a PR. If you think it is only useful for you, place it in /site/templates/AdminActions/ so that it doesn't get lost on module updates. A new action file can be as simple as this: <?php namespace ProcessWire; class UnpublishAboutPage extends ProcessAdminActions { protected function executeAction() { $p = $this->pages->get('/about/'); $p->addStatus(Page::statusUnpublished); $p->save(); return true; } } Each action: class must extend "ProcessAdminActions" and the filename must match the class name and end in ".action.php" like: UnpublishAboutPage.action.php the action method must be: executeAction() As you can see there are only a few lines needed to wrap the actual API call, so it's really worth the small extra effort to make an action. Obviously that example action is not very useful. Here is another more useful one that is included with the module. It includes $description, $notes, and $author variables which are used in the module table selector interface. It also makes use of the defineOptions() method which builds the input fields used to gather the required options before running the action. <?php namespace ProcessWire; class DeleteUnusedFields extends ProcessAdminActions { protected $description = 'Deletes fields that are not used by any templates.'; protected $notes = 'Shows a list of unused fields with checkboxes to select those to delete.'; protected $author = 'Adrian Jones'; protected $authorLinks = array( 'pwforum' => '985-adrian', 'pwdirectory' => 'adrian-jones', 'github' => 'adrianbj', ); protected function defineOptions() { $fieldOptions = array(); foreach($this->fields as $field) { if ($field->flags & Field::flagSystem || $field->flags & Field::flagPermanent) continue; if(count($field->getFieldgroups()) === 0) $fieldOptions[$field->id] = $field->label ? $field->label . ' (' . $field->name . ')' : $field->name; } return array( array( 'name' => 'fields', 'label' => 'Fields', 'description' => 'Select the fields you want to delete', 'notes' => 'Note that all fields listed are not used by any templates and should therefore be safe to delete', 'type' => 'checkboxes', 'options' => $fieldOptions, 'required' => true ) ); } protected function executeAction($options) { $count = 0; foreach($options['fields'] as $field) { $f = $this->fields->get($field); $this->fields->delete($f); $count++; } $this->successMessage = $count . ' field' . _n('', 's', $count) . ' ' . _n('was', 'were', $count) . ' successfully deleted'; return true; } } This defineOptions() method builds input fields that look like this: Finally we use $options array in the executeAction() method to get the values entered into those options fields to run the API script to remove the checked fields. There is one additional method that I didn't outline called: checkRequirements() - you can see it in action in the PageTableToRepeaterMatrix action. You can use this to prevent the action from running if certain requirements are not met. At the end of the executeAction() method you can populate $this->successMessage, or $this->failureMessage which will be returned after the action has finished. Populating options via URL parameters You can also populate the option parameters via URL parameters. You should split multiple values with a “|” character. You can either just pre-populate options: http://mysite.dev/processwire/setup/admin-actions/options?action=TemplateFieldsBatcher&templates=29|56&fields=219&addOrRemove=add or you can execute immediately: http://mysite.dev/processwire/setup/admin-actions/execute?action=TemplateFieldsBatcher&templates=29|56&fields=219&addOrRemove=add Note the “options” vs “execute” as the last path before the parameters. Automatic Backup / Restore Before any action is executed, a full database backup is automatically made. You have a few options to run a restore if needed: Follow the Restore link that is presented after an action completes Use the "Restore" submenu: Setup > Admin Actions > Restore Move the restoredb.php file from the /site/assets/cache/AdminActions/ folder to the root of your site and load in the browser Manually restore using the AdminActionsBackup.sql file in the /site/assets/cache/AdminActions/ folder I think all these features make it very easy to create custom admin data manipulation methods that can be shared with others and executed using a simple interface without needing to build a full Process Module custom interface from scratch. I also hope it will reduce the barriers for new ProcessWire users to create custom admin functionality. Please let me know what you think, especially if you have ideas for improving the interface, or the way actions are defined.
    2 points
  9. Thanks Guys... I like @tpr's suggestion...
    2 points
  10. I was just going to dredge up that simple example I posted, but @szabesz beat me to it. Start with something simple. Once you get the hang of the basics, more complicated things will become clearer. As LostKobrakai mentioned, looking at core (and/or 3rd party) modules is super helpful. Post code on the forums when you get stuck.
    2 points
  11. What do you do with this — I'm dense today.
    2 points
  12. Media Manager version 009 (released 16/12/2016) Happy to announce the latest release of Media Manager. Changelog Filter Profiles: Feature enables configuring of various media filter interfaces (similar to ListerPro). This feature was requested here. Please see otes below Filter Profiles Usage To use the so-called Filter Profiles feature, you will first have to enable it in your settings (see images below). Head over to any media view. You will see a 'config' tab next to the Filters tab. Click on it. It will open a modal Create your profiles (one at a time). These are added to a table in that modal view. Click on the title of a filter profile to configure it's filters. Moves to 'single filter profile edit view' Set a filter as active by selecting it in the dropdown at the top of the modal view (#2) To delete one or more filter profiles, click their trash icon and save (there's a checkbox to confirm action) Close the modal. The Media Manager Library will reset and if you set an active filter in #5, your Media will be filtered according to your settings Currently, any user can create filters. Depending on your feedback, this might change. We might also add other features, e.g. locking down filters so they cannot be deleted. OK, that's it from Media Manager for this year. Hope it's been fun! Thanks.
    2 points
  13. You can use wireshell as well. This is really handy. Just give the following command and grab a coffee wireshell page:emptytrash I'm not really sure if it will delete everything in one run, but I deleted 60k pages the other day without problems. Really fast too and the main advantage is that you are not tied to a PHP session.
    2 points
  14. Oh yeah, I have googled up... ALOT before I could ask question here in this thread ( I should have made that clear earlier). I always end up with different result like PW for beginner, some thread discussion on something else and etc... I guess, google isn't friendly to me today . Thank you for your help, everything you gave out will do good for me!
    2 points
  15. Admin Custom Files Admin Custom Files is a simple module that can add custom javascript plug-ins, scripts and styles to the Processwire admin area. Instructions are on github. Download module at GitHub Download at the modules directory
    1 point
  16. ProcessPageListerUrls Create links to specific ListerPages with predefined selector, column and sort settings. See GitHub for more information. Download ProcessPageListerUrls on GitHub
    1 point
  17. Just one of those things I often find myself wishing for: Could a future update add a "Siblings" list tab (or make a "Children & Siblings" combined tab) to /page/edit/? Save + Next is a godsend, but in many cases I need to jump around instead of cycling through. Sometimes I just want to reference how I titled other pages under one parent to keep the naming consistent. Other times I'm deep enough in my page tree that it's a half-dozen or so more clicks than I'd like to get back to where I was. So far my workaround is to right-click on the parent's name in the Breadcrumb nav, and open the page tree in a new tab. But when editing a site often has me opening ten or more browser tabs at a time, each one I can cut out is a blessing. Thanks for your consideration!
    1 point
  18. You don't have to symlink anything - just keep the CKEditor plugin inside your module folder and then load that path as an external plugin.
    1 point
  19. I just private messaged you with some stuff, but for anyone else that is following the discussion, check out how Hanna Code Helper handles the loading of a CKEditor plugin: https://github.com/teppokoivula/HannaCodeHelper/blob/c26b3b7eeafa17dd8500dc1b89cbb88218ceca9c/HannaCodeHelper.module#L55-L97
    1 point
  20. @ryan, could you please make a full profile of the updated Skyscrapers demo available? So it is easily installable for people to try out, like the previous version. It has come up a couple of times in the forums recently.
    1 point
  21. With pagefields now being filterable at runtime is it also ready for paginated inputfields? I'd think it should be.
    1 point
  22. Keep the new only and offer a download link to the old one.
    1 point
  23. Thank you @szabesz @LostKobrakai I'd do same as you ... although collect some resources can increase better understanding how module works, especially help to detect bugs lot easier.
    1 point
  24. 1 point
  25. A brand new AdminCustomFiles! That's what I have, but it's NameSpaced, and I'm not keen to make it compatible with ProcessWire2.8 or lower. Essentially it looks like the same Module, but it's rewritten, nothing of the old have survived, although all features work foor 99% the same. I don't want to loose the name, but don't want the older version gets lost. So, now I'm in trouble I'm not sure how bring this version up to the public. What do you guys think... Should I zip the old and put it in to the Module, of create a new Name...
    1 point
  26. I've learned a lot from looking into the core modules.
    1 point
  27. The javascript error is most likely just caused by the php error, which does return html markup instead of the expected json content. So I'd rather expect that php does have some problems on the actual upload of the file / or moving it from the temp folder to it's final location. So I'd rather look into known issues on the php side, even though I cannot help you narrowing it down even more.
    1 point
  28. Here is a good starter profile based upon the twitter bootstrap framework: https://processwire.com/talk/topic/13572-bootstrap-4-minimal-site-profile/
    1 point
  29. Welcome to ProcessWire and the forums @vvanasperen . A theme, in the sense you describe it, is a so-called 'site-profile'. We don't really have themes in ProcessWire. Personally, I think a great place to start is reading the docs, the basics. My motto would be I can make it all nice and shiny (theme) later, once I get to know the basics. If you already have a PHP background, great, you will be quite comfortable. If not, you will need to learn a few PHP basics in order to use ProcessWire, Here's a couple of docs to get you started: https://processwire.com/docs/tutorials/ http://processwire.com/api/variables/page/ : must know http://processwire.com/api/variables/pages/ : must know Sorry, typing in a hurry...but others will chime in am sure.
    1 point
  30. Hi @szabesz, looks like it's working with the default ProcessPageLister (not much testing over there.)
    1 point
  31. If you link to GitHub, please use the commit-id (instead of branch-names). Otherwise, future editions could make those links pointless. … … Example usage: Blog and Matrix modules. Protip: To get the SHAified url on GitHub, go to any file you want to link to (e.g. https://github.com/kongondo/Blog/blob/master/ProcessBlog.module) and press Y (without anything, just y) on your keyboard.
    1 point
  32. In your root directory find the .htaccess file. Inside that file check for RewriteBase It must be uncomment something like: RewriteBase /pw
    1 point
  33. @adrian I just added my two newbie cents to the Github thread. A slightly cleaner and more "additive" solution would be this, I guess: $repeaterItem->addStatus(Page::statusUnpublished); $repeaterItem->removeStatus(Page::statusOn); However, that's still a rather ugly workaround for PW's confusing behavior.
    1 point
  34. It seems to me I just had to set the rewrite_base in the distributed processwire .htaccess
    1 point
  35. Hello @MilenKo, maybe you get the error, because you try to output $results instead of $result, which seems to work. Regards, Andreas
    1 point
  36. That's great BitPoet, thank you! Works as advertised in my 3.0.42 installation. I'll flag it to keep an eye on after future updates, though. Thanks again! ETA: It does seem to cause a conflict with the user page edit, FYI anyone who comes along later. I'll just turn it on and off when I need it and then remove it before the site goes live. Or see if I have some time to try and debug it.
    1 point
  37. Would you mind adding a note to that issue to confirm that you are seeing it also? Thanks! Yes, that works, but probably not a good idea, because status values are additive - it may not really matter with repeaters, but I would still recommend that we get Ryan to sort out the source of the problem.
    1 point
  38. @CalleRosa40 - you may want to look at this: https://github.com/processwire/processwire-issues/issues/36#issuecomment-258702228 Firstly, it shows how to unpublish a repeater, but it also shows that there is currently a bug with this - at least as far as I can tell, but Ryan hasn't responded to my last post, so will have to wait and see. I'd love your feedback on that Issue if you can also confirm what I am seeing.
    1 point
  39. <?php /** * Add "Siblings" tab to page editor. * */ class PageEditSiblings extends WireData implements Module { public static function getModuleInfo() { return array( "title" => "Page Edit Siblings", "summary" => _("Add siblings tab to page edtior"), "version" => "0.0.1", "autoload" => true ); } public function init() { $this->addHookAfter("ProcessPageEdit::buildForm", $this, "addSiblingsTab"); } public function addSiblingsTab(HookEvent $event) { $edit = $event->object; $form = $event->return; $master = $edit->getMasterPage(); $page = $master ? $master : $edit->getPage(); $wrap = $this->buildFormSiblings($edit, $form, $master, $page); $form->insertAfter($wrap, $form->get("ProcessPageEditChildren")); } public function ___buildFormSiblings($edit, $form, $master, $page) { $wrapper = $this->wire(new InputfieldWrapper()); $id = $this->className(); $wrapper->attr('id+name', $id); if(!empty($settings['ajaxChildren'])) $wrapper->collapsed = Inputfield::collapsedYesAjax; $defaultTitle = $this->_('Siblings'); // Tab Label: Siblings $title = $this->page->template->getTabLabel('siblings'); if(!$title) $title = $defaultTitle; if($page->parent->numChildren > 1) $wrapper->attr('title', "<em>$title</em>"); else $wrapper->attr('title', $title); $this->addTab($edit, $id, $title); if(!$edit->isPost) { $pageListParent = $page->parent; /** @var InputfieldMarkup $field */ $field = $this->modules->get("InputfieldMarkup"); $field->label = $title == $defaultTitle ? $this->_("Sibling Pages") : $title; // Siblings field label if($pageListParent->numChildren > 1) { $field->value = $this->renderPages($pageListParent->children(), $page); } else { $field->description = $this->_("There are currently no siblings of this page."); } if($page->addable()) { /** @var InputfieldButton $button */ $button = $this->modules->get("InputfieldButton"); $button->attr('id+name', 'AddPageBtn'); $button->attr('value', $this->_('Add New Page Under Parent')); // Button: add new child page $button->icon = 'plus-circle'; $button->attr('href', "../add/?parent_id={$page->parent->id}" . ($this->input->get('modal') ? "&modal=1" : '')); $field->append($button); } $wrapper->append($field); } return $wrapper; } public function ___renderPages($list, $cur) { $out = '<div class="PageList" style="display: block;">' . "\n"; foreach($list as $p) { $out .= ($p == $cur) ? "<div class='PageListItem'>{$p->title}</div>\n" : "<div class='PageListItem'><a href='{$this->page->url}?id={$p->id}' title='{$p->name}' class='PageListPage label'>{$p->title}</a></div>\n" ; } $out .= "</div>"; return $out; } protected function addTab($edit, $siblingid, $siblingtitle) { $tabs = $edit->getTabs(); $removed = array(); foreach(array_reverse($tabs) as $id => $title) { if($id == "ProcessPageEditChildren") { break; } $removed[$id] = $title; $edit->removeTab($id); } $edit->addTab($siblingid, $siblingtitle); foreach(array_reverse($removed) as $id => $title) { $edit->addTab($id, $title); } } } Only tested on PW 3.0.34 but should (I hope) work on any 2.7.x / 2.8.x / 3.0.x install. Large parts stolen from ProcessPageEdit::___buildFormChildren.
    1 point
  40. You can use from the API: $pages->emptyTrash(); It's even better if you can do it by bootstraping PW from the terminal.
    1 point
  41. I started a tutorial but never got to finish it as Work got more tedious it has enough to get started. hopefully i should finish this off assuming API hasn't changed
    1 point
  42. Definitely an issue with the loop (a typo, to be precise). This: foreach(array($usrpache, $sprache, $dsprache) as $lang) { should contain $usprache instead of $usrpache.
    1 point
  43. Great idea and great module! Saves me some rather ugly additions to the displayed title page in the page tree. One thing for the Christmas wish list: It would be even greater if the module would provide a way to set up several different rule sets. So you could set up different icons to mark different things.
    1 point
  44. My guess why PW isn't listed in the most popular CMS systems is because it ain't visible in HTML right away. In my opinion we're lucky about that so any type of hacking is therefor also very limited (look at WP ).
    1 point
  45. tpr, this is awesome stuff.
    1 point
  46. v109 is up - see the readme file on date formattig: PageListTweaks: ability to format unix timestamps in pagelists PageListTweaks: using %field.property% will output the value in the user's language (if available) PageListTweaks: always show extra actions fixed language translator filterbox not appearing possible fix for unclickable select dropdowns in ProDevTools API Explorer (reported by Robin S.) "Always show extra actions" was a client request and removes the need to click on the ">" icon to see the extra actions. This can be handy for power users or when you often need to toggle pub/hidden states of pages. Or simply lazy
    1 point
  47. @Neo Have you seen this? You might utilize it on the frontend with something like: http://www.hongkiat.com/blog/useful-calendar-date-picker-scripts-for-web-developers/ Do not forget that you might want to let your users partially access the admin, so that they can do both... But this is just an idea.
    1 point
  48. Or you might want to do it by using Google. Ryan's blog post might help you get started: https://processwire.com/blog/posts/composer-google-calendars-and-processwire/#the-google-client-api-module To tell the truth, I've never used Google Calendars myself, so I do not know how well it could fit your needs, but some of my friends rely on these Calendars and use them to manage reservations.
    1 point
  49. Thanks for mentioning Yannick, I guess you're right, I tried this before but I guess because of the caching issue it didn't work, so now I can try the shorter version again seems to work, thanks @Yannick Albert
    1 point
×
×
  • Create New...