adrian

Module
Batch Child Editor

316 posts in this topic

This module facilitates quick batch creation (titles only or CSV import for other fields), editing, sorting, deletion, and CSV export of all children under a given page. You can even provide an alternate parent page which allows for editing of an external page tree.
 
http://modules.processwire.com/modules/batch-child-editor/
https://github.com/adrianbj/BatchChildEditor
 
The interface can be added to the Children Tab, or in a new dedicated tab, or placed inline with other fields in the Content tab.
 
Various modes allow you to:

  • Lister - Embeds a customized Lister interface. Installation of ListerPro will allow inline ajax editing of displayed fields.
     
  • Edit - This allows you to rename existing child pages and add new child pages. It is non-destructive and so could be used on child pages that have their own children or other content fields (not just title). It includes the ability to quickly sort and delete pages and change page templates. Also allows full editing of each page via a modal dialog by clicking on the page name link.

    This is my preferred default setup - see how it replaces the default Children/Subpages with an easily addable/editable/sortable/renamable/deletable list. Note that the edit links open each child page in a modal for quick editing of all fields.

    post-985-0-98642800-1432782769_thumb.png
     
  • Add - adds newly entered page titles as child pages to the list of existing siblings. You could create a list of pages in Word or whatever and just paste them in here and viola!

    This screenshot shows the editor in its own tab (name is configurable) and shows some of the CSV creation options. Update and Replace modes look fairly similar but show existing page titles.

    post-985-0-16922200-1430761056_thumb.png
     
  • Update - Updates the titles (and any other fields if you enter CSV data) for the existing pages and adds any additionally entered pages.
     
  • Replace - Works similarly to Add, but replaces all the existing children. There are checks that prevent this method working if there are any child pages with their own children or other content fields that are not empty. This check can be disabled in the module config settings, but please be very careful with this.
     
  • Export to CSV - Generates a CSV file containing the fields for all child pages. Fields to be exported can to fixed or customizable by the user. Also includes an API export method.

    post-985-0-87901800-1432667874_thumb.png

Populating fields on new pages
 
In Add, Update, and Replace modes you can enter CSV formatted rows to populate all text/numeric fields, making for an extremely quick way of creating new pages and populating their content fields.
 
 
Predefined Field Pairings
 
Like the field connections setup from Ryan's CSV Importer, but defined ahead of time so the dev controls what columns from the CSV pair with which PW fields. This is especially powerful in Update mode giving editors the ability to periodically import a CSV file to update only certain fields on a entire set of child pages. These pairings also allow for importing fieldtypes with subfields - verified to work for Profields Textareas and MapMarker fields, but I think should work for most others as well - let me know if you find any that don't work.
 
 
Access permission
 
This module requires a new permission: "batch-child-editor". This permission is created automatically on install and is added to the superuser role, but it is up to the developer to add the permission to other roles as required.
 
Config Settings
 
This module is HIGHLY configurable down to setting up custom descriptions and notes for your editors. You define one config globally for the site and then optionally you can define completely custom configurations for each page tree parent on your site. There are too many settings to bother showing here - you really just need to look through all the options and play around with them!

19 people like this

Share this post


Link to post
Share on other sites
Just released an improved version. Two main changes:

  1. You can now limit which types of editing the users have access to. You might want to disable the Create/Overwrite mode in some cases. Note that superusers have both modes regardless of this setting.
  2. You can now add new pages using the edit mode.
Docs and images in the first post have been updated

3 people like this

Share this post


Link to post
Share on other sites

Life saver Adrian! I was just thinking that it would be nice to have feature two days ago for the project I am working on at the moment. I haven't tested it but from the looks of it very promising. Cheers

Share this post


Link to post
Share on other sites

Glad to hear it sounds useful - please let me know how it goes for you and if you have any suggestions for improvements. I haven't had much real world feedback yet, so I would appreciate hearing your experience.

Share this post


