-
Posts
95 -
Joined
-
Last visited
-
Days Won
1
Everything posted by Alexander
-
Nik, thanks for your clarification. I feel that two deferent templates in one selector is not good idea. I tried another way, but it also return not correct result (without "booked" checking). $pa = $pages->find("template=property, calendar.checkin_1=16.11.2013, fireplace=1"); foreach ($pa as $p) { foreach($p->calendar->find('booked=0') as $r) { $r = $r->getForPage(); $content .= renderItem($r); } } Using the occasion, I want to thank you for great "selector test" module. It's really helpful.
-
$pa = $pages->find("template=property, calendar.checkin_1=16.11.2013, fireplace=1"); foreach ($pa as $p) { foreach($p->calendar->find('booked=0') as $r) { $r = $r->getForPage(); $content .= renderItem($r); } } Hi, I try to use this code to find free week for bookings. (calendar is repeater with dates and checkbox "booked") 1) Find all property with 16.11.2013 in calendar (by repeater). 2) Check that this week is free (checkbox "booked" = 0). But in some reason, I just get property for this dates and checkbox don't work. What I'm doing wrong?
-
$selector = 'template=chalet, fireplace=1'; $allresults = wire('pages')->find($selector); $availability = $allresults->find("template=repeater_calendar, checkin=17.11.2013, booked=0, include=all"); foreach($availability as $item) { $availability = $item->getForPage(); $content .= renderItem($availability); } Hello! I try to find some repeater from another selector, but nothing happens. Find for repeater works fine, but not for $allresults (only for $pages). Can you tell what I'm doing wrong?
-
Thanks a lot, Kongondo. That seems to be right. I'll think twice how to manage it in a deferent way. For example, if I upload "Martin_Johnson_House,_SIO,_La_Jolla_Shores_-_at_sunset_pano.jpg" I get "Martin_Johnson_House,_SIO,_La_Jolla_Shores_-_at_sunset_pano.640x480.jpg" and I would like to get "rndmname.640x480.jpg"
-
Hello, I'm trying to change all upload image files names for the random names. So I put in Pageimage.php this lines: $rand = substr(md5(microtime()),rand(0,26),5); $basename = basename($rand, "." . $this->ext()); // i.e. myfile But as a results I got a lot of random filenames during each page loading. Please advise what do I miss? Thanks, AP
-
Trouble with install (Rackspace Cloudsites)
Alexander replied to adamspruijt's topic in General Support
Great thanks, Craig! -
I use it. Maybe I use it in wrong way.
-
Thanks, Teppo. I trying all variants with ->name,->title but nothing works in my case. And what the difference between only one selection and multiple pages? Where I can check this option?
-
Hi again, I have another dummy question about Select field use. I made the field "boardbasis" with select options: 1:=Breakfast 2:=Catered 3:=Self-catered In template I use $page->boardbasis to extract result from "boardbasis" Select field. As a result I get on page "1 or 2 or 3" (just pointed numbers). What should I do achieve as a result "Breakfast or Catered"? Thanks a lot for your assistant. Have a great weekend, a.
-
Great, works perfect! Thanks Ryan! Better with title name. if($prev) echo "<a href='$prev->url'>$prev->title</a> "; if($next) echo "<a href='$next->url'>$next->title</a> ";
-
Luis, maybe I'm wrong, but this solution does not support sorting of search result. Anyway, thanks!
-
Thanks Mats and Luis for your help and time. I trying to use $page->next, but in my case it returns only numbers. I findet in blog demo this code and it's work perfect. function renderNextPrevPosts($page) { $bedroom = $page->getUnformatted('bedroom'); $nextPost = $page->parent->child("bedroom>$bedroom, sort=bedroom"); $prevPost = $page->parent->child("bedroom<$bedroom, sort=-bedroom"); $out = "<div class='next-prev-posts'>"; if($prevPost->id > 0) $out .= "<p class='prev-post'><span><</span> <a href='{$prevPost->url}'>{$prevPost->title}</a></p>"; if($nextPost->id > 0) $out .= "<p class='next-post'><a href='{$nextPost->url}'>{$nextPost->title}</a> <span>></span></p>"; $out .= "</div>"; return $out; }
-
Supergut. Vielen dank, Luis!
-
I think, it used only for search result pagination. But I'm interested in between pages navigation. Ex. <- Previous post | Next post->
-
It would be nice to get something like this http://codex.wordpress.org/Next_and_Previous_Links
-
<select id='country' data-placeholder="Country" placeholder="Country" name='country'> <option value=''></option> <?php $selOptionsArray = preg_split('/\n/', $fields->country->select_options); foreach ($selOptionsArray as $country) { $parts = preg_split('/:=/', $country); $selected = $parts[0] == $input->whitelist->country ? " selected='selected' " : ''; echo "<option$selected value=\"{$parts[0]}\">{$parts[0]}</option>"; } ?> </select> Great thanks to everybody for your help! So, I'm just trying to make search "select" from select (AKA drop down) module. It's not so easy (:
- 5 replies
-
- search form
- select
-
(and 1 more)
Tagged with:
-
Sorry for this dummy question, I'm newbie for processwire. I try to make new field for search form from "drop down module" but nothing happens. Take a look: <select id='country' data-placeholder="Country" placeholder="Country" name='country'> <option value=''></option><?php foreach($country as $count){ $selected = $count == $input->whitelist->country ? " selected='selected' " : ''; echo "<option value='$count'>$count</option>";} ?> </select> What am I doing wrong? Cheers, a.
- 5 replies
-
- search form
- select
-
(and 1 more)
Tagged with: