Jump to content

Search the Community

Showing results for tags 'module'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to ProcessWire
    • News & Announcements
    • Showcase
    • Wishlist & Roadmap
  • Community Support
    • Getting Started
    • Tutorials
    • FAQs
    • General Support
    • API & Templates
    • Modules/Plugins
    • Themes and Profiles
    • Multi-Language Support
    • Security
    • Jobs
  • Off Topic
    • Pub
    • Dev Talk

Product Groups

  • Form Builder
  • ProFields
  • ProCache
  • ProMailer
  • Login Register Pro
  • ProDrafts
  • ListerPro
  • ProDevTools
  • Likes
  • Custom Development

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests

  1. Is it possible to make a "Add New" Shortcut-Button on a Custom Admin Page e.g in the ProcessDashboard Module instead on the Sitetree Page?
  2. Are there any modules for Comment System and Upvote Downvote System in PW? I would like to implement a comment system in PW. Used WP in the past and it is built in. Are there any modules for that? Also another feature of my website would be upvote downvote system. Where users can vote on a POST and then it will show up on my sidebar let say as POPULAR POSTS or I could just get it via how many views my posts gets Thank you
  3. Hello everbody I want to make a autoload module that checks if the current page template exist, when not it should make a redirect to its parent page. I thought of something like this: public function init() { if(!$this->page->template->filenameExists()) continue; $this->session->redirect($this->page->parent->url); } My Problem is that when i add a Page via Fredi from the Frontend it redirects to a page that doesnt exist in the frontend. This is because I create Classifications Pages that have a template but not a template file because its not necessary in my case. I know, that i could just write in the templates something like this: $session->redirect($page->parent->url); But they are 8 templates that i have to create and write this and in my view that is unnecessary when i could achieve this only via a module. Thank you for your attention - Nukro
  4. Hi I am looking to purchase the form builder as part of our move to Processwire but there is one outstandling item on my research that I need answered. The form builder does 99% of what I need. However, I need to be able to build forms with a custom address lookup component. Is this something we can add as a custom field into the form builder? Thx Z
  5. Anyone made or or would be interested in a instagram module that displays a profiles images? also if you have any pointers that would be helpful. Thanks
  6. Plyr Media Player for ProcessWire ! beta status. This module is "work in progress" v0.2 ! Please be patient as this is my very first public module ^^ This module adds the Plyr HTML5 Media Player (plyr.io) to ProcessWire. Plyr is basically a wrapper for the natural media interface in modern browsers. It adds the ability for easy styling via CSS and a sprite, while being fully responsive. Also Plyr gives you full controll over the player with its great javascript interface. MarkupPlyrMediaPlayer incorporates Plyr for ProcessWire. -> GitHub -> Module directory Current capabilities After installation, you will notice some module configuration options. These are: - Automatic Mode If enabled, this option will automaticaly add all needed resources into your pages output. - Use CDN Use the official Plyr CDN (Content Delivery Network) for resources? The following resource options are only required if you don't wish to use the CDN: - Path to CSS file (Path to your CSS file, required to style the players.) - Path to Plyr library (Path to the Plyr javascript library, required for the functionality.) - Path to SVG sprite (Path to your SVG sprite image file, required to style the players.) Automatic mode If automatic mode is enabled, the module hooks after the page rendering and automatically adds the stylesheet to HTML head. Also adds an AJAX call to fetch the SVG sprite and the Plyr javascript library right before the ending body-tag. Also, while in automatic mode, that extra markup will only be rendered if a template made a render request for a Plyr player. So there will be no unnecessary load on your site. Get module $plyr = $modules->get("MarkupPlyrMediaPlayer"); Add a video player to your template echo $plyr->renderVideoPlayer($poster, $mp4, $webm, $captions); The $captions-Array contains details of the caption tracks: $captions = $caption = array(); $caption['label'] # Something like "English captions" $caption['src'] # http://...movie_captions_en.vtt $caption['srclang'] # en|de|ru|... $caption['default'] # true|false array_push($captions, $caption); Add an audio player to your template echo $plyr->renderAudioPlayer($mp3Path, $oggPath); Add the YouTube-wrapper to your template echo $plyr->renderYoutubePlayer($videoId); Manual mode If automatic mode is disabled, you have to render these parts manualy in your page template. Important: This method will not check if a player was requested. In the HTML head: <html> <head> ... <?php echo $plyr->renderHeadLink(); // Basicly just a <link rel="stylesheet" href="..."> ?> </head> ... And in the footer somewhere before the closing body-tag: ... echo $plyr->renderScripts; // AJAX call for SVG and JS library inclusion </body> </html> Where is this going? Before getting a v1.0.0 stable release, this module should be capable of following features: - [done] Load resources from CDN or local files - Reliable automatic mode with fallback to local - Brings specific Inputfields for video, audio and youtube for the backend and frontend markup rendering - Every Plyr javascript setting can be handled via module configuration
  7. Hi, I'm not sure if this can be useful or not. Check by your self. I have created a little module around a set of 42 svg icons. (nearly a copy from Windows 10 iconset). It is very rudimentary at the moment. One can define settings for colors and size of the svg variations. Variations will be created on demand in a central directory (assets/svgicons/) and cached for later usage. The settings can be passed as selectorstrings. You can use a template variable $icon. To output markup for a plain svg icon in an image tag, you need to call the name: echo $icon->img("name=lock"); echo $icon->img("name=unlock"); If you want use it as a rollover with hover state, you need to call the function markup: echo $icon->markup("name=attention"); This gives you markup with default settings. If you need a clickable link, just define it in the selector string: echo $icon->markup("name=attention, link=/about/"); You can set / change the default values from template like: $icon->setColors(array(0, 111, 187, 0.2), array(219, 17, 116, 1.0)); $icon->setSize(180); and / or you can use individual settings for each icon: echo $icon->markup("name=document, size=32, color1=#775599, color2=blue, link=/about/"); // HEX colors or named colors echo $icon->markup("name=idea, size=120, color1=255-255-0-0.3, color2=255-255-0-1, link=/about/"); // RGBA colors echo $icon->markup("name=home, size=20, color1=230-0-0, color2=230-0-0, link=/about/"); // RGB colors . For the rollover / hover markup there is a piece of css needed what can be outputted (only once). It can be fetched with or without the style-tags: echo $icon->css(); // with style tags echo $icon->css(true); // suppress the style tags . The functions that does not output markup return the module itself (the $icon object). So you can use them chained: // all functions that can be chained: $icon->emptyCache()->setSize(100)->setColors(array(0, 111, 187, 0.25), array(243, 79, 159)); // after such a (re)set call, you only need to pass a name to each icon call to get consistent results: echo $icon->markup("name=lock, link=/logout/"); echo $icon->markup("name=unlock, link=/login/"); // you can override single settings, ->mu() is a shortcut for ->markup() echo $icon->mu("name=trash, size=200"); echo $icon->mu("name=key, color2=red"); // ->presentation() print the whole collection with optionally individually specified size and colors: echo $icon->presentation(100, array(0, 111, 187, 0.25), array(243, 79, 159)); . . . The code is here in a gist: https://gist.github.com/horst-n/f6922f6fa228991fd686 . Download it as ZIP! . . A live demo is here: http://images.pw.nogajski.de/svg-icons/ . .
  8. My wife kindly asked why it isn't possible to type tabulators in an inputfield. Here is the answer: Inputfield which allows using the tab key to write tabulators in an Inputfield. Disables switching field focus functionality of the tab key. Use the mouse to get to the next input. Against some principals module doesn't respect minimum accessibility guidelines. Download from github https://github.com/kixe/InputfieldTextareaTabKey Tested in Firefox and Safari on Mac.
  9. I have a PW site which is integrated with Snipcart and now the owners want to add stock management. Because each item comes in different sizes and colours, I'm using a repeater field with each row containing a size column. The guys at Snipcart have written a blog post on how to achieve basically what I need in a plugin for Craft CMS. I need that converted into a module for PW and instead of updating an individual field, it's updating a column in a repeater field. Anyone able to help me out with that?
  10. Some time ago there was a question if it's possible to change the "name" field on the users to "Username". Here's how I answered with a module example. May it be helpful to someone. <?php class UserNameLabel extends WireData implements Module{ public static function getModuleInfo() { return array( 'title' => __('UserNameLabel', __FILE__), // Module Title 'version' => 100, 'summary' => __('Overwrite User Name Label', __FILE__), // Module Summary 'autoload' => true ); } public function init() { // only add hook if on user pages if(strpos($_SERVER['REQUEST_URI'],'/users/') !== FALSE ) $this->addHookAfter("Inputfield::render", $this, "changeLabel"); } public function changeLabel($event){ $inputfield = $event->object; // only if the right inputfield if(!$inputfield instanceof InputfieldName ) return; // overwrite the label return $event->object = $inputfield->label = __("Username"); } } UserNameLabel.module.zip
  11. New Module which adds 1 more, but very tiny green buttons to the page list. It saves minimum 3 klicks to change page status from hidden to visible. Edit: update 11.12.14 Module provides up to 3 (more) buttons in page list to toggle status (hidden/visible, published/unpublished and locked/unlocked). Enable/Disable the buttons in the settings (screenshot) ProcessPageStatusToggler.module
  12. Zero setup page rendering with caching, with simple replacements. Useful if you have complicated templates (or a large number of less complicated ones), where you often need to do a small number of adjustments. In this case, caching on the template level doesn't completely make sense — because it either uses cache, or doesn't. This module solves this problem by using markup cache all the time, but allowing us to modify the output by replacement of simple strings. - On GitHub - On modules.processwire.com Edit: Also, small thanks to Tom Reno for testing what single language install return for $user->language
  13. hello world sometimes it would very helpful if there would be a «cross asset selector». my idea is to upload the images/pdfs etc. just once in a manager (similar to soma's images manager) and then to be able to select the assets via regular image field (or a new one). clients wouldn't have to upload the images more than once (and crop, resize etc.) and it would save a lot of disk space. any feedback about the idea? thanks
  14. Just thought I'd share this module which I modified from the PageEditPerUser module by Ryan Cramer. I needed page-specific edit access by roles, not by user. So... Overview Assign edit access to roles on a per-page basis. Description The user must already have page-edit permission on one of their roles in order to get edit access to assigned pages. Otherwise, they will only gain view access. This module is fully functional as-is, but intended as a proof-of-concept for those wanting to go further with adding custom edit and/or view access. How to install 1. Copy the PageEditPerRole.module file to /site/modules/ 2. Go to Modules in the ProcessWire admin and click "Check for new modules" 3. Click "install" for "Page Edit Per Role" How to use 1. Create a new role called "editor" (or whatever you want to call it) and give the role "page-edit" permission. If you already have a role in place that you want to use, that is fine too. 2. Under "Access > Roles" locate the role you want to assign edit access to. Edit this role. 3. For this roles's "Editable Pages" field: select one or more pages you want users with this role to be able to edit. 4. Save the role. 5. Under "Access > Users" locate the user you want to apply the role to. Edit this user. 6. For this user's "Roles" field, select the new role you added - "editor". 7. Save the user and your are done. 8. To test, login as the user you edited to confirm it works how you expect. Download http://modules.processwire.com/modules/page-edit-per-role/
  15. TextformatterImageInterceptor ( Textformatter module ) Let editors use WYSIWYG images, but let you control the image size, aspect ratio & behaviour. How to install Copy the TextformatterImageInterceptor.module file to your /site/modules/ directory (or place it in /site/modules/TextformatterImageInterceptor/). Click check for new modules in ProcessWire Admin Modules screen. Click install for the module labeled: "Image Interceptor". Go to the module config screen and set the settings you wish. How to use Edit your body field in Setup > Fields (or whatever field(s) you will be placing controlled images in). On the details tab, find the Text Formatters field and select "Image Interceptor". Save.About the settings Render Inline styles If checked, some inline styles are added to the image.High Density Double the pixel width of an image if the percentage is not set. (fixed image size)Default there are settings for landscape & portrait images. Squared images will inherit all settings belonging to portrait settings and there's a way to escape the default settings. But before we dive deeper in tagged sets I want to spread some light on the landscape/portrait settings. All images portrait/landscape wil get the class name .default. ps, All images including tagged set images get the image orientation as class (.landscape / .portrtait) Percentage The width of the image in percentage. This setting makes the image responsive or if left blank the image wil be fixed size. Images receive a .responsive and a .p-50 class (where 50 is the width in percentage) Width The width of the image in pixels. So the width of the image in percentage and the pixel width combined wil be the key to pixel desity. Alignment There are 5 different ways to align an image. left, center, right, inherit (inherits from the WYSIWYG editor) and not aligned. If render inline styles is checked the aligment wil be set directly in the inline style of the image. Alignment classes wil be added to the image. Aspect Ratio (cropping) if an aspect ratio is given, the image will be cropped to the given ratio. If you type 2:1 in the landscape settings. Images 800 pixels wide, will be croped to a 800x400 image. The image gets the following classes: .cropped and .crop-2x1 Image Captions Type here your class name(s) for the caption. When a class name is provided and an image has a description, the image is wrapped (if not already) and *has-* is set in front of the class name(s). For the caption a div is created with the class name(s) and the image description as text. Next to these settings. You can give custom classes to images. This way you can give it framework specific classes for example. And you're allowed to wrap the images with custom HTML. (Some frameworks needs additional HTML to make images more fancy) Then additional styles could be added to images if render inline styles is checked. Tagged sets Tagged sets are an image tag followed by settings specific for images with that tag. To enable tagged sets, the image field need "Use Tags?" to be checked. Go to setup, then fields go to your image field and under the details tab check "Use Tags?". Taged sets are a good way to escape the default image behaviour. Say you have a bunch of nicely ordered images on the page, but you want to show a company logo on 150px floated left. With tagged sets it's no problem. type: (logo 150px left) on one line and you've created your first tagged set. (don't forget to tag the image to) If you want captions for a tagged set, keep in mind that captions need at least 1 class. The format to enter: caption.class-name. For an image wrapper we use the same rules. The only difference is we start typing wrapper followed by class names starting with a dot. example: wrapper.logo.stand-out. You can have a multitude of sets, every set on it's own line. Every set needs at least a tag-name and a pixel width. Note: If you use a wrapper or captions (wrapper will be created if none is set), the inline styles and specific width & alignment classes will be set to the wrapper and removed from the image. This way no duplication of styles wil take place. github modules directory
  16. I'm trying to modify the property 'path' for a specific Page (User, actually) using the following code: $this->addHookAfter("Page::path",$this,"modifyUserPagePath"); AND public function modifyUserPagePath(HookEvent $event){ $p = $event->object; if($p->template == "user" && $p->hasRole("ambassador")){ die("MODIFY THE PATH HERE WITH PREFIX FOR THE CURRENT VIEWING PAGE"); } } But i'm not able to retrieve the page that is currently running (as in, the page in the browser url). Please note I'm also using the render() method to render subpages content. I don't need the subpages url but only the original $page requested. Is there a pretty way to do this (besides looking it up via $_SERVER['REQUEST_URI'] )?
  17. jQuery DataTables 1.9.4 This module adds the great jQuery DataTables plugin for use in ProcessWire. You can load the module in the admin from any of your module using: $this->modules->JqueryDataTables; This will load the module and add CSS and Javascript from DataTables. This mostly would be used by a custom admin Process module. Note: Loading this module will just attach the necessary files to the admin. To use it you would need to add your own jQuery scripts and init the DataTables with something like. $("#mytable").dataTable(settings); For more informations on the DataTables options and API refer to http://datatables.net/ Download: http://modules.processwire.com/modules/jquery-data-tables/ https://github.com/somatonic/JqueryDataTables I included only the necessary files, and removed examples and docs from the package. NOTE: To avoid confusion, THIS module has nothing to do with my ProcessDataTable module for ProcessWire! ProcessDataTable was a proof of concept integrating it in a admin page. It included the jQuery DataTables plugin, but unfortunately it may wasn't a good way to. JqueryDataTables is a special js module like Fancybox. It is a "integration" of the jquery plugin for developers to use datatables in their modules. It won't be loaded unless you do so. An example would be the ModulesManager. They can coexist if you will.
  18. Hey, so after having used the Fieldtype Select for a few project I had some customers that wanted a radio version of this so I decided to modify it (not heavily) and make it work with radio buttons instead. I have it hosted up on github here so check it out and let me know if you have question or comments.
  19. Hey PW, I am only a starting developer and I am still in school and my experience with processwire is quite small but recently I've created my own module for Processwire and I kind of had to ask and copy a lot from other sources, now I want to create a small walk through tutorial for people with the same lack of knowledge as me And as a guide for myselfs in the future 1) Setting up the file. Okay, so we start of by making a new document in the Module root folder and call it Harmster.module for this example, we dont need to add the .php extension. Now every module in Processwire needs to extends the classes and methods from Processwire itselfs so we start off by typing class Harmster extends Process{ } You can also extend WireData, I don't really understand the difference but both work for me A module contains 2 standart classes, init() and getModuleInfo() init() This is kind of, or the same as a __construct() method, this always executes and is executed almost at creation. getModuleInfo() This is a method that is used to show the information in the Processwire CMS. We both need to add these to our fresh class like following: class Harmster extends WireData { public static function getModuleInfo() { return array( 'title' => 'Harmster', 'version' => 100, 'summary' => 'Harmster module' 'singular' => true, ); } public function init() { $this->setFuel("harmster", $this); } This is where I, as a starting developer, get really excited about this little code in the init() method $this->setFuel("harmster", $this); Basically creates your class in every template you are going to use and it is callable by $harmster Woah! awesome right! Now this is where I got stuck on, I the user to configure some options in the module :\ hmm... Well I just went asking on the forums and the super nice community of PW came to help me, Wanze in this case (no emoticon because its not allowed) (Check it for yourselfs, http://processwire.c...lds-for-module/) And basically you need to implement some methods from an another object, you should replace this, class Harmster extends WireData implements Module with class Harmster extends Process implements Module, ConfigurableModule But when you add that and try to use your module you'll see you get an error, we need to add one more method to the class called getModuleConfigInputfields add static public function getModuleConfigInputfields(array $data) { } 2) Adding a configurable and usable textbox But now you want to add some input fields, now this is pretty hmm complicated For a simple textbox you put this inside the method you just made: $modules = Wire::getFuel('modules'); $fields = new InputfieldWrapper(); $field = $modules->get("InputfieldText"); $field->attr('name+id', ''some_text_field_saved_name''); $field->attr('value', $data['some_text_field_saved_name']); $field->label = "Hamsters rule!"; $field->description = 'Enter a nice sentance here if you like hamsters'; $fields->append($field); Now you've created a input field and you can use it with $this->get(''some_text_field_saved_name''); in all your methods in this class (no emoticon because its not allowed) If you're lazy Now what you've created is a configurable module, heres a I am lazy and i want to pastey (no emoticon because its not allowed) class Harmster extends Process implements Module, ConfigurableModule { public static function getModuleInfo() { return array( 'title' => 'Harmster', 'version' => 001, 'summary' => '', 'href' => '', 'singular' => true, 'autoload' => true, ); } public function init() { $this->fuel->set("harmster", $this); } static public function getModuleConfigInputfields(array $data) { } } Now if you want to add a overview page, much like the setup, pages, acces and module tab in Processwire CMS default you can easily do this by adding 2 new methods in your class, install and uninstall 3) Creating your install and uninstall So you want to get a nice overview for your module now eh? Well we can do that because Processwire is awesome like that I did this for my module Now, we need to add 2 methods to our class, ___install and ___uninstall (yes, 3 underscores) So add this to your class: public function ___install() { } public function ___uninstall() { } I think that these are kind of self explaing, the one method gets executed when the user installs the module and the other one gets executed when the user deinstalls the module. Now we want to add a page to PW CMS, but how (no emoticon because its not allowed) Thats actually really easy, $page = $this->pages->get('template=admin,name='.self::PAGE_NAME); if (!$page->id) { $page = new Page(); $page->template = $this->templates->get('admin'); $page->parent = $this->pages->get($this->config->adminRootPageID); $page->title = 'MailChimp'; $page->name = self::PAGE_NAME; $page->process = $this; $page->save(); } This is how you install a page, notice that we name the page to self::PAGE_NAME therefor you want to add const PAGE_NAME = 'harmster-module'; with the name of your module BUT BUT now everyone can look in to this module D:< i dont want that! Ofcourse you dont want that. Clients are famous for breaking everything where they put their hands on, so we need to create permissions! Now the way you make permissions is just genius and so easy, you just add this to your ___install method, $permission = $this->permissions->get(self::PERMISSION_NAME); if (!$permission->id) { $p = new Permission(); $p->name = self::PERMISSION_NAME; $p->title = $this->_('View Harmster Page statistics and synchronize pages with lists'); $p->save(); } And you create a permission constant just like PAGE_NAME like this const PERMISSION_NAME = 'hr-view'; And of course you can create more permissions, just genius! Now what our install method should look like is this: public function ___install() { $page = $this->pages->get('template=admin,name='.self::PAGE_NAME); if (!$page->id) { $page = new Page(); $page->template = $this->templates->get('admin'); $page->parent = $this->pages->get($this->config->adminRootPageID); $page->title = 'Harmster'; $page->name = self::PAGE_NAME; $page->process = $this; $page->save(); } $permission = $this->permissions->get(self::PERMISSION_NAME); if (!$permission->id) { $p = new Permission(); $p->name = self::PERMISSION_NAME; $p->title = $this->_('View Harmster Page statistics and synchronize pages with lists'); $p->save(); } } This will set a module page up for you And we create an uninstall method, this basicly reverts your installed permissions and pages. public function ___uninstall() { $permission = $this->permissions->get(self::PERMISSION_NAME); if ($permission->id) { $permission->delete(); } $page = $this->pages->get('template=admin, name='.self::PAGE_NAME); if ($page->id) { $page->delete(); } } Now you are might be wondering, how do i get to display content in my page :S Well, I kinda stole this from other modules and it does work, but I am open for suggestions. the method ___execute gets executed when you click on your page in the PWCMS. What i wrote in there is public function ___execute() { return $this->_renderInterface(); } and in renderInterface() i put the next code: private function _renderInterface() { $this->setFuel('processHeadline', 'MailChimp synchronize tool'); $form = $this->modules->get('InputfieldForm'); $form->attr('id','ga_form'); $wrapper_audience = new InputfieldWrapper(); $field = $this->modules->get("InputfieldMarkup"); $field->label = $this->_("Gebruikers"); $field->columnWidth = 100; $members = $this->list_members($this->get_apikey()); $html = "<table class='AdminDataTable AdminDataList AdminDataTableSortable'>"; foreach($members['data'] as $member) { $html .= "<tr><td>" . $member['email'] . "</td><td>" . $member['timestamp'] . "</td></tr>"; } $html .= "</table>"; $field->attr('value',$html); $wrapper_audience->append($field); $form->append($wrapper_audience); return $form->render(); } Bascily you create a form and you render the form and that displays it for you, just play around with it for a bit and you'll get into it, as i am still getting into it. I am lazy, here a copy, pastey (no emoticon because its not allowed) <?php class Harmster extends Process implements Module, ConfigurableModule { const PAGE_NAME = 'harmster-module'; const PERMISSION_NAME = 'hr-view'; public static function getModuleInfo() { return array( 'title' => 'Harmster', 'version' => 001, 'summary' => '', 'href' => '', 'singular' => true, 'autoload' => true, ); } public function init() { $this->fuel->set("harmster", $this); } static public function getModuleConfigInputfields(array $data) { } public function ___install() { $page = $this->pages->get('template=admin,name='.self::PAGE_NAME); if (!$page->id) { $page = new Page(); $page->template = $this->templates->get('admin'); $page->parent = $this->pages->get($this->config->adminRootPageID); $page->title = 'Harmster'; $page->name = self::PAGE_NAME; $page->process = $this; $page->save(); } $permission = $this->permissions->get(self::PERMISSION_NAME); if (!$permission->id) { $p = new Permission(); $p->name = self::PERMISSION_NAME; $p->title = $this->_('View Harmster Page statistics and synchronize pages with lists'); $p->save(); } } public function ___uninstall() { $permission = $this->permissions->get(self::PERMISSION_NAME); if ($permission->id) { $permission->delete(); } $page = $this->pages->get('template=admin, name='.self::PAGE_NAME); if ($page->id) { $page->delete(); } } public function ___execute() { return $this->_renderInterface(); } private function _renderInterface() { $this->setFuel('processHeadline', 'MailChimp synchronize tool'); $form = $this->modules->get('InputfieldForm'); $form->attr('id','ga_form'); $wrapper_audience = new InputfieldWrapper(); $field = $this->modules->get("InputfieldMarkup"); $field->label = $this->_("Gebruikers"); $field->columnWidth = 100; $members = $this->list_members($this->get_apikey()); $html = "<table class='AdminDataTable AdminDataList AdminDataTableSortable'>"; foreach($members['data'] as $member) { $html .= "<tr><td>" . $member['email'] . "</td><td>" . $member['timestamp'] . "</td></tr>"; } $html .= "</table>"; $field->attr('value',$html); $wrapper_audience->append($field); $form->append($wrapper_audience); return $form->render(); } } I'll update this tutorial in the near future as i am still working my way up (no emoticon because its not allowed) Aww, i get an error when i save it, thats not nice. Thanks for reading (no emoticon because its not allowed)EDIT Updating this tutorial very soon, its horrible and incorrect
  20. Quickly toggle your checkboxes with extra action buttons via AJAX. The module adds functionality to InputfieldCheckbox so you can toggle the checkbox fields in the extra action buttons intruduced in ProcessWire 2.6.5 via AJAX. Github Page Download Link Requirements This module works only for ProcessWire versions later than 2.6.5. How to Install 1. Copy the files to /site/modules/ProcessQuickToggle/ 2. In your admin, go to Modules > Refresh for new modules. 3. Click the "Install" button next to "Process Quick Toggle". Usage Go to any checkbox field you want to enable quick toggle feature for. Setup > Fields > my_checkbox_field. There in the Input tab you should see an Enable Quick Toggle field. After you check it you will see some fields that you can fill based on your needs. Then save the field. Now there should be an extra button for every page that has this field in the Pages tree. Features Supports template contexts. Supports core FontAwesome icons. Any kind of feedback is appreciated.
  21. Is it possible to keep the modal open after saving? I regularly edit/test/change some content and it is kind of annoying to reopen the modal when i'm right into editing and just want to see, how it looks in the frontend. thanks!
  22. Babel is a module that provides functionality for managing section based multilanguage sites. It is inspired by Babel Plugin for MODX. There are cases where websites have 600 pages in english, 700 pages in russian and only 300 pages in english and russian. In this case it is much better to keep the content separate, each under one section and have their translations linked. This module helps you to manage those links. Github Page Download Link How to Install Warning Backup your database before installing this module. Requirements Babel works on top of core LanguageSupport module. You will have to install it first and create languages for your site. Then: 1. Copy all the module files to /site/modules/Babel/ 2. In your admin, go to Modules > Refresh for new modules. 3. Click the "Install" button next to Babel. Settings First of all you should set the root page for each language. Usually section based multilingual sites will have a structure like... Root |__Home (English) |__About |__News |__ News Article 1 |__ News Article 2 |__ News Article 3 |__ News Article 4 |__Contact ... |__Главная (Russian) |__О нас |__Новости |__ Новостная статья 1 |__ Новостная статья 2 |__ Новостная статья 3 |__ Новостная статья 4 |__Связаться ... |__Baş Sahypa (Turkmen) |__Barada |__Habarlar |__ Habar Makalasy 1 |__ Habar Makalasy 2 |__ Habar Makalasy 3 |__ Habar Makalasy 4 |__Aragatnaşyk ... You just need to select the languages that you want Babel to manage and select the root pages for each of them. API Babel creates couple useful methods and a properties for you. language (Page property) Every page that is handled by Babel (those who are descendants of root pages that you choose on Babel module's settings page) will have a language property that returns a Language object that they are assigned to. It is determined based on under which rootParent the $page lives; Syntax $page->language; Return Language object. translation (Page method) This method returns the page that was assigned as a translation for the given $language. Syntax $page->translation($language); Arguments The $language argument could be either a string (the name of the language), an integer (the id of the language) or a Language object itself. Throws WireException if the language is not found or isn't handled by Babel. Return The method returns a Page object or NullPage if the translation is not available. translations (Page method) This method will return the pages that were assigned as a translation for all $languages that are available for that page. Or an empty PageArray if no translations are available. Syntax $page->translations(); Return Returns PageArray. addTranslation (Page method) This method will create a translation link from $page to $otherPage. Syntax $page->addTranslation($otherPage[, $overwrite]); Arguments The $otherPage argument should be a Page object. The language of the page will be determined by Babel itself based on under which language section the page is located. The $overwrite argument is optional and has three case scenarios: If omitted the reverse link of the translation will be created only if the $otherPage does not have a translation link for the $page->language. If set to true the reverse link will be overwritten even if $otherPage does have a translation link for the $page->language. If set to false the reverse translation link will not be created even if the $otherPage does not have any translation links. Return boolean if the translation link/s is/are created successfully or not. removeTranslation (Page method) The method removes a translation link between $page and $otherPage. Syntax $page->removeTranslation($language[, $remove]); Arguments $language (string|integer|Language) The language link you wish to remove. $remove (boolean) If there is a reverse link that points back from the translation to this page, should Babel remove it too. Default is false. Throws Throws WireException if the language couldn't be found or is not handled by Babel. Return boolean If the removal of the translation link/s is/are successful. closestParentTranslation (Page method) Returns the translation of the closest translated parent of the page. Syntax $page->closestParentTranslation($language); Arguments $language (string|integer|Language) The language for which you want a translation for. Throws Throws WireException if the language couldn't be found or is not handled by Babel. Return Page object. getRoot (Babel method) Returns the rootPage of the language. The one you have assigned in the module settings page. Syntax $modules->get('Babel')->getRoot($language); Arguments $language (string|integer|Language) Throws Throws WireException if the language couldn't be found or is not handled by Babel. Return Page object. translatable (Babel method) Tells if a page is translatable via Babel or not. Syntax $modules->get('Babel')->translatable($page); Arguments $page is a Page object. The page you want to check on. Return boolean If the page is translatable or not. getTranslated (Babel method) Returns a PageArray of translated pages. Syntax $modules->get('Babel')->getTranslated($fromLanguage, $toLanguage[, $limit[, $pageNum]]); Arguments $fromLanguage (string|integer|Language) The language from which the translation is. If omitted (or null given) then all the translation from all languages will be considered. $toLanguage (string|integer|Language) The language to which the translation is. If omitted (or null given) then translation to all languages will be considered. $limit is the number of pages you want to receive. Default is 50. $pageNum is the page number. Use for pagination of the returned PageArray. Default is 1. Throws Throws WireException if the language couldn't be found or is not handled by Babel. Return PageArray. getUntranslated (Babel method) Returns a PageArray of pages that are not translated to one or the other language. Syntax $modules->get('Babel')->getUntranslated($fromLanguage, $toLanguage[, $limit[, $pageNum]]); Arguments $fromLanguage (string|integer|Language) The language from which there is no translation. If omitted (or null given) then all the untranslated pages from any language will be considered. $toLanguage (string|integer|Language) The language to which there is no translation. If omitted (or null given) then untranslated pages to any language will be considered. $limit is the number of pages you want to receive. Default is 50. $pageNum is the page number. Use for pagination of the returned PageArray. Default is 1. Throws Throws WireException if the language couldn't be found or is not handled by Babel. Return PageArray. babelHomePage ($config property) Reference to the home page. This is usually one of the pages that you chose in the module settings. Syntax $config->babelHomePage; The babelHomePage is determined based on: the path that user has entered... if not available then the session is checked... if not available then it defaults to the core LanguageSupport module's default language; Usage Tips If your site structure is the way it looks like it is shown above. Your root page usually won't ever render. Whenever a user enters your site at the `/` path you will redirect him to one of language root pages. Here is how I suggest you to do that in your root.php template file. $session->redirect($config->babelHomePage->url, false); that's pretty much everything you need to have in your root.php file. To display links for each language homepage... $home = $config->babelHomePage; $homePages = $home->translations()->and($home); echo "<ul>"; foreach ($homePages as $p) { $title = $p->language->title; echo "<li><a href='$p->url'>$title</a></li>"; } echo "</ul>"; To display links for each translation of the current page... echo "<ul>"; foreach ($page->translations() as $p) { $title = $p->language->title; echo "<li><a href='$p->url'>$title</a></li>"; } echo "</ul>"; ProcessBabelTranslate Babel comes with very useful admin helper. You can link pages as a translation for each other. You can create translation page if there isn't one yet. There is small indicators on page tree that shows which pages are translated to what languages. And you get a Babel Tanslate page where you can quickly find all the translated and untranslated pages accross your site. See the screenshots below... Settings page Translation indicators Quick action button Quick modal translate form Tab translate form ProcessBabelTranslate page Go ahead and try it out. This is my first module to publish. Please tell me if something need to be added, changed, removed...
  23. Now it is possible to uninstall the PageLinkAbstractor" (if using PW 2.6 and newer, this is a good idea) without ending with broken internal links. Please follow those hints on GitHub - there is a useful code snippet by Ryan Cramer: https://github.com/ryancramerdesign/ProcessWire/issues/1283 In my cases the provided script did not catch every single link, but most of them - the few remaining could be searched for with a 404 Link Checker Tool and then repaired manually.
  24. Hi @all, I started to manipulate (or extend) the Module ProcessPageEditLink with several new options. The reason is, in my needs it is necessary to add more than a title or an extra class to links in WYSYWYG-Editors. I discovered the Module and decided it would be nice to extend the existing code for options like the HTML5-"download"-Attribute or a specific value given to the link in a "data-value"-field. I tried to use existing code like the function to define a "title"-Attribute. In the dialog it is pretty working in the preview section, means adding and getting this information to a link works for this dialog. But I got problems to save my results in the textarea. I searched for a restriction that makes me not able to get more than the standard-attributes into, but I cant find anyone. So maybe I have to look for another hookup on saving to textfield maybe. unfortunately I am very unexperienced in developing modules on PW. But after I got some nice results I wish to finish this task as well. Has anybody an idea whats going wrong? Maybe there is somebody else interested in this functions. Thanks for help
  25. So here i'm starting. This is more a little snippet than a whole module. On frontend before the </body> tag the script from http://browser-update.org/ is working - nothing fancy here. Download Github: https://github.com/mr-fan/MarkupBrowserUpdate my todo for this is: make it a clean module make use of the settings from browser-update.org so you could define these in PW backend get the backling for PW best regards mr-fan
×
×
  • Create New...