Link to post
Share on other sites

Adrian,

Thanks for this!

Just finished testing...two things:

Not sure if possible: Would it be possible, somehow to display names of child pages alongside their titles? This is helpful when 'overwrite names' is not checked; new pages are created with similar titles but different names. However, all the user sees are similar titles. Not a big issue since names are visible on hover of the titles of children pages above (i.e. the PW list of children/subpages).

I have been getting this error: You cannot bulk edit these child pages, because at least one page has a field which is not empty. Try the edit option, or delete existing child pages first.  in Create/Overwrite mode. Does this mean child pages fields have to be empty before they can be overwritten?

Thanks again for the module! Great to see that it respects the template family settings ^-^

Share this post


Link to post
Share on other sites

Hi kongondo,

Thanks for testing. I should be able to do something for you along the lines of displaying the page names - I'll take a look.

The error you are getting is an intentional protection when using the Create/Overwrite mode. Because this mode deletes all children and recreates them I check to make sure there are no other fields (other than title and name) that have content and also that there are no grandchildren that might be deleted. I guess I could add an additional config setting to allow this check to be turned off.

Alternatively, the Edit mode will work fine because it won't affect other fields or grandchildren.

I am thinking the config option would probably work well, but I am still worried that if this module is accidentally enabled on a template or page with lots of content fields, it could be very destructive without this check. Maybe it's just a case of the developer needing to be very aware of where they make it available.

Do you have any thoughts on the best approach here?

Share this post


Link to post
Share on other sites

Thanks for prompt response Adrian. Haven't thought much about best approach but for now I would err on the side of caution.

Alternative 1: Don't delete anything with other non-empty fields (other than name and title). However, the explanation you have on your post above should be included somewhere in the Warning. Maybe better....

Alternative 2: An extension of Alternative 1 (some Warning notice) + to skip only the problematic child pages, i.e. the operations should continue for child pages with empty fields but skipped over for those with content. Then, capture the titles of the problematic ones and display a separate single error message alongside the success message: "could not bulk/edit a, b, c, d, e, f, g, x, z, because...blah, blah" (up to a point, otherwise string can be very long!). This way, the user is not too disappointed. The current all or nothing can be frustrating if you've spent a while setting things up [but did not check for non-empty fields first]  :lol:. Unless I am missing something and Alternative 2 is the current behaviour?

Cheers

Edited by kongondo

Share this post


Link to post
Share on other sites

Cannot create child pages with cyrillic titles. Probably names are not generated through transliteration.

1 person likes this

Share this post


Link to post
Share on other sites

Ivan,

I am really not very experienced with non-latin characters, but I just changed page name sanitizer to include: "Sanitizer::translate" which I am hoping will do what you need. Otherwise I will need to revisit things and use the code from the core that dynamically generates the page names on the fly from the titles.

I have also added a few new features to this module:

  1. There is a new "Add" option so it is possible to bulk add new children regardless of the content and grandchildren of the other sibling pages.
  2. Also there is a new config setting for allowing you to override the content protection check when using the overwrite mode - obviously use with extreme caution.

Hope all those changes are useful.

First post updated with new options and screenshots.

Edited by adrian
2 people like this

Share this post


Link to post
Share on other sites

Nope. Still doesn't work. Latin titles are ok. Cyrillic titles don't work. Pages just do not get created at all. If i put a list with some latin and some cyrillic titles, only pages with latin titles get created.

And a little inconsistensy, as I think. If you do not choose any of the edit modes in module preferencies, you get the module output in page setup with a blank dropdown. Maybe get some defaults or turn off the output if nothing is selected in edit modes options. But that is for when it's time to polish.

Share this post


Link to post
Share on other sites

Ok, I just committed another update and I just tested myself with some cyrillic characters and I think everything should be working fine now.

I also fixed the blank dropdown issue. Now if there are no edit modes set in the config, the editor is not available at all from the Children tab.

