Search the Community
Showing results for tags 'Array'.
-
Page Query Boss Build complex nested queries containing multiple fields and pages and return an array or JSON. This is useful to fetch data for SPA and PWA. You can use the Module to transform a ProcessWire Page or PageArray – even RepeaterMatrixPageArrays – into an array or JSON. Queries c...
- 24 replies
-
- 29
-
-
-
I'm working on a newsletter solution with WireMailSMTP and this Newsletter Tutorial. I only changed the lines 73 to 83 in newsletter.php, but there's a strange issue with the $subscribers array: $testMode = isset($_POST['test_email']) ? true : false; if ($testMode) { $subscribe...
- 1 reply
-
- wiremailsmtp
- newsletter
-
(and 1 more)
Tagged with:
-
Hello, I've been struggling for hours with this, and it is driving me crazy. I guess I completely misunderstand basic concepts, but I'm facing a wall here hence this message... Here's what I'm trying to do : I have a list of players in $allPlayers (pages) Each player has (among oth...
-
Another dumb question: Is there a field type for a text-based array? In my case I need to store an array of RSS feeds for SimplePie. Storing that list of links in a textarea - text formatted to look like an array - doesn't work with the script. It works with one link. The images field...
-
While ProcessWire and WireArray does not have support for array_chunk, there is a simple way to achieve this. With array_chunk() you can easily add DIVs to a foreach loop, without having to set up counters when using general PHP (hat-tip to Laurance over at StackOverflow). The idea in a Process...
- 2 replies
-
- 3
-
-
- array_chunk
- chunk
-
(and 2 more)
Tagged with:
-
I believe I have hit a roadblock on this one. I am trying to pass an array to a "cc" in wiremail (using wiremailsmpt to extend). Everything else is working, but I am getting an "invalid email address" for $cc_recipient[0]. I looked in wiremail, and it is checking to see if it is a valid email addres...
-
Hello good people. I was looking today on a header styling that I would like to use in my next project where I want to grab X-amount of posts and place them in a grid with different sizes and layout (hopefully you will understand me better from the layout shown above ). So far I was able to pull an...
-
Hello, I'm trying to build a selector array to work with an OR operator. I need all pages where the datetime field ("date_pub_end") is empty or in the future. In a selector string this could be solved with the following two examples (with and without OR-group) $selector1 = "... ,!date...
-
Hi everyone, I've recently hired at a new company and here I am evaluating the abilities of ProcessWire for our projects. I was able to meet almost every requirement so far, but there is one point I couldn't find an adequate solution for: outputting data to json. I am aware of modules li...
-
Hello processwire community, this is my very first post, I am newbie in php - trying to test a simple search form which allow frontend user to search and filter data. Macro steps are as follow: 1) Create the form with options as checkboxes, allowing the user to choose multiple values selec...
- 21 replies
-
I'm getting this warning when I try to print an array: Warning: array_values() expects parameter 1 to be array, object given... This is my code: $array = $page->get("planos"); print_r(array_values($array)); I've always thought that $page->get will give you an array, but I'm not so s...
- 1 reply
-
- array
- array_values
-
(and 2 more)
Tagged with:
-
<?$work_pages = new PageArray();?> <?$project_1 = $pages->get("parent=/work/projects, limit=1, sort=sort"); $work_pages->add($project_1); // Code for Project 1 goes here $project_2 = $pages->get("parent=/work/projects, id!=$work_pages, limit=1, sort=sort"); $work_pages->add($project_2); // Code fo...
- 2 replies
-
- array
- unpublished
-
(and 2 more)
Tagged with:
-
Im having problems with this little piece of code: $slider = $pages->get("/slider/")->children(); echo $slider(0)->images->first()->url; echo $slider(1)->images->first()->url; echo $slider(2)->images->first()->url; gives me that error: Error: Method name must be a string (line 1641 of /home/...
-
Hi, is there any way of deleting the entire contents of an array from the API? I have had some success removing an item with: $page->image->remove($page->image->first()); But as I have to specify the item within remove() I'm not sure how to remove all the items. Thanks
-
Hi All, I have an images field for multiple images set to always return an array. My images field holds 5 images. I'm trying to get the first image of the array and then remove that to get an array that holds images 2-5. Here's my testing code so far $images = $page->images...
-
I am setting up a new processwire site (kathep.com/cms), and have a problem I can't find a solution to on the forum so far. I would like the footer of one of my templates (course.php), to display a random quote in a specific category, from a collection of quotes. I currently have the quotes stor...
-
Hi folks, I am trying to query (find) pages who have a certain page as a parent, but then filter this result so it only returns the pages listed. I know you can do the following for one: $pages->find('parent=/widgets/')->filter(1020); But how do you do it for many? I thought the below would've w...
-
Hi, I'm trying to combine two find() arrays in a random order but currently can only make it give me back the same order each time. here's what im working with: $works = $pages->find('template=work'); $articles = $pages->find('template=article'); $works->prepend($articles); $randWorks...
-
Hello all, I'm back on my PW site and I'm facing an issue for a couple of hours now and it's driving me crazy... I'm sure it's not that much for a bunch of you, but it looks hopeless to me so here's my problem : I'm sending a form to a page and I have many checkboxes sent, so I used an array. My...
-
I am finishing up my first processwire site (yay), and this last bit is giving me a bit of a headache: For a news slider, I want to output x number of posts, with three posts per slide. (for a theoretically unlimited number of slides) I figure in theory this should work something like the code belo...
-
Not sure how to ask this, but basically I have an associative PHP array outputting a song ID and it's lyrics from PW using this code: It's being stored in the $lyricsArray variable <?php // Loop though album Tracks $numTracksContainingLyrics = 0; // How many contain ly...
-
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...