kongondo

Visual Page Selector (commercial page picker module for ProcessWire)

Recommended Posts

Hey guys, the current state of VPS is a great start, I think. Let's just be productive as always ;) Calling products "Pro" and "Professional" is just a marketing mambo-jumbo we started to use because we are following suit. I'm sure @kongondo is just as passionate about his modules as @Robin S.

  • Like 1

Share this post


Link to post
Share on other sites
51 minutes ago, kongondo said:

Are you implying that I don't care about the visual details of my modules as long as they work?

I didn't intend any insult - it's just that I've found from conversations with clients and colleagues that people differ in how much they notice design details. I've had conversations with clients where they literally cannot see the difference between typeface A and typeface B, or colour A and colour B. To them, it's just "a font" or "green", and no amount of discussion changes that. For people in our line of work perhaps it depends on what our background or "first love" is: a person who comes to development via design probably sees things differently to someone who comes to design via development.

51 minutes ago, kongondo said:

Given that this is a commercial product, it could be insinuated that I'm just after the buck?

I don't think that at all. But I do think that there is some significance to crossing from free module to commercial module. There's a greater responsibility to ensure that the product is reasonably mature, tested, and fit for purpose. It's only natural that consumers will have higher expectations if they are buying a product as opposed to receiving it for free.

Please don't take it that I'm bitterly disappointed in VPS or anything like that because I'm not. It's an awesome product, but one that I feel needs a bit more work in order to be production-ready. My only intention here was to give some constructive feedback.

  • Like 2

Share this post


Link to post
Share on other sites

Thanks for the clarification @Robin S. I appreciate the comments, they are helpful. The things that I was unsure about I have asked for clarification and you've provided this. I am passionate about all my modules, both commercial and free. I would never knowingly release a module that is half-finished :). In this regard though, I must apologise to all VPS users because there has been an oversight on my part. I'll explain in a minute. My workflow is that I develop my modules in ProcessWire 2.7 using Reno Theme. I then test in the default admin theme. When I have everything working and looking as it should (PHP, JS, CSS, inside repeaters, etc), I repeat the process in ProcessWire 3.x. There are some cases where I even have Reno Theme-specific CSS classes, to make sure everything works fine irrespective of the theme. In the case of the last version of VPS, I now realise, I forgot to test using default theme in ProcessWire 3.x and for this I apologise to all of you. I am glad Robin caught this. I am equally very curious why others didn't notice this. It can only mean, either you don't use the default theme, or mainly use ProcessWire 2.7 or etc? Either way, I will fix this.

7 hours ago, Robin S said:

My only intention here was to give some constructive feedback.

And it is Robin. Please don't hold back! Like I said, I was unsure about some statements and you've clarified them. 

To all, please, don't hold back on the feedback. Not wanting to repeat this statement everywhere, this goes not just for VPS, but for all my modules, free and commercial. However, I can't promise to implement every suggestion since I need to consider things like backward compatibility.

  • Like 4

Share this post


Link to post
Share on other sites
2 hours ago, Robin S said:
19 hours ago, kongondo said:

I have no empirical evidence, but it seems to me, PW 2.x users are still the majority.

I would have thought that nearly all new site developments use PW3. I know I have never contemplated building a new site with the old <= v2.7. And most buyers would be using VPS for new projects rather than retrofitting it into old projects that they are not willing to upgrade, wouldn't they?

@kongondo You could run a quick survey. Personally I agree that it is not likely that VPS customers want it for PW 2.7 but it is your decision, of course. I started with ProcessWire 3 so anything before that is history to me.

BTW: https://weekly.pw/polls/

see: Which versions of ProcessWire are you currently hosting or managing? (146 votes)

Edited by szabesz
added weekly polls
  • Like 1

Share this post


Link to post
Share on other sites

Quick update. I have made very good progress.

Hi all. 

I am intending to ONLY support ProcessWire 3.x starting from the next version of this module. Please have a read here and let me know what you think. Thanks.

  • Like 1

Share this post


Link to post
Share on other sites

Hey, I've tried to use VPS in a Repeater field and it's not working correctly at all. Same field is working fine stand-alone. Is that a known problem or did I do something wrong?

Share this post


Link to post
Share on other sites

Hi @mattgs,

Sorry for the problems you are experiencing. You'll need to be a bit more descriptive. What is not working correctly? What ProcessWire version?

Thanks.

Share this post


Link to post
Share on other sites

