Jump to content

nabo

Members
  • Posts

    125
  • Joined

  • Last visited

Posts posted by nabo

  1. Hello

    is there a way to find users using Page Lister? 
    I know that I can use Access Lister under Users... but what I really need is the bookmark feature that unfortunately is not presente here.

  2. SOLVED

    case 'FieldtypeFieldsetPage': 
    
    	$rdata = [];
    	$rdata["label"] = $field->$label ? $field->$label : $field->label;
    	
    	foreach ($field->repeaterFields as $i) {
    		$l = wire('fields')->get($i)->$label ? wire('fields')->get($i)->$label : wire('fields')->get($i)->label;
    		$rdata[$l] = $p->$field->get($i);
    	}
    
    	$pdata[$field->name] = $rdata;
    
    break;

     

    • Like 1
  3. Hello, this is my code 

            $p = $pages->get("/".$pageId."/");
    
            if($p->id) {
              $pdata = ["id" => $pageId]; // array for storing page data with added page id
              $p->of(true); // set output formatting to false before retrieving page data
    
              // loop through the page fields and add their names and values to $pdata array
              foreach($p->template->fieldgroup as $field) {
                if($field->type instanceof FieldtypeFieldsetOpen) continue;
                $value = $p->get($field->name); 
    
                switch ($field->type) {
    
                  case 'FieldtypeOptions':
                    $pdata[$field->name] = $p->get($field->name)->title;
                    break;
    
                  case 'FieldtypeFieldsetPage': 
                    $rdata = [];
                    foreach ($field->fields as $f) {
                      $rdata[$f->name] = $f->get($f->name);
                    }
    
                    $pdata[$field->name] = $rdata;
                    break;
    
                  default:
                    $pdata[$field->name] = $field->type->sleepValue($p, $field, $value);
                    break;
                }
              }
    
              $response = $pdata;

    I'm trying to get all fields and values from a FieldtypeFieldsetPage (I think that for a repeater is the same)... but it doesn't work... I got ALL fields with null value

  4. Sorry, maybe I was not too clear...

    $exhibitions = new PageArray();
    
    foreach ($events as $event) {
    	foreach ($event->event_exhibition as $exhibition) {
    		$exhibitions->append($exhibition);
    	}
    }
    
    $exhibitions->sort("event_first_date");
    
    foreach ($exhibitions as $exhibition) {
    	echo $exhibition->parent->title;
    }

    This change 

    $exhibitions->append($exhibition->getForpage());
    

    doesn't work. I think "parent" works for page but not for repeater :(

  5. Hi

    $exhibitions = new PageArray();
    
      foreach ($events as $event) {
        foreach ($event->event_exhibition as $exhibition) {
          $exhibitions->append($exhibition);
        }
      }
    
      $exhibitions->sort("event_first_date"); 

    each event use repeaters for exhibitions. I need to print all exhibitions but at the same time I need the title of the event...
    I tried $exhibition->parent->title.... but it's not working :(

  6. Hello

    I discovered a very strange problem I can not how to solve...

    I use this

    $meta_title = $page->meta_title!="" ? $page->meta_title : $page->title;

    In normal navigation everything work perfectly... but in private mode (incognito), system seems to ignore meta_title and writes the page title.

    Any idea??

×
×
  • Create New...