kongondo

Module: Matrix Fieldtype & Inputfield

Recommended Posts

FieldtypeMatrix and InputfieldMatrix

Modules Directory: http://modules.processwire.com/modules/fieldtype-matrix/

GitHub: https://github.com/kongondo/FieldtypeMatrix 

The module Matrix enables you to save data from a 2D-Matrix table. The rows and columns of the matrix table are made up of pages retrieved via a ProcessWire selector or via a page field selection of parent pages. The matrix values are made up of the data input in the matrix cells, i.e. the 'intersection of rows and columns'.
 
Example Usage
You have Products whose prices vary depending on colour, size, material, etc. Using the Fieldtype, you can create a table with rows made up of colours and columns made up of sizes the combination of each making up their respective values (in this case price). So rather than creating multiple text fields to do the following:

Colour		Size		Price
Red		Small		£10
Red		Medium		£20
Red		Large		£30
Red		X-large		£35
Green		Small		£9
Green		Medium		£15
Etc...

You can instead have the following in one field:

		Small		Medium		Large 		X-Large
Red		£10		£20		£30		£35
Green		£9		£15
Blue		Etc...
Yellow
Purple

If you set a selector in the Field's settings, to retrieve pages to build your matrix's rows and columns, it follows that all pages using the template the Fieldtype is attached to will have identical rows and columns. In some cases, this could be the intention. For instance, you might have 'Car' pages, e.g. Audi, Volvo, Ford, Citroen, Mazda, BWM, etc., each of which uses a 'Cars' template that has a single FiedltypeMatrix called 'car_attributes'. If you set a selector to build the Fieldtype's rows and columns, your users can easily compare the cars based on a combination of different values. The following matrix table best illustrates this:

        Type            Engine Size Fuel Efficiency Carbon Emissions  Warranty  Road Tax  Price
1994   Audi brand 1    values, etc.            
2000   Audi brand 2             
2006   Audi brand 3              
2012   Audi brand 4            
             

Each of your car pages would have similar matrices. 

This allows you to make easy but powerful queries. Such a setup allows you to compare within and across car brands. Say you wanted to find out which car(s) offered the best value for money given certain parameters such as warranty, emissions etc. You can easily make such comparisons (see code below). You can also compare within one car type, e.g. which brand of BMWs does best in what area...The possibilities are endless.

In the database, Rows and column pages data are stored as their respective page->id. Matrix-values store any data (varchar(255)).

 
If instead you wanted a template's pages to each have a matrix built of different rows and columns, you would have to name a Multiple Page Field (attached to the same template as the as your matrix field) in the matrix field's settings. When editing those pages, your matrix table's rows and columns will be built using the published children pages of the 2 pages you select in the Multiple page field..
 
The module allows the creation of matrix tables of any sizes (rows x columns). The rows and columns dynamically grow/shrink depending on the addition of row/column pages that match what you set in the matrix field's settings (see its 'Details Tab'). Please note that, if such pages are deleted/trashed/hidden/unpublished, their data (and presence) in the matrix are also deleted.

Entering values in the matrix

You have three choices:

  • Manually entry
  • Uploading a comma delimited (CSV) file. This can be delimited by other characters (tab, pipe, etc); not just commas
  • Copy-pasting CSV values. (Tip: you can copy paste directly from an Excel spreadsheet. Such values will be 'tab-delimited').

In addition, if your server supports it, in the field's settings, you can enable the use of MySQL's fast LOAD DATA INFILE to read and save your submitted CSV values.

Note that for large tables, you may have to increase your PHP's max_input_vars from the default 1000 otherwise PHP will timeout/return an error and your values will not be saved. I have successfully tested the module with up to ~3000+ values (10x350 table), the Fieldtype is not really optimised (nor was it intended) to handle mega large matrix tables. For such, you might want to consider other strategies. 

 
Install
Install as any other module.
 
API + Output
A typical output case for this module would work like this:
 
The matrix's rows, columns and values are subfields of your matrix's field. So, if you created a field called 'products' of the type FieldtypeMatrix, you can access as:

product.row, product.column and product.value respectively

 

