Jump to content

titanium

Members
  • Posts

    161
  • Joined

  • Last visited

Everything posted by titanium

  1. Works for me as well... As always, I simply added the files to the default language. Thanks for your continuous efforts, Manfred!
  2. Thanks for testing! If you comment the line, than value 1 is shown. The difference is only visible after the redirect. May I ask you to try again with: $session->redirect('./test.php'); given the file is named "test.php". I did edit my version above.
  3. (I already posted this in ProcessWire's issue list at github a week ago, but I'm not too sure if this really is an issue I should Ryan bother with. I hope it can be better answered/discussed by the community). I would like to collect form data in a session and do a redirect afterwards. After the redirect happens, I would like to read the form data back from the session. This follows the concept of the PRG-Pattern, which I consider as a good practice to avoid duplicate form submissions. In 2.7.2, the following code worked flawlessly. In 3.0.8, I can't get it to work anymore. Here's my simple test case (save it as "test.php", in parallel to the index.php). I hope somebody can give me a hint what's wrong with it. <?php include './index.php'; if ($input->post->submit) { $session->input = $input; $session->redirect('./test.php'); } if ($session->input && $session->input->post) { // 2.7.2: echoes "1" // 3.0.7: echoes nothing! foreach ($session->input->post as $value) { echo $value; } $session->remove('input'); } ?> <!DOCTYPE html> <html> <head> <title></title> </head> <body> <form action="" method="post"> <button type="submit" name="submit" value="1">send</button> </form> </body> </html>
  4. I still doubt that it has to do with your PHP setup. What does happen if you try to duplicate the root page? Does the copy show the same problem?
  5. I don't think that the PHP version is the culprit - I have 5.6.17 as well, and it works. Did you check the file permissions, especially the site/assets/files/1 directory?
  6. I think it's a matter of how you are going to output the repeater's contents. One possibility: add a date field to the repeater's items. If this date has reached, the item is not displayed anymore. Some untested code: <?php $home = $pages->get('template=homepage'); if (count($home->myRepeater)) { foreach ($home->myRepeater as $concert) { if ($concert->date < time()) { continue; } // output any other concert information from here on } } else { echo 'Sorry, no concerts, pal.'; } Another idea: You could check if the page to which the repeater links to (I suppose via page field) is still published. Some code: <?php $home = $pages->get('template=homepage'); if (count($home->myRepeater)) { foreach ($home->myRepeater as $concert) { $concert_page = $concert->link; if ($concert_page->id && $concert_page->is(Page::statusUnpublished)) { continue; } // output any other concert information from here on } } else { echo 'Sorry, no concerts, pal.'; } I hope I did get you right and the above code works and is of any help for you. Had no time to set it up and test it out properly.
  7. Should it be possible for the users to register themself via front end? If so, the users could be told that the username they have selected has already been taken and they should register with another one. Then it's up to them to find something what they like. I guess you already have found some information how to build custom login forms, but just in case you didn't: https://processwire.com/talk/topic/107-custom-login/
  8. It would be very helpful to be able to log what method calls, file includes, new objects etc. ProcessWire uses when it does it's magic in the backend. Optimistic approach, granted, but I imagine this could be a way to re-use ProcessWire's backend processes more easily. This could help to automate the task I described in my last posting above. I'm not too sure, but in a small corner of my brain I remember that some kind of "macro recorder" module for ProcessWire does exist somewhere? Or maybe I just dreamt of this
  9. Hi, I'm trying to automate the process of updating installed language packs with the help of the API, because I have to update quite a lot of ProcessWire installations and I would like to avoid these tedious tasks. While is easy to select the language page and upload the new language files to the field, I noticed that there is more to be done: Obviously the process of parsing the language files has to be started somehow. I looked around in /wire/modules/LanguageSupport and, well, I have to say that this seems to be above my capabilities. :-/ Has anyone experiences how language files could be fully imported by API? Thank you.
  10. One more thing The mobile view displays most menu items in english, see attached screenshot.
  11. Manfred, thanks a lot for continuous effort I noticed that the submenu for Pages ("Seiten") isn't completely translated: "+ Add Page" and "Edit" are still in English (ProcessWire 2.6.17). I guess they aren't translatable with ease?
  12. Well, it's a web service. You can use JSON. Or some server driven mechanism, like curl and some php. It's the only external interface to ProcessWire as far as I know. Since you can't simply include ProcessWire in Typo3, I think it's the route to take...
  13. Does $page->images even exist? The if-condition asks for $page->slideshow_images...
  14. Yeah, don't use Typo3 at all Just kidding. Serious again: You can try to use Pages Web Service.
  15. No, you don't have to avoid using a variable called $options, because it $options is only used in a local scope, in this example it's used in the local scope of the method "renderPage()". It's not a global ProcessWire API variable like $page, $pages or $config, for example - you should avoid redeclaring these. Read more about these API variables here.
  16. I have done something like this half a year ago. I made an intranet for a company with 200 employees. There are no problems I heard of so far. It has a full text search, a searchable image repository with thousands of photos, every user has his own profile with his portrait... Most important thing was: every download of this intranet (PDF, Word, Excel, image files and so on...) is a page. I have build a small multi file importer which allows to upload many files at once, which leads to creation of the according amount of pages with these files attached. I did this to give each file more properties (think of it as an" asset management" - every file can have properties like view rights, tags, relations, descriptions, authors etc.). To assign this download pages to their parent "content pages" (the page the visitor sees in frontend view) I did use page tables very much. I think it works very good and I enjoyed it to develop and customize.
  17. The css class name needs to be unique? And you want to enter it in the backend by yourself somehow? I think this does not scale, because sooner or later you will use the same css class name twice. If it should be truly unique, I suggest a combination of $page->id and $image->name ($page which contains $image). May I ask why it has to be unique?
  18. Did you try to write "return " ahead of the above command like this: return $pages->find('parent=/tags/' . $page->parent->name . '/'); ?
  19. It's not possible to filter style as an attribute in CKEditor this way. CKEditor works with this pattern: [attributes]{styles}(classes). Valid attributes are align or onclick for example, but style is handled with the second part of the pattern, in curly brackets. What you can do for example: [*]{width} will strip style="width:10px" from all elements. You can enhance this functionality with own JS functions. Read more about it in CKEditor docs
  20. Hi, I have a client which has a PageTable with a long list of PageTable entries. He feels annoyed that he has to scroll down the whole list in order to see the "Add" buttons at the bottom of the list. I would like to build a module which adds a second set of "Add" buttons at the top of the PageTable. I took a look at InputfieldPageTable.module and can see that the buttons get added in the function "___render" at line 117: // render the 'Add New' buttons for each template $btn = ''; foreach($this->rowTemplates as $template) { $button = $this->wire('modules')->get('InputfieldButton'); $button->icon = 'plus-circle'; $button->value = count($this->rowTemplates) == 1 ? $this->_x('Add New', 'button') : $template->getLabel(); $url = $this->wire('config')->urls->admin . "page/add/?modal=1&template_id=$template->id&parent_id=$parentID"; if($this->nameFormat) $url .= "&name_format=" . $this->wire('sanitizer')->entities($this->nameFormat); $btn .= "<span class='InputfieldPageTableAdd' data-url='$url'>" . $button->render() . "</span>"; } $out .= "<div class='InputfieldPageTableButtons ui-helper-clearfix'>$btn</div>"; Since there is no hookable method for adding the buttons alone, I think that there are two routes to take now: - Replace the whole ___render() method or - call the existing render method and parse the $event->return for css class "class='InputfieldPageTableButtons" and copy it on top of $event->return (DOM manipulation) Both ways feel clumsy and not future-proof in case of PageTable module upgrades. Is there a better route I should take?
  21. 1. Something like this should work: if($page->url === $_SERVER['REQUEST_URI']) { $session->redirect($page->parent->url); } 2. From https://processwire.com/api/selectors/ foreach($page->children('sort=sort') as $child) { require($child->template .'.php'); };
  22. I would like to add that this is true for allowed content rules in string format. If object definitions are used, there are more possibilities. For example, a function can be called which allows only a match of certain values for id.
  23. @ BUCKHORN: very nice looking drag 'n drop editor. Did you develop it on your own? Is it available (e. .g. open source)? Reminds me of Sir Trevor, but your editor seems to be more feature-rich...
  24. Thanks for this module, justb3a, it comes right just in time for me However, I think there is a problem: I noticed that values for "caption", orientation or custom fields are saved in database (that part works). But if I edit the same image again, the values have disappeared. The fields are empty. If the image is saved again, the values in the database get lost. UPDATE: I tried to debug it. If I change line 1045: $value = $this->wire('sanitizer')->entities($pagefile->{$current}($language)); to $value = $this->wire('sanitizer')->entities($pagefile->{$current}); the problem disappears. I guess this fix does not work if you have more than one language defined.
  25. I'm trying to use this module to convert a bunch of png files to jpg. It works fine with a handful of images, but then it get's slower and slower. Here is my testing code: $images = $page->images; if ($images) { foreach ($images as $image) { $jpg = $image->pimLoad()->setOutputFormat('jpg')->pimSave(); } } And here are the debug times in seconds - every number at the beginning of the line shows the loop count (it equals the number of images converted): 1: 0.21 2: 0.41 3: 0.67 4: 1.08 5: 1.96 6: 4.42 7: 12.79 In fact it's always the same image with a different name (1.png, 2.png and so on). Anybody facing the same?
×
×
  • Create New...