Jump to content

Mikel

Members
  • Posts

    43
  • Joined

  • Last visited

Posts posted by Mikel

  1. Just now, daniels said:

    Hey @Mikel, seams like with the original mailchimp subscribe forms, it is possible (and in my opinion it should be) to resubscribe. I will have a look on that! Thanks for the input. 

     

    Meanwhile (e.g. for testing) you can use the delete method to completely delete and resubscribe a user. That is working for me with the current version.

    Thanks, thats just what I implemented and testet this moment. Working flawless :-)

  2. Just now, jacmaes said:

    @Mikel Pretty sure you can’t subscribe to a list you previously unsubscribed from. It’s a Mailchimp “feature”. 

    Ok, thanks, I was not sure, so, in my special use case it will be better not to unsubscribe the user, but to delete him.

    So if he likes to subscribe again in the future, he will get added again. 

  3. Hi, Daniels,

    thanks for sharing this! I have just ran into an issue while testing:

    After successful initial subscription of an user, I could unsubscribe him again, but after that no more subscription of the same user would work.

    Is this due to a limitation of Mailchimp?

  4. I just had a look at the template files: What’s the point in the numerous „row“ and included „class=‚col-xs-12‘“-Containers in the template files? They can be skipped altogether.

    Also the duplicating of the navigation for displaying a mobile navigation is not really state-of-the-art... bootstrap provides a mobile nav solution right out of the box...

    Keep it simple! Cheers!

  5. Just upgraded a client installaion (on the development server) to latest stable 2.x release. When testing I spotted a bug (?) adding specific new pages via the "Add new" button or the Pages-> "Add New" menu entry. The specific template used by this page is located a bit down the age tree, so after clicking the "Add new" button the "Where do you want to add ..." select shows. After selecting a parent for the new page nothing happens. Usually the (hidden) submit is triggered.

    Can anyone verify this?

    (My workaround is to simply show the submit button)

    Cheers, Mike

  6. Hi, Soma,

    thanks for the quick reply. The hint (::added) was correct. It pointed me to other problems, so we could work everything out. 
    Here is the working code for automating the modules config (placement in ready.php):

    $this->addHookAfter('Pages::added', function($event) {
    	  $page = $event->arguments[0];
    
        if ($page->template == 'NAME_OF_TEMPLATE') { //check template of page added
        
          // get new domain from page name
          $new_domain = $page->name; 
    
          // get config data and save it to var
          $config = wire('modules')->getModuleConfigData('Multisite'); 
      
          // add new domain to config data and save it
          $config['subdomains'].= "\n".$new_domain;
          wire('modules')->saveModuleConfigData('Multisite', $config); 
        }
    });

    I will work on Hooks for Pages::trashed and Pages::renamed.

    As this is a client project, we will not upgrade unless we get paid for it, so we will stick with this solution for some time ;-)

    So here are the other two mentioned hooks. Both are working:

    $this->addHookBefore('Pages::renamed', function($event) {
    	  $page = $event->arguments[0];
    
        if ($page->template == 'NAME_OF_TEMPLATE') { //check template of page added
        
          // get old domain from page name
          $old_domain = $page->namePrevious;
          
          // get new domain from page name
          $new_domain = $page->name; 
    
          // get config data and save it to var
          $config = wire('modules')->getModuleConfigData('Multisite'); 
          
          // replace changed domain in config data and save it
          $config['subdomains'] = str_replace($old_domain, $new_domain, $config['subdomains']);
          wire('modules')->saveModuleConfigData('Multisite', $config); 
        }
    });
    
    $this->addHookBefore('Pages::trashed', function($event) {
    	  $page = $event->arguments[0];
    
        if ($page->template == 'NAME_OF_TEMPLATE') { //check template of page added
          
          // get domain from page name
          $domain = $page->name; 
    
          // get config data and save it to var
          $config = wire('modules')->getModuleConfigData('Multisite'); 
          
          // remove deleted domain from config data and save it
          $config['subdomains'] = str_replace("\n".$domain, '', $config['subdomains']);
          wire('modules')->saveModuleConfigData('Multisite', $config); 
        }
    });

     

  7. Hi, all,

    we are trying to automate the module config setting for admin users that only have access to the page tree. The idea is that these admin users should be able to create new pages with the specific multisite template and the page name is automatically added to the multisite config array on page creation.

    Sadly the hook does not work :-(  It is placed in the ready.php:

    $this->addHookAfter('Pages::add', function($event) {
    	  $page = $event->arguments[0];
    
        if ($page->template == 'project_home') { //check template of page added
        
          // get new domain from page name
          $new_domain = $page->name; 
    
          // get config data and save it to var
          $config = wire('modules')->getModuleConfigData('Multisite'); 
          $data = $config['subdomainsArray']; 
          
          // add new domain to config data and save it
          array_push($data, $new_domain);
          wire('modules')->saveModuleConfigData('Multisite', $data); 
        }
    });

    Any clues?

  8. Hi, kixe, thanks for reminding me of your module!

    It works the way you wrote, but I have one problem: The site we are working on is for a real estate company. The template in question must be reused for a lot of different projects. (=pages) 

    So it does not work specifying the image field of only one page (filtering per id). The field created with your module should instead fetch all images of the page being edited. 

  9. Hi, Zeka, thanks for the reply.

    The goal is to upload about 30 to 50 images at once and then use them in individual sections of the page (template):
    In "normal" textareas and in "special purpose" fields which actually just would need to store the image reference. With image fields you can only upload images, not choose already uploaded ones. (Or can you?)

  10. HI guys,

    I am wondering if I am to focused on the problem, so that I don´t see an obvious solution, or that there is no elegant solution... ;-)

    Ok, here is the usecase:

    I am building a template with only one image-field that collects all needed images for that page. Also there are several repeater matrix fields: One for each section of the page. In each repeater matrix there is the possibility to choose one of the pages images for displaying it as "fullwidth section image" on frontend. At the moment I am doing this with a textarea, which is prone to errors, due to wrong user input.

    Is there another possibility to store an image reference as a textarea?

  11. Hi, Ben,

    I just looked ino the WireMailChimp module: It does require the Subscribers module, doesn´t it?

    For my needs I altered the part whre this module is loaded and the role "subscriber" is checked. (I just run a check against my own subscriptions field)

    I will then allways get the same error message, no matter if subscribing or unsubscribing:
    400: [EMAILADRESS] is already a list member. Use PUT to insert or update list members.

    Did you already got it to work properly?

    • Like 1
  12. Sadly I get an error when downloading the module via PW.

    PW Version is 2.8

    IMG_0153.PNG

    Just tried with latest PW 3.0.41: Same, same... :-(

  13. Hi, Horst,

    I just tried to install the module, but got 2 error messages right after downloading, regarding:

    AdminLinksInFrontend.module, line 153
    and
    ProcessAdminLinksInFrontend.module, line 45

    In both cases I had to remove the [...] part to get it working: 

    self::$opcEnabled = opcache_get_status();//['opcache_enabled'];

    I am running PW 3.0.23 in this particular case.

     

    EDIT: Ok, now PW tells me why: I need to install PHP 5.4 or greater...

    Sorry for bothering you!

    • Like 1
  14. @Mikel and everyone else,

    Sorry for the hassles - this has obviously been a pain for you and taken up other folk's time as well. 

    I am trying to duplicate here, but can't and also can't figure out how it could be an issue - if you are logged in, the first line inside the module's init() returns before any it does anything else.

    I'd love to be able to see a test installation where the problem is happening? Any chance you might be able to set up something on lightning.pw or elsewhere?

    Hi, Adrian,

    sorry for this! Next time I will do this in a new post. 

    mea maxima culpa!  :blush:

    • Like 1
  15. Hello everybody,

    I finally made it up:

    The project, still in development, is using Adrians nice module "Protected Mode". This module, if set to protected mode, seems to prevent the next() and prev() methods  from working correct. 

    problem solved. :-)

    PS: After going through the "Protected Mode" module I wonder HOW this module can interfere with the next() and pre() methods...  :huh:

    PPS: Now it gets really interesting: IT IS NOT "Protected Mode" module causing the next() & prev() methods to return NULL || nullPage object.

    the dependency I detected meanwhile is if the current user is logged in or not:

    anonymous user (aka "guest") --> everything works fine

    logged in user --> methods return NULL

    I will keep working on this one...

    • Like 1
  16. It's all correct and works. So what is different to your other projects? Are pages published? Are they viewable? Is the page really in the PageArray, but when $page->next doesn't even work you seem to have a problem somewhere. No idea sorry.

    Hi, Soma,

    thats what I'm trying to find out since a couple of hours...

    pages are published - check

    pages are viewable - check

    page is in the pageArray because

    print($g->each('<p>{title}</p>'));  

    generates the correct output of all pages - check

  17. What do you get with: 

    print_r($page->next($g))

    ?

    I get this:

    NullPage Object ( 
      [template:protected] => 
      [templatePrevious:Page:private] => 
      [parent:protected] => 
      [parentPrevious:Page:private] => 
      [namePrevious:Page:private] => 
      [statusPrevious:Page:private] => 
      [output:Page:private] => 
      [filesManager:Page:private] => 
      [fieldDataQueue:protected] => Array ( ) 
      [isNew:protected] => 1 
      [isLoaded:protected] => 1 
      [outputFormatting:protected] => 
      [instanceID:protected] => 0 
      [pageNum:protected] => 1 
      [config:protected] => 
      [quietMode:protected] => 
      [createdUser:protected] => 
      [modifiedUser:protected] => 
      [settings:protected] => Array ( 
         [id] => 0 
    ​ ​ ​   [name] => 
         [status] => 1 
         [numChildren] => 0 
         [sort] => -1 
         [sortfield] => sort 
         [modified_users_id] => 0 
         [created_users_id] => 0 
         [created] => 0 
         [modified] => 0 ) 
         [data:protected] => Array ( ) 
         [useFuel:protected] => 
         [className:Wire:private] => 
         [classNameOptions:Wire:private] => Array ( ) 
         [localHooks:protected] => Array ( ) 
         [trackChanges:Wire:private] => 0 
         [changes:Wire:private] => Array ( ) 
         [_notices:protected] => Array ( 
           [errors] => 
           [warnings] => 
           [messages] => 
        ) 
    ) 
    
  18. $g is an array of pages in your example that doesn't seem related to a particular page, so how does it know what next and prev are?

    Next and prev usually relate to the page being viewed, so $page->next() and $page->prev() should be all you need.

    Hi, Pete,

    I tried your code right after this:

    $prev = ($page->prev->id) ? '<a href="'.$page->prev->url.'">'.$page->prev->title.'</a>' : '';
    $next = ($page->next->id) ? '<a href="'.$page->next->url.'">'.$page->next->title.'</a>' : '';
    

    Unfortunately neither is working...

×
×
  • Create New...