foreach($page->matrix as $m) {
  echo "
    <p>
    Colour: $m->row<br />
    Size: $m->column<br />
    Price: $m->value
    </p>
    ";
}

Of if you want to output a matrix table in the frontend: 
 

//create array to build matrix
$products = array();

foreach($page->matrix as $m) $products[$m->row][$m->column] = $m->value;

$tbody ='';//matrix rows
$thcols = '';//matrix table column headers

$i = 0;//set counter not to output extraneous column label headers
$c = true;//set odd/even rows class
foreach ($products as $row => $cols) {

          //matrix table row headers (first column)
          $rowHeader = $pages->get($row)->title;

          $tbody .= "<tr" . (($c = !$c) ? " class='even' " : '') . "><td class='MatrixRowHeader'>" . $rowHeader . "</td>";

          $count = count($cols);//help to stop output of extra/duplicate column headers

          foreach ($cols as $col => $value) {

                    //matrix table column headers
                    $columnHeader = $pages->get($col)->title;

                    //avoid outputting extra duplicate columns
                    if ($i < $count) $thcols .= "<th class='MatrixColumnHeader'>" . $columnHeader . "</th>";

                    //output matrix values
                    $currency = $value > 0 ? '£' : '';
                    $tbody .= "<td>" . $currency . $value . "</td>";

                    $i++;

          }

          $tbody .= "</tr>";

}

//final matrix table for output
 $tableOut =   "<table class='Matrix'>
                <thead>
                  <tr class=''>
                    <th></th>
                    $thcols
                   </tr>
                </thead>
                <tbody>
                  $tbody
                </tbody>
            </table>";

echo $tableOut;

The module provides a default rendering capability as well, so that you can also do this (below) and get a similar result as the first example above (without the captions). 

echo $page->matrix;

Or this

foreach($page->matrix as $m) {
         echo $m; 
}

Finding matrix items
The fieldtype includes indexed row, column and value fields. This enables you to find matrix items by either row types (e.g. colours) or columns (e.g. sizes) or their values (e.g. price) or a combination of some/all of these. For instance:

//find all pages that have a matrix value of less than 1000
$results = $pages->find("products.value<1000"); 
//find some results in the matrix (called products) of this page
$results = $page->products->find("column=$country, value=Singapore");//or
$page->products->find("column=$age, value>=25");
//$country and $age would be IDs of two of your column pages

Other more complex queries are possible, e.g. find all products that are either red or purple in colour, come in x-large size and are priced less than $50.

Credits
@Ryan on whose Fieldtype/InptufieldEvents this is largely based
@charger and @sakkoulas for their matrix ideas
 
Screens
 
Field Details Tab
matrix-fieldtype-selector.png
 
Inputfield
matrix-inputfield.png

Larger matrix table

matrix-csv-100x10-values.png
 
Example output
matrix-table-output.png

  • Like 28

Share this post


Link to post
Share on other sites

Some follow up questions here about select row/column pages per page vs per field:

Coming soon...pls wait...

Resolved this (answered my own questions :-)) see below update..

Edited by kongondo

Share this post


Link to post
Share on other sites

Great stuff!! Thanks a lot! I did some testing, and everything seems to work.

I have one feature that I'm missing. I'm aware this is not the core idea of this module, but I wanted to mention it anyway. Ok, so here it is:

If I have a selector for columns/rows that goes like parent=1283|1284, it works as expected by listing the children of both parents. The output could be like this:

S
M
L
Cotton
Nylon

However, it would be cool to have an option (checkbox) that creates all possible combinations of the selected children, like this:

S Cotton
M Cotton
L Cotton
S Nylon
M Nylon
L Nylon

In my case, I need this because I have multiple currencies for the rows.

As mentioned, I don't know if this too much out of scope and maybe needs an additional module.

  • Like 1

Share this post


Link to post
Share on other sites

@Charger,

I see no easy way of doing that (3-way relationship) using this particular module. I'll see if I can do a bespoke one for your needs.

Share this post


Link to post
Share on other sites

Update: version 0.0.2

Added ability to reuse a single matrix field across pages/templates to build unique matrix tables on a page by page basis. This is achieved by specifying the name of a Multiplepages select field in the Fieldtype settings (Details Tab). It allows you to select row and column parent pages from within the page containing the matrix itself. The child pages of these parents are used to build the matrix. This setting overrides the Row and Column selector settings of the fieldtype.