Please let me know how it goes for you.

1 person likes this

Share this post


Link to post
Share on other sites

Finally got to test it. It seems to work fine. It even adds a number to the end of the name, if a page with the same name already exists. Something that my regular PW 2.4 does not do. That makes me wonder if this module uses some standard PW method or a custom one. I quess there will be a number of similar cases with non-latin characters, so want to make this clear (but not smart enough for now to compare the code myself ).

Share this post


Link to post
Share on other sites

Glad it works for you now!

It even adds a number to the end of the name, if a page with the same name already exists. Something that my regular PW 2.4 does not do.

PW should be adding a number to the end of the name to avoid conflicts. When you say this doesn't work for you, is it with all names, or only with names with cyrillic characters in them?

That makes me wonder if this module uses some standard PW method or a custom one. 

BatchChildEditor uses a custom naming method if the Overwrite Names option is checked in the module config, but if adding or overwriting, it uses the built-in method. What happens if you use the Add option and create to child pages with the same title - does the number get appended to the second child's page name?

Share this post


Link to post
Share on other sites

Hi everyone,

Added some major new functionality to the edit mode today (see revised screenshot for 3. in the first post). Edit mode now includes quick addition, sorting, and deleting of pages as well as full editing via a modal popup editor, similar to the new PageTable interface, making use of MarkupAdminDataTable.

If you are using this, definitely worth updating, and if you're not using it, maybe it is now worth taking a look :)

Enable this on your home template and you have a powerful editing alternative with the added ability to automatically overwrite page names based on changed page titles, which I think is very handy during the development phase of a new site.

Please let me know if you find any bugs with this new version.

3 people like this

Share this post


Link to post
Share on other sites

I just committed a small but significant change in behavior - now if you don't select any templates or pages in the config settings, the Batch Child Editor tools will be available for all pages in your site. 

I have found I want access to this a lot (mostly the rename, sort, and delete functionality of the EDIT mode) and it was annoying to have to go and enable it for the template or page before I could use it, so now it can easily be available to all pages on your site. Hope everyone else finds this more convenient also.

5 people like this

Share this post


Link to post
Share on other sites

Another significant update which should be a huge timesaver.

You can now populate all the text/numeric fields on newly created child pages (Add & Overwrite modes) from CSV formatted rows.

This allows easy creation and population of all page content, for example you could populate an entire page tree of country details by pasting in CSV formatted content like:

"Bolivia, Plurinational State of",BO,"BOLIVIA, PLURINATIONAL STATE OF",BOL,68

"Bonaire, Saint Eustatius and Saba",BQ,"BONAIRE, SAINT EUSTATIUS AND SABA",BES,535

etc

etc

Hope you guys will find this as useful as I am :)

As always, let me know if you have any problems or suggestions for improvements!

5 people like this

Share this post


Link to post
Share on other sites

Major feature enhancements currently available on dev branch  - https://github.com/adrianbj/BatchChildEditor/tree/dev

The new config settings rely on the new "OR" options for inputfield dependencies, so this new version requires the dev branch of PW.

Please test carefully and let me know if you have any problems or suggestions!
 
Thanks to ideas, testing and feedback from @mr-fan this module now supports the following new features which mostly focus on enhanced, customized CSV importing for page creation:

  • Custom configurations on a page by page basis (on the Settings tab) - you can set up a default config in the module settings, but override these for any parent page.
     
  • Ability to set up custom titles, descriptions, and notes so the interface can be tailored to the exact needs of your editors with page/template specific examples.
     
  • Option to have editing tools in a new tab, rather than in the Children Tab. Alternatively, you can now replace the current Children/Subpages list in the Children tab.
     
  • CSV upload and link to external URL, in addition to the existing textarea manual / paste entry.
     
  • Ability to predefine "field pairings". This means that editors can upload/link to CSV files that may contain more fields than you want to import, or there are fields in your template that are not included in the CSV. Think of it as a predefined version of the "Connect the Fields" functionality in Ryan's "Import Pages from CSV Files" module. This makes complex imports foolproof for non-tech site editors.

I think in most cases this could now replace the need for custom scripts for editor friendly, regular CSV importing.
 
Despite the added options, it should be just as simple to setup as before if you don't need any of the extra features.
 
Here are some screenshots to give you an idea.
 
Shows a very simple, restricted CSV upload setup with custom title, description, and notes fields. Note that it is in a custom labeled new tab, rather than under the Children tab.
 
post-985-0-05553000-1429545165_thumb.png
 
All the new parent page specific config settings. Note in particular the "Field Pairings" section where you define CSV column numbers to match PW field names.
 
post-985-0-63565900-1429545174_thumb.png
 
 
The only thing I am having some issues with is persistence of some error messages - if you have setup some options that conflict or otherwise cause a specific error to be sent, you may need to save the settings a couple of extra times to make the message go away - not sure if this is a PW bug or what at the moment, but it shouldn't affect functionality.

6 people like this

Share this post


Link to post
Share on other sites

Another new option added to the dev branch!

The old "Overwrite" edit mode is now called "Replace" and there is a new Overwrite mode that updates the content of fields of existing pages.

An example use case would be to allow editors to periodically upload a CSV file to update certain fields in all child pages while leaving other fields intact. To make this happen you would utilize the Field Pairings option so their import would only edit the specified fields.

4 people like this

Share this post


Link to post
Share on other sites

An example use case would be to allow editors to periodically upload CSV files to update certain fields in all child pages while leaving other fields intact. To make this happen you would utilize the Field Pairings option so their import would only edit the specified fields.

So I do have to give this a test after all. My current client is working with a master excel list, which is imported to pw and I've used Ryan's importer by now. But the ability to predefine the column to field connection is really nice and easy reimporting to update even more. Would it be possible to have different CSV "schemas"? Maybe later even in a per template notion.

Share this post


Link to post
Share on other sites

So I do have to give this a test after all. My current client is working with a master excel list, which is imported to pw and I've used Ryan's importer by now. But the ability to predefine the column to field connection is really nice and easy reimporting to update even more. Would it be possible to have different CSV "schemas"? Maybe later even in a per template notion.

Current behavior is that you can set general setting for different templates and set own settings on a per page basis.

This module is getting the absolute best solution to handle import CSV data to pages. Even it could be easy prepared to be used by clients without to much headache about posible damage...

I wanna thank you adrian - this evolution of the module is a really big one!

1 person likes this

Share this post


Link to post
Share on other sites

So I do have to give this a test after all. My current client is working with a master excel list, which is imported to pw and I've used Ryan's importer by now. But the ability to predefine the column to field connection is really nice and easy reimporting to update even more. Would it be possible to have different CSV "schemas"? Maybe later even in a per template notion.

@mr-fan has already mentioned this, but to clarify, the Field Pairings option is something that is configured on a page by page basis. You set these for the parent page and then all the children that are created from the import follow the defined rules. So I think this allows for the different CSV schemas you are talking about. I thought about doing it per template, but I actually thought that per page was more flexible and natural because afterall this modules is all about creating and the editing child pages of the current parent. I guess this might be a problem if your parent page's template allows for more than one child template. I don't think I have ever allowed this on any of my PW sites, but I am sure some of you do. This module allows the editor to choose the template for new child pages (if the template family settings allow multiple templates or there are no restrictions at all), so if the demand is there, I should be able to implement something along these lines, but please test the current setup first to see if it already suits your needs.

1 person likes this

Share this post


Link to post
Share on other sites

Thanks for the clarification. It just looked like a global configuration from the screenshots. Will install the module later today.

1 person likes this

Share this post


Link to post
Share on other sites

For those interested, I just committed another small update that includes a couple of fixes from @LostKobrakai as well as support for not needing to define the "title" field in the field pairings if you only have edit and overwrite mode enabled. This should make it much more flexible when running CSV data imports to update existing pages.

EDIT: Also just changed "Overwrite" edit mode to be called "Update" to better describe what it does and also to avoid confusion with the "Overwrite Names" option.

4 people like this

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 cosmicsafari
      Hi All,
      I am working on a module at the moment which in theory will create a few simple fields, templates and pages which will all be linked together.
      All is going well so far, I have it generating said fields, templates and pages, however I would like to also set the pages sort order and icon programmatically at this stage also.
      I have yet to see any documentation or any other threads where this has been brought up, is it even possible programmatically without interacting with the database directly?
      This is the snippet which is generating my pages on the fly at the moment.
      foreach($arrayOfPages as $name => $page) { $p = new Page(); $p->template = 'page'; $p->name = $page['URL']; $p->title = $name; $p->parent = wire('pages')->get('name='.$page['parent']); //is it possible to set the icon and sort order at this point, before saving? $p->save(); }  
    • By Robin S
      I have had this module sitting in a 95% complete state for a while now and have finally made the push to get it out there. Thanks to @teppo for his Hanna Code Helper module which I referred to and borrowed from during development.
      http://modules.processwire.com/modules/hanna-code-dialog/
      https://github.com/Toutouwai/HannaCodeDialog
      HannaCodeDialog
      A module for ProcessWire CMS/CMF. Provides a number of enhancements for working with Hanna Code tags in CKEditor. The main enhancement is that Hanna tags in a CKEditor field may be double-clicked to edit their attributes using core ProcessWire inputfields in a modal dialog.
      Requires the Hanna Code module.
      Installation
      Install the HannaCodeDialog module using any of the normal methods.
      For any CKEditor field where you want the "Insert Hanna tag" dropdown menu to appear in the CKEditor toolbar, visit the field settings and add "HannaDropdown" to the "CKEditor Toolbar" settings field.
      Module configuration
      Visit the module configuration screen to set any of the following:
      Exclude prefix: Hanna tags named with this prefix will not appear in the CKEditor toolbar dropdown menu for Hanna tag insertion. Exclude Hanna tags: Hanna tags selected here will not appear in the CKEditor toolbar dropdown menu for Hanna tag insertion. Background colour of tag widgets: you can customise the background colour used for Hanna tags in CKEditor if you like. Dialog width: in pixels Dialog height: in pixels Features
      Insert tag from toolbar dropdown menu
      Place the cursor in the CKEditor window where you want to insert your Hanna tag, then select the tag from the "Insert Hanna tag" dropdown.

      Advanced: if you want to control which tags appear in the dropdown on particular pages or templates you can hook HannaCodeDialog::getDropdownTags. See the forum support thread for examples .
      Edit tag attributes in modal dialog
      Insert a tag using the dropdown or double-click an existing tag in the CKEditor window to edit the tag attributes in a modal dialog.

      Tags are widgets
      Hanna tags that have been inserted in a CKEditor window are "widgets" - they have a background colour for easy identification, are protected from accidental editing, and can be moved within the text by drag-and-drop.

      Options for tag attributes may be defined
      You can define options for a tag attribute so that editors must choose an option rather than type text. This is useful for when only certain strings are valid for an attribute and also has the benefit of avoiding typos.
      Add a new attribute for the Hanna tag, named the same as the existing attribute you want to add options for, followed by "__options". The options themselves are defined as a string, using a pipe character as a delimiter between options. Example for an existing attribute named "vegetables":
      vegetables__options=Spinach|Pumpkin|Celery|Tomato|Brussels Sprout|Potato You can define a default for an attribute as normal. Use a pipe delimiter if defining multiple options as the default, for example:
      vegetables=Tomato|Potato Dynamic options
      Besides defining static options as above, you can use one Hanna tag to dynamically generate options for another. For instance, you could create a Hanna tag that generates options based on images that have been uploaded to the page, or the titles of children of the page.
      Your Hanna tag that generates the options should echo a string of options delimited by pipe characters (i.e. the same format as a static options string).
      You will probably want to name the Hanna tag that generates the options so that it starts with an underscore (or whatever prefix you have configured as the "exclude" prefix in the module config), to avoid it appearing as an insertable tag in the HannaCodeDialog dropdown menu.
      Example for an existing attribute named "image":
      image__options=[[_images_on_page]] And the code for the _images_on_page tag:
      <?php $image_names = array(); $image_fields = $page->fields->find('type=FieldtypeImage')->explode('name'); foreach($image_fields as $image_field) { $image_names = array_unique( array_merge($image_names, $page->$image_field->explode('name') ) ); } echo implode('|', $image_names); Advanced: define or manipulate options in a hook
      You can hook HannaCodeDialog::prepareOptions to define or manipulate options for a Hanna tag attribute. Your Hanna tag must include a someattribute__options attribute in order for the hook to fire. The prepareOptions method receives the following arguments that can be used in your hook:
      options_string Any existing string of options you have set for the attribute attribute_name The name of the attribute the options are for tag_name The name of the Hanna tag page The page being edited If you hook after HannaCodeDialog::prepareOptions then your hook should set $event->return to an array of option values, or an associative array in the form of $value => $label.
      Choice of inputfield for attribute
      You can choose the inputfield that is used for an attribute in the dialog.
      For text attributes the supported inputfields are text (this is the default inputfield for text attributes so it isn't necessary to specify it if you want it) and textarea. Note: any manual line breaks inside a textarea are removed because these will break the CKEditor tag widget.
      Inputfields that support the selection of a single option are select (this is the default inputfield for attributes with options so it isn't necessary to specify it if you want it) and radios.
      Inputfields that support the selection of multiple options are selectmultiple, asmselect and checkboxes.
      You can also specify a checkbox inputfield - this is not for attributes with defined options but will limit an attribute to an integer value of 1 or 0.
      The names of the inputfield types are case-insensitive.
      Example for an existing attribute named "vegetables":
      vegetables__type=asmselect Descriptions and notes for inputfields
      You can add a description or notes to an attribute and these will be displayed in the dialog.
      Example for an existing attribute named "vegetables":
      vegetables__description=Please select vegetables for your soup. vegetables__notes=Pumpkin and celery is a delicious combination. Notes
      When creating or editing a Hanna tag you can view a basic cheatsheet outlining the HannaCodeDialog features relating to attributes below the "Attributes" config inputfield.
      Troubleshooting
      HannaCodeDialog includes and automatically loads the third-party CKEditor plugins Line Utilities and Widget. If you have added these plugins to your CKEditor field already for some purpose and experience problems with HannaCodeDialog try deactivating those plugins from the CKEditor field settings.
    • By joshuag
      Introducing our newest [commercial] module:
      Recurme
      Processwire Recurring Dates Field & Custom Calendar Module.
      http://www.99lime.com/modules/recurme/
      One Field to Recur them ALL…
      A Recurring Dates InputField for your Processwire templates. The InputField you’ve been waiting for.
      Complex RRule date repeating in a simple and fast user interface.
      Use the super simple, & powerful API to output them into your templates.
      example:
      <? // easy to get recurring events $events = $recurme->find(); // events for this day $events = $recurme->day(); // events for this week $events = $recurme->week(); // events for this month $events = $recurme->month(); ?> <? // Loop through your events foreach($events as $event){ echo $event->title; echo $event->start_date; echo $event->rrule; echo $event->original->url; ... } ?> Unlimited Custom Calendars.
      Imagine you could create any calendar you wanted on your website. Use recurring events with the Recurme field, or use your own Processwire pages and date fields to render calendars… it’s up to you. Fully customizable. Make as many calendars as you like. Get events from anywhere. Recurme does all the hard date work for you.
      Unlimited Custom Admin Calendars too.
      Hope you like it  ,
       Joshua & Eduardo from 99Lime.
       




    • By valan
      At our site we use both email and phone authorizations at frontend. To make life easier, I've developed HelperPhone pack that handles phone numbers. This pack includes following modules for ProcessWire CMS/CMF:
      FieldtypePhoneNumber: module that stores phone numbers InputfieldPhoneNumber: module that renders inputfield for phone numbers HelperPhone: module that loads PhoneNumber and PhoneNumberConst classes, and 'libphonenumber' namespace All these modules require included PW WireData-derived class PhoneNumber and PhoneNumberConst.
      PhoneNumber class is a thin wrapper over giggsey/libphonenumber-for-php, itself is port of Google's libphonenumber. PhoneNumberConst class stores constants, used by PhoneNumber class Usage: PhoneNumber class
      $phone = '8 (916) 318-07-29 ext 1234'; // input string could be in any phone-recognizable format $phoneNumber = new PhoneNumber($phone, 'RU'); // or wire('modules')->get('HelperPhone')->makePhoneNumber($phone, 'RU'); echo ($phoneNumber->isValidNumber() ? 'Yes':'No'); // Yes echo ($phoneNumber->isValidNumberForRegion($regionCode) ? 'Yes':'No'); // Yes echo $phoneNumber->getNumberTypeTitle(); // Mobile echo $phoneNumber->getCountryCode(); // 7 echo $phoneNumber->getRegionCode(); // RU echo $phoneNumber->getNationalNumber(); // 9163180729 echo $phoneNumber->getExtension(); // 1234 echo $phoneNumber->formatForCallingFrom('US') // 011 7 916 318-07-28 echo $phoneNumber->formatForCallingFrom('GE') // 00 7 916 318-07-28
      For more methods and properties please refer to PhoneNumber and PhoneNumberConst source files. Need more? Check giggsey/libphonenumber-for-php and use it by accessing $phoneNumber->phoneNumber property - it is instance of \libphonenumber\PhoneNumber or null (if empty).
      Usage: field
      Note: on field creation, make sure that you've configured field settings
      Default region: assumed region if input phone number string is not in international format (starts with '+', etc)
      Enabled/disabled phone extentions: if disabled, phone extension will be removed on field save.
      Phone field settings in example below: default region code 'RU', phone extensions are enabled
      echo $page->phone; // +79163180729 // Note1: $page->phone stores instance of PhoneNumber and renders to string in E164 format. // Note2: E164 format does not include extension. echo $page->getFormatted('phone'); // +7 916 318-07-29 ext. 1234 echo $page->getUnformatted('phone'); // +79163180729 echo $page->phone->format(PhoneNumberConst::RFC3966); // tel:+7-916-318-07-29;ext=1234 echo $page->phone->getNationalNumber(); // 9163180729 Usage: PW selectors
      FieldtypePhoneNumber is instance of FieldtypeText. It stores phone numbers and extensions as string in E164 format with #extention (if provided by user and enabled in settings) E.g. in db it looks like this: '+79163180729#1234'. This makes it easy to query fields as any text field.
      echo $pages->find([     'template' => 'my_temlate',     'phone^=' => '+79163180729', ]); // will echo page ids where phone starts with '+79163180729' Finally
      I've decided to put it here first and later to Modules directory (based on your feedbacks).
      GitHub: https://github.com/valieand/HelperPhone
      Enjoy
    • By justb3a
      Little admin helper module: Using this module you can view all template cache settings at once. E.g. cache status, cache time (configurable). Furthermore it adds the functionality to clear the entire template cache or just the template cache for a given template. Note that this may cause a temporary delay for one or more requests while pages are re-cached.

       
      GitHub: https://github.com/justb3a/processwire-templatecacheoverview