xpath('/page/item[@id="'.$id.'"]/background-image') as $c_1) { echo $c_1; }*/ if ($id != "_1" && $id != "_2" && strlen((string)$id) == 2) { $id = $id.'_1'; } $parentsID = $c->xpath('/page/item[item[@id="'.$id.'"]]/@id'); $selectedFirstLevelItem = $c->xpath('/page/item[@id="'.$id.'"]'); if (!$selectedFirstLevelItem && !$parentsID) { $id = "_1"; // ID invalid, reset ID } $bgimg = ""; if ($c->xpath('//item[@id="'.$id.'"]/background-image')) { $bgimg = array_shift($c->xpath('//item[@id="'.$id.'"]/background-image')); } else { $bgimg = array_shift($c->xpath('//item[@id="'.$id.'"]/item/background-image')); } echo $bgimg; ?>);">
xpath('//item[@id="'.$id.'"]/gallery/image')); if ($gallery) { $imagecount = 0; foreach ($gallery as $image) $imagecount++; if ($imagecount > 0) { echo '
'; } for ($i = 1; $i < $imagecount; $i++) { echo ''; } } ?>
xpath('/page/item/item[ position()=1 ]/background-image'))); echo '
'; $parent_backgrounds = $c->xpath('/page/item/item[ position()=1 ]/background-image'); foreach ($parent_backgrounds as $item) { echo '
'; // style="display: none;" } if ($parentsID) { $sibling_backgrounds = $c->xpath('/page/item[@id="'.$parentsID.'"]/item/background-image'); if ($sibling_backgrounds) foreach ($sibling_backgrounds as $item) echo '
'; } else { $children_backgrounds = $c->xpath('/page/item[@id="'.$id.'"]/item/background-image'); if ($children_backgrounds) foreach ($children_backgrounds as $item) echo '
'; } ?>