Example usage:

  1. Create a Multiplepages field and call it, for example, 'product_select'. Set it up as you wish (e.g. custom PHP, selectors, etc for selectable pages). You may wish to use ASM select to make things prettier/easier below.
  2. Add it to the same template(s) where you will be using a matrix field.
  3. In your matrix field's Details Tab, specify the name of the page field (i.e. 'product_select') under the 'Matrix Row and Column Parent Pages' setting.
  4. Edit the page where you will be building a matrix table.
  5. Select 2 pages in your 'product_select' whose child pages will be used to create your matrix rows and columns. The order is important! The first selected page will be assumed to be the row pages parent and the second one the column pages parent. Any additional pages here will be ignored.
  6. Save your page and your matrix table will be built using the children of the selected parent pages.
  7. Note: The usual error checking will be done and 'thrown' (e.g. if parent pages do not have children, if your specified page field is not a page field/does not return a PageArray, etc.
  8. Note 2: You can swap/change the row/column pages in your page field (product_select) HOWEVER, all previously saved values will be deleted(!) on save and your matrix table rebuilt to reflect the new specified row/column structure.

Todo/think about

  • Copy values from Excel and directly paste this in a similarly structured matrix table
  • Export matrix table?
  • 1-click clear all values entered in a matrix table
  • Etc?

Download:

https://github.com/kongondo/FieldtypeMatrix

Screens

Named Page Field to select rows and columns parent pages

post-894-0-51198400-1418959469_thumb.png

Row and Column parent pages selection in a specified Page Field

post-894-0-04615700-1418985321_thumb.png

Reusing a single matrix field on a different page(s)

post-894-0-38870300-1418985322_thumb.png

  • Like 5

Share this post


Link to post
Share on other sites

Great stuff!! Thanks a lot! I did some testing, and everything seems to work.

I have one feature that I'm missing. I'm aware this is not the core idea of this module, but I wanted to mention it anyway. Ok, so here it is:

If I have a selector for columns/rows that goes like parent=1283|1284, it works as expected by listing the children of both parents. The output could be like this:

S
M
L
Cotton
Nylon

However, it would be cool to have an option (checkbox) that creates all possible combinations of the selected children, like this:

S Cotton
M Cotton
L Cotton
S Nylon
M Nylon
L Nylon

In my case, I need this because I have multiple currencies for the rows.

As mentioned, I don't know if this too much out of scope and maybe needs an additional module.

@Charger,

I see no easy way of doing that (3-way relationship) using this particular module. I'll see if I can do a bespoke one for your needs.

Hmm, or maybe I should include this in the present module but with a max 3-way relationship? Otherwise it get messy if more. The 3rd relationship (materials in your case) would only kick in if user configures it in the Fieldtype settings as you suggested. What do you guys think?

  • Like 1

Share this post


Link to post
Share on other sites

Looks great kongondo!! Very impressed.

How are the intersection values being stored? (Sorry, I've not dug around in the code.)

  • Like 1

Share this post


Link to post
Share on other sites

...How are the intersection values being stored? (Sorry, I've not dug around in the code.)

That turned out (later) to be the easy bit :-). They are stored similar to Page Fields...(see second screenshot below)

Matrix array (see post below - we use this only for grabbing db values to later manipulate to build matrix cells/intersections. We use a different array for saving)

post-894-0-11754400-1418998901_thumb.png

Matrix db table (see update below [version 0.0.3] about avoiding saving records with empty values)

post-894-0-11824800-1418998904_thumb.png

Edited by kongondo
  • Like 6

Share this post


Link to post
Share on other sites

@kongondo, is there any need to store the empty results?

Just wondered as once you get into the world of combinatorials things quickly get memory hungry big; and PHP associative arrays aren't exactly the world's most efficient storage format. Any idea how this fieldtype works out memory wise? 

  • Like 3

Share this post


Link to post
Share on other sites

@Steve,

Good catch about empty values! Don't know how I mised that! I have corrected it in Version 0.0.3 (post here soon), thanks!

Memory issue: That was my next question. I would like to do/see some real world tests....+ there's also PHP post limits...Would appreciate if anybody could help test :-), thanks.

  • Like 3

Share this post


Link to post
Share on other sites

i do tests with matrixField and seems to be working fine, (i have edit a little the inputfieldMatrix.module to retrieve matrix_columns and matrix_rows from a pagefield inside the same page) i'm still testing it, for any issues i will post here...

Thaaaaaaanks kongondo :)

  • Like 1

Share this post


Link to post
Share on other sites

Update: version 0.0.3
 
Small but important update to correct oversight whereby records with empty values were being saved to the database, thx @netcarver.

  • Like 2

Share this post


Link to post
Share on other sites

i do tests with matrixField and seems to be [/size]working fine, (i have edit a little the inputfieldMatrix.module to retrieve matrix_columns and matrix_rows from a pagefield inside the same page) i'm still testing it, for any issues i will post here...

How is that different from version 0.0.2 I posted earlier? :-)

