Jump to content

Search the Community

Showing results for tags 'PageArray'.

  • Search By Tags

    • pagearray ×
    Type tags separated by commas.
  • Search By Author

Content Type



Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


  1. 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-...
  2. Hello! I am building a searching mechanism where the search key will be compared to three different fields in heirarchy and the matching search results will be saved to a PageArray. Like below $pageData = new PageArray(); $pageData->append($page->children('field_1*=' . $search_key )); $pageData...
  3. 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...
  4. 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...
  5. 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.
  6. I have a page field on my home template with output set to multiple pages (PageArray). I can echo its value, 1111|2222, or foreach $nav as $p echo $p, 11112222. But when I do this that I need to, it doesn't work: foreach ($mainnav as $p) { if($page->rootParent->id == $p->id) $current =...
  7. 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...
  8. Good Day! I am a beginer of processwire project. Thanks developers for your great work. this CMS is very Good! I have a question: how get Pageimage object of PageArray from "Page" (PageArray) field type? I have too tamplates: affiliates and their teachers. The template of affiliates...
  9. Hello everyone, i guess my php knowledge is not good enough to find a solution for the following problem: I'm building a website where i have projects. Each project has tags like "webdesign, responsive, cms, print, flyer" etc. At the end of a project i want to recommend other projects, whi...
  10. 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...
  11. 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.
  12. 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));...
  13. 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.
  14. 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...
  15. 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...
  16. 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...
  17. 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...
  18. 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...
  19. 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>...
  20. 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.
  21. 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...
  22. 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 =...
  23. 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...
  24. 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...
  25. 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...
×
×
  • Create New...