Jump to content

Mikel

Members
  • Posts

    43
  • Joined

  • Last visited

Everything posted by Mikel

  1. Thanks, thats just what I implemented and testet this moment. Working flawless :-)
  2. 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 happens to be an issue in Safari. Last stable version (2.8.35) works though.
  6. 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
  7. 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); } });
  8. 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?
  9. OMG! Of course, I forgot about this possibility) Thank you, this works perfectly!
  10. Hi, kixe, the backend is the only place where this is needed! But as I am actually a designer/part-time developer( with more or less growing knowledge of programming), could you please tell me where you placed the hook above? In a seperate module? Thanks!
  11. 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.
  12. 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?)
  13. 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?
  14. 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?
  15. Sadly I get an error when downloading the module via PW. PW Version is 2.8 Just tried with latest PW 3.0.41: Same, same... :-(
  16. 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!
  17. After upgrading the ProcessWire installation to 2.7.2 the methods next() and prev() work like they should.
  18. No, we decided to drop everything relying on the prev() and next() methods until this gets fixed. If PW is able to return the sibling PageArray, it should to be able to traverse it, should't it?
  19. IMHO its a bug. We decided to drop everything relying on the prev() and next() methods until this gets fixed. If PW is able to return the sibling PageArray, it should to be able to traverse it, shouldn't it?
  20. Hi, Adrian, sorry for this! Next time I will do this in a new post. mea maxima culpa!
  21. 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... 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...
  22. 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
  23. 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] => ) )
  24. Unfortunately not :-( But, as I stated before, the methods work fine in other projects, so I want to find the (to me) hidden dependency of these methods. When I output the pageArray $g everything looks fine...
  25. 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...