Share this post


Link to post
Share on other sites

hmm is it possible in settings to search for matrix_row or matrix_column  where $field = $page->field;

  

Share this post


Link to post
Share on other sites

Partial reply...

Looking at this some more I don't think this will be a major concern for most small combinations that people were suggesting (like {S, M, L, XL} crossed with {Red, Green, Blue}) but I am interested in how this might scale if people start specifying a set of pages for the x-axis with a larger number of members - say 30 options and a set of pages for the y-axis with another 20 options. Or perhaps if a user mistypes a selector and end up with 1000s of pages in one of the axis - would there be issues? (I'm kinda asking as I'm hitting an issue with a module of my own that needs a safe fallback position if something goes wrong.)

When I've looked at memory usage in the past, I've tended to use the memory_get_usage() function to track this kind of thing.

  • Like 1

Share this post


Link to post
Share on other sites

hmm is it possible in settings to search for matrix_row or matrix_column  where $field = $page->field;  

Yes. They are subfields of whatever your field is. The subfields are the names of the columns in the Fieldtype's db table, i.e. matrix_row, matrix_column and matrix_value.

The selector format would be: field.subfield=value

E.g., if your your matrix field was called 'product', you would search for: . product.matrix_row, product.matrix_column and product.matrix_value.

I'm in a hurry atm, see examples here:

http://processwire.com/api/selectors/#subfield

https://processwire.com/talk/topic/5040-events-fieldtype-inputfield-how-to-make-a-table-fieldtypeinputfield/

https://processwire.com/talk/topic/5040-events-fieldtype-inputfield-how-to-make-a-table-fieldtypeinputfield/

  • Like 1

Share this post


Link to post
Share on other sites

@kongondo, this looks great, thanks for making it available!

Will take a closer look soon, but just a (very) minor note at this point: I can't help wondering why the subfields are prefixed with matrix_ -- doesn't honestly matter that much, but I fail to see much value in that either, just slight increase in verbosity compared to non-prefixed alternatives  :)

  • Like 1

Share this post


Link to post
Share on other sites
kongondo, about the way that pagefield shows columns and rows,   i have changed inputfield Matrix.module selector and i have two pagefields one for columns and one for rows, so every time i add a page to pagefield the matrixfield shows the specific page.title. 

the problem is that if matrix_value has a value and delete the pageField with the specific matrix column the cell is not deleted until i clear the value from the specific cell and save the page. 

matrixField.jpg

Share this post


Link to post
Share on other sites

....Will take a closer look soon, but just a (very) minor note at this point: I can't help wondering why the subfields are prefixed with matrix_ -- doesn't honestly matter that much, but I fail to see much value in that either, just slight increase in verbosity compared to non-prefixed alternatives  :)

Thanks @teppo. Yeah, I battled with this one; I am not a fan of such prefixes myself :-). I was trying to avoid collision with MySQL reserved words - row(?), value and column. Funny though that in my tests selectors still work when I drop the 'matrix' prefix...hmm. 

Guys..suggestions for naming the row/column/value  COLUMNS? Maybe:

mrow - mcolumn (or mcol)  - mvalue

OR maybe...

