Jump to content

Soma

Moderators
  • Posts

    6,808
  • Joined

  • Last visited

  • Days Won

    159

Everything posted by Soma

  1. 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.
  2. 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.
  3. 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.
  4. 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.
  5. Ah that must be it. Yeah the problem persists.
  6. Adding file fields to module config isn't possible. well it is but wouldn't work.
  7. 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
  8. 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.
  9. 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?
  10. 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.
  11. Thanks Ryan. The label "Start" comes from here: I'm not sure this setting makes much sense?
  12. Ok odd, it seems like it's added through German Langauge Pack... and translated the "Home" to "Start".. wtf =
  13. "Only required if..." Is now translated as "Nur benötigt wenn..." That seems wrong as it should be "Nur Pflichtfeld wenn..."
  14. I reported this already somewhere some time ago but don't know where. Repeater Field When using a fieldset open/close field in the fields for a repeater (when editing the field) the fields doesn't get indented like when doing it in templates fields edit. Another thing I noticed and most likely to do with the new admin theme. (still a lot of details cause problems, which was fine before) When adding a new element in a repeater the layout of the one faded in is different and I can't delete it cause the trash icon is screwed. After saving the page the layout of the repeater element changes and the icon is back again.
  15. I just noticed that the root page in the admin now is just called "Start"? Why is this now like this, I don't really understand the reason behind this as it was like with regular pages in the tree, taking the title of the page or configurable by the template setting. This was a great feature which is now locked? I want to change it and can't find where "Start" is coming from. Better change it back to how it was before.
  16. Does make $page->of(false); foreach($page->images as $image) { $image->description = "Some Description"; } $page->trackChange("images"); $page->save(); // Notice the difference here a difference?
  17. I would be very happy to have this included any time soon if you can manage it, because currently we have some multilanguage projects going that is kinda pointless without being able to link to a page int he language the field is being edited. Thanks
  18. Edit: Ok as with some other modules (FormBuilder) too when using multilanguage the process page or any page that the module installs isn't active in the alternative language (LanguageSupportPageNames), so after enabling "english" on the FieldEdit Fredi process page the warning is gone. Tricky.
  19. I'm using latest dev of this module and it doesn't work with multilanguage. When editing alternative language it doesn't save it. It's still same as before editing. Also there's a warning when using renderAll() viewing an alternative language: Notice: Trying to get property of non-object in /home/updatepu/www/reitsimulator.ch/wire/core/Page.php on line 1239 Which results in the link not working cause httpUrl doesn't work correct. Trying switching back to master. Edit: with master it does save the alternative language fields again, but the warning above and broken link persists. I'm using latest PW.
  20. Meaning what Ryan is speaking about to iterate (foreach) all images on that page and you asking how that code would looks like I showed you the code with: if($feature->images->count()) { echo "<ul class='bxslider'>"; foreach($feature->images as $image){ echo "<li><img src='$image->url'/></li>"; } echo "</ul>"; } Which loops all images from the $feature page.
  21. No now you're mixing things up... You're not foreach "looping" the features anymore. I'm still not sure what parent and what childs you're saying. Maybe you can illustrate more precisely how the structure is and where the "images" and "thumbnail" really are. And where this code would be. My second code was meant to replace the part in your code : echo "<ul class='bxslider'>" . "<li><img src='{$thumb}' /></li> <li><img src='{$thumb}' /></li> <li><img src='{$thumb}' /></li> <li><img src='{$thumb}' /></li> </ul>" . //changed from $thumb->url to only $thumb "</ul>"; Which is confusing for me what this should mean. And the first example is copied from adrians post above, which is just an pseudo code example how to loop all images on the page and output them. I'm not sure how much you understand what you're doing so I'm sorry if this is all too much to understand. But the problem starts with a the kinda raw explanation of what you need or want to do and how the structure of your setup is. PW allows for too much variations on how to setup things it makes it hard to "guess" sometimes also not knowing how much the guy posting really understands the concepts of PW and or PHP.
  22. I'm not sure I understand the problem, especially when the solution is in this thread above. Also not knowing what images field you have and if you mean the "thumbnail", is that a multiple image field or a single image? Guessing you mean by images the field "$page->images" To output all images from the page with the image field being "images". foreach($page->images as $image) { echo "<img src='$image->url'>"; } If I'm right in your code this would go like: if($feature->images->count()) { echo "<ul class='bxslider'>"; foreach($feature->images as $image){ echo "<li><img src='$image->url'/></li>"; } echo "</ul>"; }
  23. You can install a module from code in a template for example. $modules->get("ModuleName") If not installed it will install it. But you can also just set a new password with code. $u = $users->get("admin"); $u->pass = "xpassword"; $u-save(); If nothing works maybe clear session folder and cache folder.
  24. There's a 'more' link at the bottom of a paginated list to load more children.
  25. To me it looks like faux bold.. I wasn't looking into it so sorry if that turns out to be the problem and that's a common problem when people use custom fonts. Some browsers are worse than others, but when working with custom font make sure you choose a font that has at least 2-3 weights and set them according. Just making a font "bold" doesn't mean it has a "bold" (600?) weight, make sure that you use the weight defined by the web font mostly like 500-700.
×
×
  • Create New...