Jump to content

Jamie Gordon

Members
  • Posts

    14
  • Joined

  • Last visited

About Jamie Gordon

  • Birthday 01/09/1991

Contact Methods

  • Website URL
    http://www.jamiedotcom.com

Profile Information

  • Gender
    Male
  • Location
    Belfast
  • Interests
    Sporting & social fanatic

Recent Profile Visitors

2,550 profile views

Jamie Gordon's Achievements

Jr. Member

Jr. Member (3/6)

1

Reputation

  1. I can access the default home page fine (see screenshot), I've only changed the admin URL during the install process from /processwire to /admin.
  2. I thought that at first too, apparently not though. I've tried running it with, and without those lines commented. Neither work unfortunately
  3. Hi guys, having a bit of a strange issue here - I've installed at least a dozen copies of process wire for various websites firstly on my localhost using MAMP and later transferring it to a server. I'm trying to install a fresh copy to my localhost, I go through the install process and get the success message as usual (see screenshot) but whenever I try to access /admin/ - it cannot be found. Any ideas?
  4. That works perfectly Wanze thank you for the help, I really appreciate it! My value for 'portugal' was being sent correctly so that I got it in my URL, I wasn't using the implementation of $input->whitelist correctly to store it. Again thank you for all your help
  5. Home page - search form <form action="<?php echo $pages->get(1042)->url; ?>" method="get" name="search_form" class="search_form"> <input type="hidden" name="mysearchlocation"> A one week trip <div id="search_country" class="dropdown_wrapper"> <div class="dropdown"> <ul> <li><a class="flag prt" onclick="document.search_form.mysearchlocation.value='portugal'; return false;" href="#">Portugal</a></li> </ul> </div> </div> <button type="submit" id="search_btn_reg" class="btn btn_search float_right">Search<span class="icon"> ></span></button> </form> and then this is the code for my search results page <?php $country = $sanitizer->selectorValue($input->get->mysearchlocation); $input->whitelist('country', $country); ?> <?php if ($input->get->mysearchlocation) { $input->whitelist($test, $country); // Do your search and render the pager $country = $pages->find("template=hotel, hotel_country=$country, limit=3"); $pagination = $country->renderPager(); foreach($country as $resort) { echo "<li class='result-item star$resort->star_rating'>"; $firstimage = $resort->images->first(); echo "<img src='$firstimage->url'>"; echo "<div class='result_panel'><a>"; if ($resort->favourite) { echo "<h2 class='flagged'>$resort->hotel_name</h2><p>"; } else { echo "<h2>$resort->hotel_name</h2><p>"; } //get area & country name $parents = $resort->parents->slice(2); foreach($parents as $parent) { echo "<a href='$parent->url'>$parent->title</a>,"; } echo "</p></a>"; echo "<img class='star_rating' src='../img/icons/stars_$resort->star_rating.png' >"; echo $resort->hotel_facilities; echo "</div>"; echo "<a class='btn more_info_btn' href='$resort->url'>More info<span class='icon'> ></span></a>"; echo "</li>"; } } echo $pagination; ?> I understand that I am doing something wrong to hold the variable when it loads the next pagination page, just not sure what that is.
  6. Yep, I changed the opening tags on my form to <form action="<?php echo $pages->get(1042)->url; ?>" method="get" name="search_form" class="search_form"> but the value doesn't seem to be held when I load the second paginated page. This is so bizzare!
  7. I still don't seem to be getting any further, even with the help of your suggestions now First off, the $input->get->mysearchlocation method doesn't not work at all to display the selected country, it just returns an empty value which is strange, using $input->post seems to work fine. I have ammended my code to look like this - <?php $userselection = $sanitizer->selectorValue($input->get->mysearchlocation); $session->country = $userselection; if($session->country) { $country = $pages->find("template=hotel, hotel_country=$country, limit=3"); $pagination = $country->renderPager(); foreach($country as $resort) { echo "<li class='result-item star$resort->star_rating'>"; $firstimage = $resort->images->first(); echo "<img src='$firstimage->url'>"; echo "<div class='result_panel'><a>"; if ($resort->favourite) { echo "<h2 class='flagged'>$resort->hotel_name</h2><p>"; } else { echo "<h2>$resort->hotel_name</h2><p>"; } //get area & country name $parents = $resort->parents->slice(2); foreach($parents as $parent) { echo "<a href='$parent->url'>$parent->title</a>,"; } echo "</p></a>"; echo "<img class='star_rating' src='../img/icons/stars_$resort->star_rating.png' >"; echo $resort->hotel_facilities; echo "</div>"; echo "<a class='btn more_info_btn' href='$resort->url'>More info<span class='icon'> ></span></a>"; echo "</li>"; } echo $pagination; } else { echo "the value has not been found"; } ?> This displays the first three results fine and the pagination bar shows up with multiple pages, however when I click one of these pages it returns a page with empty results, because the $session value for some reason has not been stored correctly, so it has nothing to load. I have also tried Wanze's method, that again brought up empty results for the second page. Any ideas?
  8. I knew there was a reason why I loved you guys! Apologies about the code formatting, strangely it only jumps out of shape when I have pasted it into here, odd. Anyway I'll give your suggestion a go!
  9. Hi guys, having a small issue and I know how helpful you lot can be so I thought I would chance my arm again! I have a search form on my home page in which the user selects a country and the hotels from that country are displayed on the search page. This is my code: <?php if( isset($_POST['mysearchlocation']) ) { $country = $pages->find("template=hotel, hotel_country=$country, limit=3"); $pagination = $country->renderPager(); foreach($country as $resort) { echo "<li class='result-item star$resort->star_rating'>"; $firstimage = $resort->images->first(); echo "<img src='$firstimage->url'>"; echo "<div class='result_panel'><a>"; if ($resort->favourite) { echo "<h2 class='flagged'>$resort->hotel_name</h2><p>"; } else { echo "<h2>$resort->hotel_name</h2><p>"; } //get area & country name $parents = $resort->parents->slice(2); foreach($parents as $parent) { echo "<a href='$parent->url'>$parent->title</a>,"; } echo "</p></a>"; echo "<img class='star_rating' src='../img/icons/stars_$resort->star_rating.png' >"; echo $resort->hotel_facilities; echo "</div>"; echo "<a class='btn more_info_btn' href='$resort->url'>More info<span class='icon'> ></span></a>"; echo "</li>"; } } echo $pagination; ?> the issue that I am having is that when I select the next page of results, for example page 2, my post variable is obviously lost. Has anyone any ideas on how to work around this because I'm drawing a blank at the moment! Any help would be greatly appreciated, Jamie
  10. Correct, it's a custom field. Thank you again for the most helpful advice!
  11. I was able to solve the problem last night. Basically I wanted the current page to look through a sibling page with a specifc template and search for a field that matched the current page's name. I was able to use this piece of code, for future reference $found = $page->siblings("template=course,hotels_served%=$page->hotel_name");
  12. Wow, I didn't expect this kind of reponse or support! You guys are amazing! Soma your advice worked perfectly, but thank you all for trying to help. Another quick question related to this, since I can search for a specific piece of text, would it be possible to search for one of the current pages field names? For example - $found = $page->siblings("template=course,hotels_served*=$page->my_name"); Obviously this piece of code doesn't work, but is that something similar?
  13. Hi guys! I've only recently started using PW but I'm finding it a great tool in content managing my websites. Just a quick question. I have created a series of pages in categories. These sibling pages use different templates, is there a way to check if a sibling page uses a particular template and if so also check a textarea field for a particular piece of text so that I can display it? Any help would be greatly appreciated. Jamie
×
×
  • Create New...