I was wondering if the module was known to work inside of a Repeater field. It seems it doesn't. When used inside a Repeater field, it can't access the field configuration and ends up with default values and the Add button missing. Digging through the source code I've noticed that when used inside a Repeater field, the process doesn't get the correct (or any) $pageFieldID, as can be seen by the iFrame URL missing the pageFieldID.

Share this post


Link to post
Share on other sites

Found the culprit:

Line 113 in InputfieldVisualPageSelector.module:

$pageField = $this->wire('fields')->get($this->name);

When inside a Repeater field, the field name gets appended by _repeater plus some ID. I brute forced this problem by changing the line to this:

$pageField = $this->wire('fields')->get(preg_replace('/_repeater\d+/', '', $this->name));

It works for me, but it's probably not exactly a clean solution. There's probably a better way to get the "clean" field name via the API.

  • Like 1

Share this post


Link to post
Share on other sites

Ah, I see. A while ago, I had a similar issue with Media Manager which I resolved using preg_match and str_replace. I must have forgotten to do the same for VPS. I'll do this in the next version of VPS. Thanks for catching this.

Share this post


Link to post
Share on other sites
1 hour ago, kongondo said:

A while ago, I had a similar issue with Media Manager which I resolved using preg_match and str_replace.

A handy trick for dealing with the suffix added to inputfield names inside a repeater is to use the name of the associated field object instead, which you can get via the hasField property of an inputfield.

In this case it looks like you want the Field object anyway so it could be:

//$pageField = $this->wire('fields')->get($this->name);
$pageField = $this->hasField;

(not tested)

  • Like 2

Share this post


Link to post
Share on other sites

sorry for my confusion...

but how do i specify the columns on the lister that pops up for page select – i'll need to be able to configure the columns and then have those be set for all the other users, the other users won't be able self-configure the columns for the lister; right now when i create the page select field, i just get sort of a default lister setup with Title, Template, Modified, Mod By;

i'll also need to be able to setup/configure the available filters for the popup.

Also - note there may be some issue with the lister setup, when i set one up, the initial selector seems to have copied (from the field settings) itself into the Limit Selectable Fields/Columns field, rather than the initial selector field. I manually move that to the initial selector field and added some stuff to the lister columns;

next problem – there is an add new button on the popup, but that shouldn't be there (right?)

vps_add_new.jpg.1c4460c1c777531407b0ee361c6d84ad.jpg

Share this post


Link to post
Share on other sites
9 hours ago, Macrura said:

sorry for my confusion...

I'm even more confused than you :P.

 

9 hours ago, Macrura said:

but how do i specify the columns on the lister that pops up for page select – i'll need to be able to configure the columns and then have those be set for all the other users, the other users won't be able self-configure the columns for the lister; right now when i create the page select field, i just get sort of a default lister setup with Title, Template, Modified, Mod By;

That's the main source of my confusion. This was working before and I remember you asking this question previously. I have now checked, way back to VPS3 and it's not working! Not even in PW2.7. I don't know if it's a caching issue. 

 

9 hours ago, Macrura said:

i'll also need to be able to setup/configure the available filters for the popup.

Not currently supported but it can be done; we have this in Media Manager.

 

9 hours ago, Macrura said:

Also - note there may be some issue with the lister setup, when i set one up, the initial selector seems to have copied (from the field settings) itself into the Limit Selectable Fields/Columns field, rather than the initial selector field.

I haven't been able to reproduce this. I've just tested and initSelector works fine here (PW 3.0.84).

9 hours ago, Macrura said:

next problem – there is an add new button on the popup, but that shouldn't be there (right?)

Strange one. We have no add new button in VPS. Must be a CSS issue related to Bookmarks? When the modal loads (if using default theme), there's a brief flash of some button but then it disappears.

