Search the Community
Showing results for tags 'PageArray'.
-
This is my code <form method="post" action="<?php echo $page->url;?>"> <?php $idiomas = $pages->get('/tabla/idioma/')->children(); foreach($idiomas AS $idioma) { ?> <input type="checkbox" name="idiomas[]" id="idioma_<?php echo $idioma->id; ?>" value="<?php echo $idioma->id; ?>" <?php if ($page-...
-
i have a event-page with a table. first column in this table is page-reference-field how can i find out if a urlSegment matches one of the rows having the same page-reference-field (page-id)? // all guests $allguests = new pageArray(); foreach($page->event_guests_table as $event_guests_ta...
-
Hi, I have a page with a repeater called teams with two fields: team (a pageReference with a list of teams) and people (a pageReference with a list of people who likes this team). I'm trying to populate the people field in the repeater according to the value of the team field in the same repeat...
- 2 replies
-
- getselectablepages
- pagearray
-
(and 2 more)
Tagged with:
-
I can't add a new value to a custom PageArray field for my user. However, when I create a new user, I CAN add the new PageArray value: I need help. Thank you very much.
-
Hello there! I'd love to see more array operation functions such as map/reduce. There are already a few helpful functions there like pop, shift, etc. I find myself turning pageArrays into arrays, do array_map or similar and create pageArrays again from that data. For Processwire, it w...
-
I've got this code to fetch all pages: /** @var PageArray $pages */ $pages = $this ->wire('pages') ->find(sprintf( 'has_parent!=2,id!=2|7,status<%s', Page::statusTrash )); With this I fetch all pages except admin, but...
-
Hey, I've searched for this and I couldn't find it, what i want to do is check if a page (object) already is in a PageArray field? Ofcourse i can go through it with a loop but if theres already a method to do this then i dont want to re invent the wheel.
-
I have a situation where a pagearray appears to lose its sort order. 1. template xyzzy.php fetches a pagearray with code similar to: // in an external include file function get_pages($selector) { $found = wire('pages')->find($selector); wire('log')->save('fubar', count($found));...
-
I have several fields on a site I am working on and want to pull values from a multiselect field but all I get are the page_ids. Any help would be appreciated. Thanks.
-
Hi, I have an array of Page IDs ($matches) which I'm using in a PageArray ($matches_limit): $matches_limit = $pages->find("id=$matches, limit=$page_limit"); This is working fine but I need to maintain the sort order of $matches, however $matches_limit reorders the $matches (I guess to so...
-
Hello together, this might be a newbie questions, but I got some problems with a PageArray and don’t know how to go on. My goal is give out the parent.name of a page that was found earlier and was put into a PageArray. My found pages: $matches = $pages->find($selector); Some of t...
-
Hi, Run into a bit of an issue with pagination on a site I am working on. I am sure the answer is really simple, but struggling to figure out what's going wrong. I have a bunch of articles, but I only want the ones where the date is less than the current date. I then want to limit the array so...
- 6 replies
-
- pagination
- pageArray
-
(and 1 more)
Tagged with:
-
I've poked around the forums and can't figure out the following: I have a page that uses a $pages->find to generate a pageArray called $test. I am then using $test->render(); to create a list of page links for returned results. When I click on one of the page links it takes me to the correct page...
-
Hi there, I'm having trouble instantiating a PageArray and was wondering if i've overlooked something very obvious (Won't be the first time!) I've included a snippet of the code The Error I'm getting is "Class 'Site\PageArray' not found". I'm using namespaces as I've had name collisions befor...
- 5 replies
-
- PageArray
- Object Creation
-
(and 2 more)
Tagged with:
-
I want to create a basic breadcrumb menu on my site and i'm using this code <?php $parents = $page->parents(); ?> <?php foreach( $parents as $item): ?> <span><a href='<?php echo $item->url; ?>'><?php echo $item->title; ?></a></span> <?php endforeach; ?> <span><?php echo $page->title; ?></span>...
- 4 replies
-
- breadcrumb
- foreach
-
(and 2 more)
Tagged with:
-
Hi. I need to compare two pagefields. I tried this: $page->locations->has($user->locations) But this doesn't work. I need to compare them and find out if the $page->locations has one or more of the same locations as the $user->locations. Hope it makes sense.
-
I am having trouble working out the syntax for outputting relational data that is nested inside a repeater field. I only started using repeater fields a couple of days ago, and pagearray fields three weeks ago. The problem involves the following templates and fields: classlesson_plan_section (rep...
-
Save Page Type field with multiple pages programatically
SwimToWin posted a topic in API & Templates
How can I programatically Save() to a Page Type field that contain multiple pages (PageArray)? This attempt fails with no error message, nothing is saved: $p = $pages->get(1234); $p->of(false); $p->foo = 4321; # Page Type field, I am trying to update the ID. // $p->foo = "bar"; // $p->foo->id =... -
To get a page by index number from a PageArray is easy: /* returns a page object */ $pagebyindex = $myparentpage->children->eq(integer $num); Now I needed a function which returns the Index of the page from the siblings. It took me a while to figure this out, and I like to share this here: /* re...
-
Let's say I've got a template with a field of a Page type. This field is set to handle multiple options (PageArray). Now, I want to select all pages using this template, that have specific page set in the PageArray field. Basically, something like this: $pages->find('template=x pagearrayfield.co...
-
I'm not able to get my array list. I have a menu template and I'm grabbing it, but it won't let me go inside it I get this error Warning: Invalid argument supplied for foreach() in /x/site/templates/includes/header.inc on line 61 $items = $pages->find('template=menu, title=Toolbar Menu, include...