Jump to content


AlexV

Member Since 17 Feb 2012
Offline Last Active Jul 20 2012 01:40 PM
-----

Topics I've Started

Addition of some items into a Pagefield field via api

11 June 2012 - 09:18 AM

Hi guys!
I want to import into multiple pages at once the same value of the field, which is Pagefield. I make a selection of pages, and how to specify the page in Pagefield do not know.
Likely this question already rose, but at a forum I didn't find the answer.
Example: Pagefield is called «subway_station» in it I have to choose two out of a hundred pages, called «green» and «orange», as it be?


foreach($pages->get("/district/")->find("district_region=UZAO") as $p) {
echo "<a href='{$p->url}'>{$p->title}</a> " ;
$p->subway_station->add("/subway_station/sub_st_0111/"); // <img src='http://processwire.com/talk/public/style_emoticons/<#EMO_DIR#>/huh.gif' class='bbc_emoticon' alt='???' />
$p->save();
}