Sorry about this issues. However, I am afraid these Lister issues will now have to wait until after the next release of VPS which is quite close. I was going to request a number of you to beta test VPS5 (given the move to PW 3 + the other changes coming in RE Robin's suggestions). I hope you don't mind waiting till that is sorted. Thanks.

Edited by kongondo
  • Like 1

Share this post


Link to post
Share on other sites
On 11/28/2017 at 2:30 AM, Robin S said:

//$pageField = $this->wire('fields')->get($this->name);
$pageField = $this->hasField;

(not tested)

Yes, that works, thank you so much -- I knew there was nothing the Processwire API couldn't do :)

  • Like 1

Share this post


Link to post
Share on other sites

Thanks - i can't recall how i solved the lister columns for other users; i will do some more testing; at worst case i will show the other users how to setup the lister on their own, and then it gets stored somewhere(?) or maybe i should enable the bookmarks and tell them to use that(?)

i see that basically when the lister comes up for page selection, that it does use the default columns; perhaps there could be some way to integrate lister pro, so that VPS doesn't need to take on the task of configuring the lister; in other words for users who don't have lister pro, then bookmarks seem to be the only way to store a 'view' for the popup, but if you have lister pro, then maybe you could specify the name of a lister to use and then the module could read those settings for the popup in that case, or even maybe there could be a way to export a lister pro setup into VPS popup screen..

  • Like 1

Share this post


Link to post
Share on other sites
On 28/11/2017 at 1:30 AM, Robin S said:

In this case it looks like you want the Field object anyway so it could be:


//$pageField = $this->wire('fields')->get($this->name);
$pageField = $this->hasField;

(not tested)

Thanks. I'll test this soon.

Share this post


Link to post
Share on other sites

I'm not able to create a bookmark, if i try to create one, it seems to break;

i also tried adding a bookmark to the regular lister but the popup doesn't show that bookmark in the bookmarks tab (i have enabled bookmarks)

Do you think it would be possible to hook into the VPS method that generates the popup and then setup the lister there?

Sorry for the continued posting on this, but this is somewhat urgent as the editors need to be able to use VPS to select from a complex listing of pages and these users are very limited in their abilities to use computers etc..

Share this post


Link to post
Share on other sites
On 29/11/2017 at 2:16 PM, Macrura said:

i can't recall how i solved the lister columns for other users;

I need my head to be examined! I was looking at the wrong setting. What we've always had is the limitFields setting. That limits selectable columns. We also currently have disallowColumns, for columns that should not be selectable/displayed. For the columns to display by default we need to set the properties columns and defaultColumns.  These two have been missing from VPS. I have added these to the latest version (5) that I am working on. The former is done programmatically. The latter is what you'll see as a setting in a VPS field. I hope to release this tomorrow to a limited number of users for beta testing. 

@Macrura, I will also add a setting to allow/disallow other users from seeing the columns filter when using the Lister. This means that they will only be able to work with the columns you've set if you wish. I think this was part of your request, no? I can't recall if this is the normal behaviour in Lister Pro. If it is not, please let me know.

On 29/11/2017 at 2:16 PM, Macrura said:

in other words for users who don't have lister pro, then bookmarks seem to be the only way to store a 'view' for the popup,

Bookmarks are not the only way, as per my explanation above. defaultColumns will sort this out.

On 29/11/2017 at 2:16 PM, Macrura said:

but if you have lister pro, then maybe you could specify the name of a lister to use and then the module could read those settings for the popup in that case, or even maybe there could be a way to export a lister pro setup into VPS popup screen..

Sounds like a good idea. I'll have to study this first. It will certainly not make it into the current version of VPS (5). 

 

On 01/12/2017 at 3:52 PM, Macrura said:

I'm not able to create a bookmark, if i try to create one, it seems to break;

i also tried adding a bookmark to the regular lister but the popup doesn't show that bookmark in the bookmarks tab (i have enabled bookmarks)

Something else I'll have to study, in this case since I've never used Bookmarks before :-X :).

If you can get VPS5 by tomorrow, defaultColumns should be able to partly solve your issue I think.

  • Like 1

Share this post


Link to post
Share on other sites

Sounds like the defaultColumns is what i was looking for - thanks!

Share this post


Link to post
Share on other sites

I've sent a couple of you the latest VPS to beta test please before the official release. 

