Jump to content

horst

PW-Moderators
  • Posts

    4,088
  • Joined

  • Last visited

  • Days Won

    88

Everything posted by horst

  1. @valan: I don't know the answer but are a bit courious why you not simply try it out? I would expect that this is handled by PW internally and that there is nothing to do manually. But I haven't worked with this and therefore only assuming.
  2. You are welcome. Thats what the forum (besides others) is for: asking for help with problems you cannot solve yourself. It is not bothering. So, - nice to hear it is solved now! PS: also I only was able to think about that solution because of your well sorted and formulated question / description. At least, _you_ gave the answer by yourself. I only was able to see it, whereas you wasn't because you did not have had the distance for a clear view.
  3. @gebeer: That's "the same in green" - When saving in a method that is triggered before saving (regardless if before_saving or if save_ready) every save action triggers it once more.
  4. have you looked into the ckeditor content in one of those pages in editmode? (Sourcecode of the ckeditor field). Could it be you have copied from your local installation and pasted into the ckeditor field of the online version? This way it would be possible that one of those divs (the inner one) was included with the copy / paste action and now lives in the field content of three pages. Just a thought, maybe wrong. PS: welcome to PW
  5. Hey guys, I'm not 100% sure, but hooking before_save and than saving within the module looks not completly clean to me. Maybe I'm not right, but I would try it once without saveing in the module, because saving is done directly after the modules hook function is executed.
  6. can you PM me the original?
  7. Luckily I do not have to work with WP sites, as I'm also build very less sites, mostly private things. There is only one site that was built with WP, it's a private site for my son and me. We haven't made any updates to it since two years. And I want to port it to PW since I know PW, but haven't found the time until now. My 10 years old son has made some photos that he wants to see on the homepage there and I need to remember where the admin / backend / login page was. I tried some URLs that all fail. Than I opened a FTP client and looked to the directory structure and found the name of the subfolder which contains the wp-admin folder. After typing this URL and failing again I got a bit dazzled and was talking / grumbling to myself. My son began to laugh and rolling over the floor and shouts: "You are not able to write wp-admin you have written pw-admin. Everything you can think of is PW!". And he is right: after finding PW, I just want to wipe out any past memory regarding WP. After porting this site I can fullfill this to 100%. Until then I have to live with mistakes like pw-admin.
  8. Maybe it is possible for you to switch to croppableImages as it returns pageimages that you can resize further. The original CropImage does return a URL, not a pageimage object.
  9. If the user can select multiple files for download, you know where they are. You simply can link to the page(s) of them if you have set the new property of mimetype for that template. Then PW will send the apropriate headers for that mime type. But I would bundle all selected files into one ZIP and present that link for downloading.
  10. Hi @tourshi, welcome to PW. If you want do "things" with / from a page in a function, you best pass the $page as parameter or get its handle with the wire() function: function getTitle($page) { $t = $page->title; function getTitle() { $page = wire("page"); $t = $page->title; But if you only want one of two field values, depending if it is populated or not, as I can see from your code, you don't need a function for that. You can use it directly in your template with an OR selector as follows: $t = $page->get("long_title|title"); This will give you the value of long_title if there is one, OR, if it is empty, it gives you the value of title. Coming back to the function: fastest way is to pass the variable into the function, because the variable is an object what is passed by reference. There is no drawback or overhead, its the fastest way. If you, for what ever reason, cannot pass a API variable to a function, you always can get there handles via the wire("nameofapivar") function. This works everywhere, but has a (very little) overhead. Also I don't think it is measurable with a few calls, (less than 100).
  11. If you prefer some type of delayed output, you also can use both (regular and ajax) very close together: $out = ''; $out .= {html head part}; $out .= {my menu content}; $out .= {some other content}; // her we come to the individual content if ($config->ajax) $out = ''; // delete all collected output til here and start new $out .= {my individual content}; //... collect until individual content is complete, then if ($config->ajax) { echo $out; // send it out as html exit(); // stop any further processing } // if it isn't a ajax call you collect also footer etc. $out .= {my footer content}; // send out the complete html page echo $out;
  12. Hi, the error in your first screen advices you to define $config->uploadTmpDir (in site/config.php) and ensure that it is writeable. So, I don't know MAMP and how it manages things, but I would simply try to find a place for uploads by try and error if there are no useful docs for Windows. For example you can try to create C:\MAMP\htdocs\tmp, and set this in your site/config.php $config->uploadTmpDir = 'c:/mamp/htdocs/tmp/'; // yes, you can use forward slashes, PHP and Apache on Windows converts this internally where needed, also try with trailing slash first! And if this doesn't work, go to that folder with the windows explorer and set it rigths to writeable for everyone as a quick and dirty test. Than try again. If this doesn't help come back here and tell us. (missing trailing slash for the directory ?) You may also try $config->uploadTmpDir = 'c:/windows/tmp/'; // traing slash !!
  13. One way can be to not set an default icon to the template(s) but set it manually like here with other things: https://processwire.com/talk/topic/5609-display-a-template-icon-base-on-date-field/ I use this in a project where I need to show the workflow states and the current authors shortcut. There are used 3 different icons and 3 different colors. public function addHookAfter_ProcessPageListRender_getPageLabel($event) { $page = $event->arguments('page'); if ('aki-faq' == $page->template) { $iconTpl = $iconTpl1 = '<i class="icon fa fa-fw fa-file-text [_STATUS_]"> </i>'; $iconTpl2 = '<i class="icon fa fa-fw fa-check-circle-o [_STATUS_]"> </i>'; $iconTpl3 = '<i class="icon fa fa-fw fa-newspaper-o [_STATUS_]"> </i>'; if ($page->editStatus > 2) $iconTpl = $iconTpl2; if ($page->editStatus > 5) $iconTpl = $iconTpl3; $icon = str_replace('[_STATUS_]', 'editStatus' . $page->editStatus, $iconTpl); $kuerzel = str_pad($page->aki_bearbeiter->kuerzel, 3, ' ', STR_PAD_RIGHT); $bearbeiter = (0 == $page->aki_bearbeiter->id || false === $page->aki_bearbeiter) ? ' <span class="akiPageListItem kuerzel warning">---</span> ' : ' <span class="akiPageListItem kuerzel">' . $kuerzel . '</span> '; $event->return = $icon . $bearbeiter . $event->return; } }
  14. Pageimage Manipulator supports this: $image = $page->images->first()->pimLoad("suffix")->setOutputformat("jpg")->save();
  15. dirname(__FILE__) points to E:\... and DOCUMENT_ROOT to C:\...
  16. whats in the error logs of php and apache?
  17. It's the sister from Google (1) and Google (3) Hey, welcome to PW!
  18. blank pages, - but with what HTTP response code? Which profile has you installed? I'm running PW on windows with apache2, too. No problems here. Where do you have the .htaccess file placed when running PW from root? Is it combined with other rules, or is it only the PW distributed one?
  19. Not by design, was just on the ToDo, (erm, on the "forgotten" list). Also on the ToDo is to add some meta-headers and more content in regard of SEO. You are right with the impression, but the subtitle belongs to the brand, so I cannot drop it. And the whole paragraph is a (one) clickable link which points to the portfolio, where all three sections are available. So at least not completly wrong. But I'm always open for suggestions.
  20. There seems to be something was changed with the newer smtp class that we have changed 2 weeks ago. But anyways, it seems to be fixed now. @Pete, please can you have a look to it? I haven't changed anything on the behave of To-Recipients, only CC and BCC.
  21. PIA is only compatible with PW 2.5 and 2.6! in Github repo, the subheader at top: Module for ProcessWire 2.5.0+ and in the modules directory it has the appropriate checkboxes checked. When trying to direct install via PW 2.4, you have it on the install screen: So, with PW 2.5+ you will see more bold information when versions are mismatch, or "thumbs up icon" if they match fine. But at least, also with PW 2.4 all needed informations are on the right place(s). One more reason to update your PW version, we are on 2.6 stable for some weeks now ;-)
  22. Do you have copied all files completely to the modules directory? Which version of PW and PHP do you use?
×
×
  • Create New...