bwakad Posted April 19, 2014 Posted April 19, 2014 With a page select it's possible to just put ->url behind the field name and place it inside a link. But the rangeslider is different... I can't simply use the following code to get pages that have the uren.min>={$page->uren->min} How to do this? <a href=' <?php $pages->find("template=child-template, uren.min>={$page->uren->min}, limit=50, sort=-created");?>'> <?php echo $page->uren->min;?> </a>
Macrura Posted April 19, 2014 Posted April 19, 2014 wow, I've read your post 2x and i still have no idea what you are asking. i don't know what the word uren means. but your $pages->find looks basically correct, that would result in a page array, since you are using find. after that i have no idea what you want to do, but you will need to foreach the results.
bwakad Posted April 19, 2014 Author Posted April 19, 2014 The thing is, after a foreach I have a list of items with field values including the 'uren' - which means hours - and I would like this value to be a link to get results (again). With a page list select you can simply do this: <a href="<?php echo $child->contract->url;?>"><?php echo $child->contract->title;?></a> I click on that link and I get results back...
Pete Posted April 21, 2014 Posted April 21, 2014 If they're hours as in 24 hours in a day, could you not just do something like this: for ($i=0; $i <=23; $i++) { // Regular PHP - see http://www.php.net/manual/en/control-structures.for.php echo '<a href="' . $page->url . $i . '/">' . $i . '</a>'; // which will output as <a href='/your-page/4/'>4</a> - well, it will output 0 - 23 in this way so you'll have 24 hourly links for example } Not quite sure what you mean by "link" in this case, but you could use something like the above with a selector that uses the urlsegment and searches for pages with 4 in the rangeslider field - see this example adapted from the rangeslider instructions for the selector if you wanted to match any page with a range that encompassed "4": $pages->find("range.min<=4, range.max>=4"); // So if minimum is less than or equal to 4 and maximum is greater than or equal to 4, get those pages. You'll probably want to specify a template as well but you get the idea 1
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now