use the PW data COLUMN for 'values' (i.e. intersection/combination cell/value of row vs column), i.e.

$page->product.mrow//rows
$page->products.mcol//columns
$page->products.data//their data/values

Any thoughts? Thanks.

Share this post


Link to post
Share on other sites

@kongondo: had to check, and apparently column is a reserved word, row and value should be fine. Either way, prefixed values make sense after all, no point in having only one prefixed. Also, I kind of prefer matrix_* over m*, and matrix_value over data, so wouldn't chance anything to be honest :)

  • Like 1

Share this post


Link to post
Share on other sites

kongondo, about the way that pagefield shows columns and rows,   i have changed inputfield Matrix.module selector and i have two pagefields one for columns and one for rows, so every time i add a page to pagefield the matrixfield shows the specific page.title. 

the problem is that if matrix_value has a value and delete the pageField with the specific matrix column the cell is not deleted until i clear the value from the specific cell and save the page. 

@sakkoulas,

Does this mean that all the rows and columns that make up your matrix table will have have their corresponding pages displayed in your page fields? It's an interesting idea but would probably not work well (visually) if you have a large table? The list of pages in your page fields could get very long :-)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By daniels
      This is a lightweight alternative to other newsletter & newsletter-subscription modules.
      You can find the Module in the Modules directory and on Github
      It can subscribe, update, unsubscribe & delete a user in a list in Mailchimp with MailChimp API 3.0. It does not provide any forms or validation, so you can feel free to use your own. To protect your users, it does not save any user data in logs or sends them to an admin.
      This module fits your needs if you...
      ...use Mailchimp as your newsletter / email-automation tool ...want to let users subscribe to your newsletter on your website ...want to use your own form, validation and messages (with or without the wire forms) ...don't want any personal user data saved in any way in your ProcessWire environment (cf. EU data regulation terms) ...like to subscribe, update, unsubscribe or delete users to/from different lists ...like the Mailchimp UI for creating / sending / reviewing email campaigns *I have only tested it with PHP 7.x so far, so use on owners risk
      EDIT:
      I've updated the module to 0.0.3. I removed the instructions from this forum, so I don't have to maintain it on multiple places. Just checkout the readme on github 🙂
      If you have questions or like to contribute, just post a reply or create an issue or pr on github. 
    • By blynx
      Hej,
      A module which helps including Photoswipe and brings some modules for rendering gallery markup. Feedback highly appreciated
      (Also pull requests are appreciated 😉 - have a new Job now and don't work a lot with ProcessWire anymore, yet, feel free to contact me here or on GitHub, Im'm still "online"!)

      Modules directory: http://modules.processwire.com/modules/markup-processwire-photoswipe
      .zip download: https://github.com/blynx/MarkupProcesswirePhotoswipe/archive/master.zip
      You can add a photoswipe enabled thumbnail gallery / lightbox to your site like this. Just pass an image field to the renderGallery method:
      <?php $pwpswp = $modules->get('Pwpswp'); echo $pwpswp->renderGallery($page->nicePictures); Options are provided like so:
      <?php $galleryOptions = [ 'imageResizerOptions' => [ 'size' => '500x500' 'quality' => 70, 'upscaling' => false, 'cropping' => false ], 'loresResizerOptions' => [ 'size' => '500x500' 'quality' => 20, 'upscaling' => false, 'cropping' => false ], 'pswpOptions' => (object) [ 'shareEl' => false, 'indexIndicatorSep' => ' von ', 'closeOnScroll' => false ] ]; echo $pswp->renderGallery($page->images, $galleryOptions); More info about all that is in the readme: https://github.com/blynx/MarkupProcesswirePhotoswipe
      What do you think? Any ideas, bugs, critique, requests?
      cheers
      Steffen
    • By bernhard
      WHY?
      This module was built to fill the gap between simple $pages->find() operations and complex SQL queries.
      The problem with $pages->find() is that it loads all pages into memory and that can be a problem when querying multiple thousands of pages. Even $pages->findMany() loads all pages into memory and therefore is a lot slower than regular SQL.
      The problem with SQL on the other hand is, that the queries are quite complex to build. All fields are separate tables, some repeatable fields use multiple rows for their content that belong to only one single page, you always need to check for the page status (which is not necessary on regular find() operations and therefore nobody is used to that).
      In short: It is far too much work to efficiently and easily get an array of data based on PW pages and fields and I need that a lot for my RockGrid module to build all kinds of tabular data.

      Basic Usage

       
      Docs & Download
      https://gitlab.com/baumrock/RockFinder/tree/master
       
      Changelog
      180516 change sql query method, bump version to 1.0.0 180515 multilang bugfix 180513 beta release <180513 preview/discussion took place here: https://processwire.com/talk/topic/18983-rocksqlfinder-highly-efficient-and-flexible-sql-finder-module/
    • By flydev
      OAuth2Login for ProcessWire
      A Module which give you ability to login an existing user using your favorite thrid-party OAuth2 provider (i.e. Facebook, GitHub, Google, LinkedIn, etc.)..
      You can login from the backend to the backend directly or render a form on the frontend and redirect the user to a choosen page.
      Built on top of ThePhpLeague OAuth2-Client lib.
      Registration is not handled by this module but planned.
       
      Howto Install
      Install the module following this procedure:
       - http://modules.processwire.com/modules/oauth2-login/
       - https://github.com/flydev-fr/OAuth2Login
      Next step, in order to use a provider, you need to use Composer to install each provider
      ie: to install Google, open a terminal, go to your root directory of pw and type the following command-line: composer require league/oauth2-google
      Tested providers/packages :
          Google :  league/oauth2-google     Facebook: league/oauth2-facebook     Github: league/oauth2-github     LinkedIn: league/oauth2-linkedin
      More third-party providers are available there. You should be able to add a provider by simply adding it to the JSON config file.

      Howto Use It
      First (and for testing purpose), you should create a new user in ProcessWire that reflect your real OAuth2 account information. The important informations are, Last Name, First Name and Email. The module will compare existing users by firstname, lastname and email; If the user match the informations, then he is logged in.
      ie, if my Google fullname is John Wick, then in ProcessWire, I create a new user  Wick-John  with email  johnwick@mydomain.com
      Next step, go to your favorite provider and create an app in order to get the ClientId and ClientSecret keys. Ask on the forum if you have difficulties getting there.
      Once you got the keys for a provider, just paste it into the module settings and save it. One or more button should appear bellow the standard login form.
      The final step is to make your JSON configuration file.
      In this sample, the JSON config include all tested providers, you can of course edit it to suit your needs :
      { "providers": { "google": { "className": "Google", "packageName": "league/oauth2-google", "helpUrl": "https://console.developers.google.com/apis/credentials" }, "facebook": { "className": "Facebook", "packageName": "league/oauth2-facebook", "helpUrl": "https://developers.facebook.com/apps/", "options": { "graphApiVersion": "v2.10", "scope": "email" } }, "github": { "className": "Github", "packageName": "league/oauth2-github", "helpUrl": "https://github.com/settings/developers", "options": { "scope": "user:email" } }, "linkedin": { "className": "LinkedIn", "packageName": "league/oauth2-linkedin", "helpUrl": "https://www.linkedin.com/secure/developer" } } }  
      Backend Usage
      In ready.php, call the module :
      if($page->template == 'admin') { $oauth2mod = $modules->get('Oauth2Login'); if($oauth2mod) $oauth2mod->hookBackend(); }  
      Frontend Usage
      Small note: At this moment the render method is pretty simple. It output a InputfieldForm with InputfieldSubmit(s) into wrapped in a ul:li tag. Feedbacks and ideas welcome!
      For the following example, I created a page login and a template login which contain the following code :
      <?php namespace ProcessWire; if(!$user->isLoggedin()) { $options = array( 'buttonClass' => 'my_button_class', 'buttonValue' => 'Login with {provider}', // {{provider}} keyword 'prependMarkup' => '<div class="wrapper">', 'appendMarkup' => '</div>' ); $redirectUri = str_lreplace('//', '/', $config->urls->httpRoot . $page->url); $content = $modules->get('Oauth2Login')->config( array( 'redirect_uri' => $redirectUri, 'success_uri' => $page->url ) )->render($options); }
      The custom function lstr_replace() :
      /* * replace the last occurence of $search by $replace in $subject */ function str_lreplace($search, $replace, $subject) { return preg_replace('~(.*)' . preg_quote($search, '~') . '~', '$1' . $replace, $subject, 1); }  
      Screenshot
       



    • By gRegor
      Updated 2018-05-06:
      Version 2.0.0 released
      Updated 2017-03-27:
      Version 1.1.3 released
      Updated 2016-04-11:
      Version 1.1.2 released

      Updated 2016-02-26:
      Officially in the module directory! http://modules.processwire.com/modules/webmention/

      Updated 2016-02-25:
      Version 1.1.0 is now released. It's been submitted to the module directory so should appear there soon. In the meantime, it's available on GitHub: https://github.com/gRegorLove/ProcessWire-Webmention. Please refer to the updated README there and let me know if you have any questions!
      ------------
      Original post:
       
      This is now out of date. I recommend reading the official README.
       
      I've been working on this one for a while. It's not 100%, but it is to the point I'm using it on my own site, so it's time for me to release it in beta. Once I finish up some of the features described below, I will submit it to the modules directory as a stable plugin.
      For now, you can install from Github. It works on PW2.5. I haven't tested on PW2.6, but it should work there.
      Feedback and questions are welcome. I'm in the IRC channel #processwire as well as #indiewebcamp if you have any questions about this module, webmention, or microformats.
      Thanks to Ryan for the Comments Fieldtype which helped me a lot in the handling of webmentions in the admin area.
      ProcessWire Webmention Module
      Webmention is a simple way to automatically notify any URL when you link to it on your site. From the receiver's perspective, it is a way to request notification when other sites link to it.
      Version 1.0.0 is a stable beta that covers webmention sending, receiving, parsing, and display. An easy admin interface for received webmentions is under development, as well as support for the Webmention Vouch extension.
      Features
      * Webmention endpoint discovery
      * Automatically send webmentions asynchronously * Automatically receive webmentions * Process webmentions to extract microformats   Requirements * php-mf2 and php-mf2-cleaner libraries; bundled with this package and may optionally be updated using Composer. * This module hooks into the LazyCron module.   Installation Github: https://github.com/gRegorLove/ProcessWire-Webmention

      Installing the core module named "Webmention" will automatically install the Fieldtype and Inputfield modules included in this package.   This module will attempt to add a template and page named "Webmention Endpoint" if the template does not exist already. The default location of this endpoint is http://example.com/webmention-endpoint   After installing the module, create a new field of type "Webmentions" and add it to the template(s) you want to be able to support webmentions. Sending Webmentions
      When creating or editing a page that has the Webmentions field, a checkbox "Send Webmentions" will appear at the bottom. Check this box and any URLs linked in the page body will be queued up for sending webmentions. Note: you should only check the "Send Webmentions" box if the page status is "published."   Receiving Webmentions This module enables receiving webmentions on any pages that have have "Webmentions" field, by adding the webmention endpoint as an HTTP Link header. If you would like to specify a custom webmention endpoint URL, you can do so in the admin area, Modules > Webmention.   Processing Webmentions (beta) Currently no webmentions are automatically processed. You will need to browse to the page in the backend, click "Edit," and scroll to the Webmentions field. There is a dropdown for "Visibility" and "Action" beside each webmention. Select "Process" to parse the webmention for microformats.   A better interface for viewing/processing all received webmentions in one place is under development.   Displaying Webmentions (beta) Within your template file, you can use `$page->Webmentions->render()` [where "Webmentions" is the name you used creating the field] to display a list of approved webmentions. As with the Comments Fieldtype, you can also generate your own output.   The display functionality is also under development.   Logs This module writes two logs: webmentions-sent and webmentions-received.   Vouch The Vouch anti-spam extension is still under development.   IndieWeb The IndieWeb movement is about owning your data. It encourages you to create and publish on your own site and optionally syndicate to third-party sites. Webmention is one of the core building blocks of this movement.   Learn more and get involved by visiting http://indiewebcamp.com.   Further Reading * http://indiewebcamp.com/webmention * http://indiewebcamp.com/comments-presentation * http://indiewebcamp.com/reply