Jump to content
a-ok

Selector for repeater rows type

Recommended Posts

I'm looking to return repeater matrix rows (pages) where the type is equal to testimonial

$testimonials = $event->pages->find("template=repeater_modules, modules.type=testimonial, include=all");

This seems to return all repeater pages and simply ignores the `modules.type=testimonial` selector. Have I got this wrong?

If I barDump out `$testimonials->explode('type')`, one of the entries returned is "testimonial" so I'm a bit confused.

Share this post


Link to post
Share on other sites

I ended up just doing

foreach ($testimonials as $t) {
	if ($t->type == "testimonial") {
		$t->title = $t->getForPage()->title . ' — ' . $event->sanitizer->truncate($t->global_textarea, 40);
		$testimonialsNew->add($t);
	}
}

Which seemed to work fine but I would've though I could've queried by the repeater matrix type within the selector... but maybe not?

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...