Jump to content

Soma

Moderators
  • Posts

    6,798
  • Joined

  • Last visited

  • Days Won

    158

Everything posted by Soma

  1. Admin pages can have segments and they're mapped to the function in the process module attached to it. But that's not the urlSegments you can use on frontend. Like /adminpage/edit Will call executeEdit() method in the process module. I'm not sure how custom admin pages work and that's maybe not possible as you don't use process module to make the admin page.
  2. That's why I made a module long ago "FormSaveReminder". It's still beyond me why this feature isn't yet in core.
  3. No theres no unpublish($page, true) You can use the Batcher module to mass edit pages. You'll need a selector like "has_parent=1004" id of parent... The behavior of children of a unpublished parent is the same as when it's published. It doesn't influence it's children. Hard to say without seeing your code. But my guess is you have a script that tries to find the parent page but can't because it's unpublished... and you call $parent->children() somehwere but $parent isn't really a page object. that's what the error says at least. But you still could get the parent and it's children via API even if unpublished, you just add "include=all" to the selector or just use a get $parent = $pages->get(1004); // id of the parent $children = $parent->children(); // works as usual, even if $parent unpublished But it's still unclear to me what you try/need. Why unpublish them, when you want to query them? That's a question I can't really give an answer, as I still don't know the reason why you want to unpublish all those pages? Do they need to be hidden in navigation? Where hideing the parent would be enough? I can imagine that if you really want to make them all unpublished and not reachable to unpublish the parent for the branch and control a 404 in you templates init somewhere like the head.inc. if($page->parents("status>=". Page::statusUnpublished)->count()){ throw new Wire404Exception(); } Basicly checking if any parents of the current requested page ist unpublished, and then show 404. But not tested really, just a example.
  4. I don't think he needs to do anything, but ModulesManager and Core modules manager (download/install) I reported issue on github for this. I got it working by cycling all modules and calling their $modules->getModuleInfo(modulename); which will not install the module but init it. This is the only way I found to still be able to call getModuleInfo on the module after downloading to check for requirements and show install button or not. Because now both modules manager are missing this step and just show install button. It is no problem on the listing (table view) as there is all this happening already and checked for "requires".
  5. I just noticed some warnings with imagesizer when I have debug mode on.. The image sizing seem to work though, but seems odd to have so many warnings shown on frontend. Notice: Undefined variable: thumb2 in /xxxxx/core/ImageSizer.php on line 370 Warning: imagejpeg() expects parameter 1 to be resource, null given in /xxxxx/wire/core/ImageSizer.php on line 370 Warning: rename(/xxxxx/site/assets/files/1016/fv1b7390_kl-1.600x0_tmp.jpg,/xxxx/site/assets/files/1016/fv1b7390_kl-1.600x0.jpg) [function.rename.php]: No such file or directory in /xxxx/wire/core/ImageSizer.php on line 384 Warning: iptcembed() [function.iptcembed.php]: Unable to open /xxxx/site/assets/files/1016/fv1b7390_kl-1.600x0.jpg in /xxxx/wire/core/ImageSizer.php on line388 Warning: chmod() [function.chmod.php]: No such file or directory in /xxxx/wire/core/Pageimage.php on line 210 Notice: Undefined variable: thumb2 in /xxxx/wire/core/ImageSizer.php on line 370 Warning: imagejpeg() expects parameter 1 to be resource, null given in /xxxxx/wire/core/ImageSizer.php on line 370 Warning: rename(/xxxx/site/assets/files/1016/fv1b7281_kl-1.600x0_tmp.jpg,/xxxx/site/assets/files/1016/fv1b7281_kl-1.600x0.jpg) [function.rename.php]: No such file or directory in /xxxx/wire/core/ImageSizer.php on line 384 Warning: iptcembed() [function.iptcembed.php]: Unable to open /xxx/site/assets/files/1016/fv1b7281_kl-1.600x0.jpg in /xxxx/wire/core/ImageSizer.php on line388 Warning: chmod() [function.chmod.php]: No such file or directory in /xxxx/wire/core/Pageimage.php on line 210 Also wanted to mention once again, that sizing images that already have the desired dimension it fails and no image is shown. Like $image->size(940,0)->url and if the source image already has 940px it fails and no image shown. This is now since a long time and has been reported and is (very) annoying
  6. What? Making a page unpublished counts only for the page itself. Depends what you need and what you mean with hide. Lots of options and contexts and terms...
  7. I think you don't need to set it. It will automatically take the template name without .php To set a filename other than its name you need to set the alternative name.
  8. I want 15.245px Just noticed that when I have images field in a custom tab as the only field (is at top), the grid view doesn't work. At least for me in latest version Chrome. ©licking the icon just collapses the field.
  9. I pushed a little update to 1.0.9 fixes dependency issue with extending module that isn't installed yet installing module now only possible if requirements are met by the module info some changes to the module table columns and showing summary directly, added "added" date column and number of likes from users module dependencies now shown below summary if any.
  10. I'm not sure the date is really recognized as date and that would work with strtotime() but maybe you should put it in as a string: $p->calendar->find("booked=0, checkin_1='16.11.2013'"); This should definately work $date = strtotime("16.11.2013"); $p->calendar->find("booked=0, checkin_1=$date"); Outputformatting has nothing to do with it.
  11. That seems a problem both ModulesManager download/install and core Modules "New" download/install suffers from. Problem seems to be that calling getModuleInfo() inits the module and since ProcessLanguageTranslator isn't installed yet, it throws the error because the class isn't loaded. I fixed it with a little workaround. So it will disable installing when there's requirements that aren't yet met. I pushed an update to ModulesManager just now. Also with some little improvements to the data table.
  12. The htaccess surely isn't the problem here. How is it only when you use it in a tab or also when used in normal content area? Strange, And do you have site installed in a subfolder from the root?
  13. You could install the modules required by adding another rule to info array "installs" => "ProcessLanguageSupport" or "installs" => array("ProcessLanguageSupport","AnotherOne"); That will install those modules before yours. Or you can install them in the install routine of your module simply with a get() call wire("modules")->get("ProcessLanguageSupport"); From the perspective of modules manager I'm not sure I can add something that would check. I'm interested what happens when you install your module using core "New" feature. You enter your modules class name and it will ask to download it if found.
  14. // prependFile: Filename to prepend to output, must be in /site/templates/. (default=$config->prependTemplateFile) PageRender.module #302 $output->setPrependFilename($config->paths->templates . wire('sanitizer')->name($options['prependFile'])); It runs the value through $sanitizer->name which doesn't allow "/". So no it's not possible.
  15. It's a little confusing why you search for pages then search repeaters to then return the page the repeater is on to call renderItem($r), so you need to filter them again in renderItem() ? If you want to filter the repeater again with the date, then why don't you do it? $p->calendar->find("booked=0, checkin_1=16.11.2013") Or am I missing something? You could as mentioned earlier search for repeaters directly and then get the page they live on, but I thought you want to render the repeater and not the page. However this could look like $repeaters = $pages->find("template=repeater_calendar, checkin_1=16.11.2013, booked=0, include=all"); foreach ($repeaters as $r) { $repPage = $r->getForPage(); if($repPage->isPublic && $repPage->fireplace) $content .= renderItem($repPage); } But as said the renderItem($repPage) is confusing to me as I would expect you would want to render the repeater item $r.
  16. return r=5773 r=5773 r=5773 r=5789 But that's the pages the repeater lives in same as $p in you code. Are you sure that's not the $r = $r->getForPage() you have in your code, that is returning the page the repeater is living on and not the repeater itself.
  17. No it's not really documented unless you dig in the code, where it is documented in /wire/core/Wire.php It's used internally to track changes for values and fields (what?) I'm not really sure about all the details and why it's like this when used in API. Image or file fields are very special in PW other than text fields, and I think with repeaters I noticed the a similar behavior. In short, an image field in PW is a Pageimage that is instanced by FieldtypeImage, and it's a FieldtypeMulti , lots of things happening there. I think along the way $page->save() isn't somehow reaching or checking the image field, as it does when a page is saved in the admin which is handles by a special context and by the ProcessPageEdit module. Or in this case using $page->save("fieldname") it takes a different route and explicit saving the field. Looks like when modifying values for file fields it's not getting recognized for the description and the trackChange isn't happening. So I can't say for sure but maybe setting the description with $image->set("description", "the text"); would make a difference? Otherwise Ryan might can share some light on this.
  18. So does this $p->calendar->find('booked=0') Not returning correct results? What does it return? Or not anything at all? Does the $pages->find return correct results? Also wanted to note that $r->getForPage(); is returning what you already got with $p. The page the repeater is living on.
  19. Ah that must be it. Yeah the problem persists.
  20. Hmm, ok maybe I'm dumb but didn't see that only the add new translation screen has changed. I get this warning: Notice: Undefined variable: lang in /.../site/modules/ProcessLanguageTranslatorPlus/ProcessLanguageTranslatorPlus.module on line 113
  21. What I'm doing wrong. I installed module and changed the process of LanguageTranslator in admin to use the TranslatorPlus, but nothing changed and still get the same language translator. Also for me the LanguageTranslator admin page isn't locked for me. I'm using latest PW dev.
  22. I'm trying to render repeater using the $page->render("path/to/template.php") method. Like this: echo $slider->render($config->paths->templates . "views/_slider.php"); But I'm getting an error Error: Exception: Template file does not exist: '/home/updatepu/www/reitsimulator.ch/site/templates/repeater_repeater_slider.php When I create a repeater_repeater_slider.php file in the templates folder my code works and it's using the /views/_slider.php correctly Why is this and can we prevent that error?
  23. The new "Add New" button is nice feature but I'm not sure it's very useful for all sites (the way it works for now), if I have a site structure that doesn't allow for the right setup needed. Either because the template may used in different branches, and or a multisite setup. I dream of a more configurable thing, and maybe also able to disable it.
×
×
  • Create New...