Thanks!

  • Like 1

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 horst
      Wire Mail SMTP

      An extension to the new WireMail base class that uses SMTP-transport

      This module integrates EmailMessage, SMTP and SASL php-libraries from Manuel Lemos into ProcessWire. I use this continously evolved libraries for about 10 years now and there was never a reason or occasion not to do so. I use it nearly every day in my office for automated composing and sending personalized messages with attachments, requests for Disposition Notifications, etc. Also I have used it for sending personalized Bulkmails many times.

      The WireMailSmtp module extends the new email-related WireMail base class introduced in ProcessWire 2.4.1 (while this writing, the dev-branch only).
       
      Here are Ryans announcement.



      Current Version 0.3.0
      get it from the Modules Directory Install and Configure

      Download the module into your site/modules/ directory and install it.

      In the config page you fill in settings for the SMTP server and optionaly the (default) sender, like email address, name and signature.
      You can test the smtp settings directly there. If it says "SUCCESS! SMTP settings appear to work correctly." you are ready to start using it in templates, modules or bootstrap scripts.


      Usage Examples
      The simplest way to use it:
      $numSent = wireMail($to, $from, $subject, $textBody); $numSent = wireMail($to, '', $subject, $textBody); // or with a default sender emailaddress on config page This will send a plain text message to each recipient.
       
      You may also use the object oriented style:
      $mail = wireMail(); // calling an empty wireMail() returns a wireMail object $mail->to($toEmail, $toName); $mail->from = $yourEmailaddress; // if you don't have set a default sender in config // or if you want to override that $mail->subject($subject); $mail->body($textBody); $numSent = $mail->send(); Or chained, like everywhere in ProcessWire:
      $mail = wireMail(); $numSent = $mail->to($toEmail)->subject($subject)->body($textBody)->send(); Additionaly to the basics there are more options available with WireMailSmtp. The main difference compared to the WireMail BaseClass is the sendSingle option. With it you can set only one To-Recipient but additional CC-Recipients.
      $mail = wireMail(); $mail->sendSingle(true)->to($toEmail, $toName)->cc(array('person1@example.com', 'person2@example.com', 'person3@example.com')); $numSent = $mail->subject($subject)->body($textBody)->send(); The same as function call with options array:
      $options = array( 'sendSingle' => true, 'cc' => array('person1@example.com', 'person2@example.com', 'person3@example.com') ); $numSent = wireMail($to, '', $subject, $textBody, $options); There are methods to your disposal to check if you have the right WireMail-Class and if the SMTP-settings are working:
      $mail = wireMail(); if($mail->className != 'WireMailSmtp') { // Uups, wrong WireMail-Class: do something to inform the user and quit echo "<p>Couldn't get the right WireMail-Module (WireMailSmtp). found: {$mail->className}</p>"; return; } if(!$mail->testConnection()) { // Connection not working: echo "<p>Couldn't connect to the SMTP server. Please check the {$mail->className} modules config settings!</p>"; return; } Following are a ...


      List of all options and features


      testConnection () - returns true on success, false on failures


      sendSingle ( true | false ) - default is false

      sendBulk ( true | false ) - default is false, Set this to true if you have lots of recipients (50+)


      to ($recipients) - one emailaddress or array with multiple emailaddresses

      cc ($recipients) - only available with mode sendSingle, one emailaddress or array with multiple emailaddresses

      bcc ($recipients) - one emailaddress or array with multiple emailaddresses

       
      from = 'person@example.com' - emailaddress, can be set in module config (called Sender Emailaddress) but it can be overwritten here

      fromName = 'Name Surname' - optional, can be set in module config (called Sender Name) but it can be overwritten here


      priority (3) - 1 = Highest | 2 = High | 3 = Normal | 4 = Low | 5 = Lowest

      dispositionNotification () or notification () - request a Disposition Notification


      subject ($subject) - subject of the message

      body ($textBody) - use this one alone to create and send plainText emailmessages

      bodyHTML ($htmlBody) - use this to create a Multipart Alternative Emailmessage (containing a HTML-Part and a Plaintext-Part as fallback)

      addSignature ( true | false ) - the default-behave is selectable in config screen, this can be overridden here
      (only available if a signature is defined in the config screen)

      attachment ($filename, $alternativeBasename = "") - add attachment file, optionally alternative basename


      send () - send the message(s) and return number of successful sent messages


      getResult () - returns a dump (array) with all recipients (to, cc, bcc) and settings you have selected with the message, the message subject and body, and lists of successfull addresses and failed addresses,


      logActivity ($logmessage) - you may log success if you want

      logError ($logmessage) - you may log warnings, too. - Errors are logged automaticaly
       
       
      useSentLog (true | false) - intended for usage with e.g. third party newsletter modules - tells the send() method to make usage of the sentLog-methods - the following three sentLog methods are hookable, e.g. if you don't want log into files you may provide your own storage, or add additional functionality here

      sentLogReset ()  - starts a new LogSession - Best usage would be interactively once when setting up a new Newsletter

      sentLogGet ()  - is called automaticly within the send() method - returns an array containing all previously used emailaddresses

      sentLogAdd ($emailaddress)  - is called automaticly within the send() method
       
      Changelog: https://github.com/horst-n/WireMailSmtp/blob/master/CHANGELOG.md
       
    • By Robin S
      An experimental module for adding images to a field via pasting one or more URLs.
      Add Image URLs
      Allows images to be added to an images field by pasting URLs.

      Usage
      Install the Add Image URLs module.
      A "Paste URLs" button will be added to all image fields. Use the button to show a textarea where image URLs may be pasted, one per line. Images are added when the page is saved.
       
      https://github.com/Toutouwai/AddImageUrls
    • By netcarver
      This module provides a very simple interface to a set of named counters. You simply call a single function, next('name'), to pull the next value out of a counter - or to set it up if it does not yet exist. Next() takes a few extra parameters to allow you to increment by values other than 1 or to start at a certain number.
      This provides some similar functionality to the built-in page naming feature of PW, and to this module recently posted by Stikki but I think it offers a little more flexibility than either. Having said that, I do like the simplicity of Stikki's new auto-increment module.
      Module Availability
      Here is my module on Github.
      Here it is in the module repository.
      Example Usage
      Here's how this module can be used to title and name a new page by adding a couple of simple hooks to site/ready.php. This example applies to new pages using a template called 'invoice' that can be quick-added to the page tree. In order to get the following to work, you must edit the template that will be the parent of the 'invoice' template and setup the template for children to "invoice" and set the "Name Format for Children" field to something other than the default blank value (I use  title  as my value.)
      <?php /** * Function to recognise our special template. */ function isInvoiceTemplate($template) { return ($template == 'invoice'); } /** * Pre-load the page title for invoice pages with a unique value * which includes a counter component. */ $pages->addHookBefore("Pages::setupNew", function($event) { $page = $event->arguments(0); $is_invoice = isInvoiceTemplate($page->template); $no_inv_num = $page->title == ''; if ($is_invoice && $no_inv_num) { $counter_name = 'WR-' . date('Y'); $number = $this->modules->get('DatabaseCounters')->next($counter_name, 10, 5000); $page->title = $counter_name . '-' . sprintf("%06u", $number); } }); /** * Prevent ProcessPageEdit from forcing an edit of the name if we got here * through a quickAdd from ProcessPageAdd. We can do this because we * preset the title field in the Pages::setupNew hook. */ $pages->addHookAfter("ProcessPageEdit::loadPage", function($event) { $page = $event->return; $is_invoice = isInvoiceTemplate($page->template); $is_temp = $page->hasStatus(Page::statusTemp); if ($is_invoice && $is_temp) { $page->removeStatus(Page::statusTemp); $event->return = $page; } }); Note, the above code + module is one direct solution to the problem posted here by RyanJ.


      Version History
      1.0.0 The initial release.
    • By flydev
      PulsewayPush
      Send "push" from ProcessWire to Pulseway.
       
      Description
      PulsewayPush simply send a push to a Pulseway instance. If you are using this module, you probably installed Pulseway on your mobile device: you will receive notification on your mobile.
      To get more information about Pulseway, please visit their website.
      Note
      They have a free plan which include 10 notifications (push) each day.
       
      Usage
      Install the PulsewayPush module.
      Then call the module where you like in your module/template code :
      <?php $modules->get("PulsewayPush")->push("The title", "The notification message.", "elevated"); ?>  
      Hookable function
      ___push() ___notify() (the two function do the same thing)
       
      Download
      Github:  https://github.com/flydev-fr/PulsewayPush Modules Directory: https://modules.processwire.com/modules/pulseway-push/  
      Examples of use case
      I needed for our work a system which send notification to mobile device in case of a client request immediate support. Pulseway was choosen because it is already used to monitor our infrastructure.
      An idea, you could use the free plan to monitor your blog or website regarding the number of failed logins attempts (hooking Login/Register?), the automated tool then block the attacker's IP with firewall rules and send you a notification.
       

       
      - - -
      2017-11-22: added the module to the modules directory
       
    • By cosmicsafari
      Hi all,
      Just wondering if its possible to just add some basic output to my modules config page.
      I was wanting to output a bulleted list of some information which I will be pulling from a third party.
      Retrieving the data is fine i'm just not sure how to output it to the config page?
      From what I can see in the link below, it only seems like you can append form items to the page.
      https://processwire.com/blog/posts/new-module-configuration-options/