Jump to content

Jochen Kremer

Members
  • Posts

    4
  • Joined

  • Last visited

Profile Information

  • Gender
    Male

Jochen Kremer's Achievements

Newbie

Newbie (2/6)

2

Reputation

  1. Hi Horst, thanks a lot - this works - and i learned a lot new possibilities .) I am always looking into the cheatsheet & documentation. But iam relatively new to php ... because of that iam often not sure how to interprete what i read there ... i think its time for a basic book about php in general oO Thanks and && byebye Jochen PS: there was missing at semicolon $p = $itemsData->first()
  2. Hi there, i realy dont understand the problem - im passing a var to a php with is a string with a correct field name. When i try to load the data of that field .... it returns nothin. If i just set the field name in the code as string° it works ... look at the comments in the code-snippet. Anyone can explain me wh yythis dosent work? Thanks && byebye Jochen <?php namespace ProcessWire; require_once '../index.php'; $targetGrid = $_GET["targetGrid"]; // this is "desktop_grid_placed" echo $targetGrid."<br>"; // echos "desktop_grid_placed" echo gettype($targetGrid)."<br>"; // echos string $itemsData = wire()->pages->find("template=portfolio-item"); for ($i=0; $i < count($itemsData); $i++) { $p = $itemsData[$i]; $_gridPlaced = $p->get($targetGrid); // returns nothing echo $_gridPlaced." <br>"; //echos only the <br> tag } echo $p->get("desktop_grid_placed"); // returns a value - with is okay
×
×
  • Create New...