Jump to content

Roberts R

Members
  • Posts

    44
  • Joined

  • Last visited

Recent Profile Visitors

1,590 profile views

Roberts R's Achievements

Jr. Member

Jr. Member (3/6)

10

Reputation

  1. What I'm missing here? Why does "is empty" does not work? seo_description is multi-language textarea field.
  2. Its not or I'm not aware of how that would happen for tests I did before posting. I'm always up for learning Does the trick. It seems that defining variables this way should be done in config.php file. Either way thanks for help. ?
  3. Hello. I'm having little trouble with setup. Having global variable in _init.php and not being able to access it? $test = "test"; function text() { global $test; return $test; } and using this function in templates returns null. What i have to do is create function that I use in templates. This function does some checks based on global value and returns string. Maybe there are other way to implement it?
  4. Hello Is there a way to got timestamp from FieldDatetime? Like $page->event_start->timestamp? Lets say that I have datetime field that have following format 'd/m/Y' and I'm trying to get week number from given field. $datetime->date('W'); (returns : 01) but $datetime->date('W',$page->start_date) (returns: 03) but should be same. There is workaround, but that just seems too much ? $datetime->date('W', $datetime->stringToTimestamp($page->event_start, 'd/m/Y'));
  5. Hello. I never though about it before but when I insert image into CKeditor field I don't get ALT tag filled from image that has it. Do I have to do it manualy for inserted image or Im doing something wrong?
  6. Yea.... not sure. Issue went away without reason that I could tell. And now I can't reproduce it as well. Thanks for response regardless.
  7. if ($page->$field) { // do stuff } else { // skip } should do the trick. if you have some Pagearray fields then check if field is array and it has count() > 0 then do stuff
  8. I have simple page structure: category subcategory simple-product simple-product simple-product simple-product subcategory .... category2 so Im at category page and running $pages->find("template=simple-product, has_parent=$page, limit=8"); and it returns 0 pages but this returns 4 pages $pages->find("template=simple-product, has_parent=$page"); Can someone explain why limit does not work here? EDIT: So I did some tests and it seems that any limit=n where n is >= actual page count that is possible ... selector return 0 results.
  9. Just to let you know. Link on homepage does not work.
  10. To use this with php7.2 you have to change list($unit, ) = each($units); $unit = key($units) in Number.php line 293. As "each" function is now DEPRECATED
  11. Ah this is what I can use when running Ajax (last part). Thank you as well.
  12. echo WireRenderFile('child', ['page' => $child]); Learnt something new. Thanks. Could not find it in Api reference. Or I don't know how to look for it.
  13. Ok let me try again. My config file : $config->useMarkupRegions = true; $config->prependTemplateFile = '_init.php'; $config->appendTemplateFile = '_main.php'; Child template in ./templates/child.php <div class="child"> <div class="image" style="background-image:url('<?=$page->backgroundImage->url?>')"></div> <div class="description"> <h3><?=$page->title?></h3> <p><?=$page->smallDescription?></p> <div class="price">CHF <?=$page->price?>.-</div> </div> </div> Hanna code : <?php foreach ($page->children('template=child') as $child) { echo $child->render(); } ?> parent template is just : <main pw-replace="main"> <?=$page->body?> </main> And question is how do render child without "_init.php" and "_main.php"?
  14. As im statring to use $config->useMarkupRegions = true; I'm starting to run in things I can't figure out. In body field I have hanna code inserted that renders some of children and children have template. When rendering children they include $config->prependTemplateFile = '_init.php'; $config->appendTemplateFile = '_main.php'; for all rendered children. Is there a way to render without them?
×
×
  • Create New...