Jump to content

Combine ^= and %= to find multiple values in a text field


suntrop
 Share

Recommended Posts

I need to find a page with two parameters which are contained within a text field. It is kind of a list of technical parameters. 

Content of a field looks like:

2 mm
80x110 cm
1310 g
white

or 

1,5 mm
50x90 cm
1210 g
black

Mostly I am looking for the first two rows. I thought this one should work, but i doesn't:

$result =  $page->child('attributes^="2 mm", attributes%="80x110 cm"');

Both operators (^= and %=) work on its own, but not combined. Is this not translated to find the child page, that has "2 mm" on the beginning of the attributes field and also has "80x110 cm" in the attributes field?

Link to comment
Share on other sites

Thanks. Now it works here too. Don’t know what was wrong. I tested all sorts of combinations.

Had it going in two steps, first finding all pages with the first param, and then finding amongst them the page with the second parameter. But with one selector it is much better

Anyhow, thank you for testing. 

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...