-
Posts
159 -
Joined
-
Last visited
Everything posted by Jon
-
Hey guys thanks for the input. I went with the option from Robin just reading up on URL segments now as that looks like a even better option. Cheers Jon
-
Hello All, I am just wondering what is the best way to get a specific row of a repeater. I have a list of courses stored in a repeater. On my parent page i will list all the courses/dates and when. What I planned on doing was getting the ID of the row in a GET and then showing the content of the repeater row on the booking page. Can this be done without using a foreach? Cheers Jon
-
I've changed my code to use ===NULL I can now save 0 but if cruise_spaces is NULL the fields arent getting set. The full code I am using is below if that help. Ive use !==NULL to test the section of code that sets the spaces and that works fine $this->pages->addHookAfter('saveReady', null, 'cruiseSpaces'); function cruiseSpaces($event) { $page = $event->arguments[0]; if($page->cruise_spaces === NULL) { if($page->vessels->id == 1039) { $page->cruise_spaces = 12; $page->cruise_single = 2; }else if ($page->vessels->id == 1041 || $page->vessels->id == 1042) { $page->cruise_spaces = 11; $page->cruise_single = 2; }} }
-
Thanks Sinnut, I already have that tick but empty and "0" are being treat the same any other ideas? Cheers Jon
-
Hello All, I have a integer field for a number of spaces. In ready PHP. Iam looking to check the spaces field and if its NULL (empty) set the value and if it not empty just leave it. However when the spaces get to 0 this is setting my field back to the default number of spaces. Ive tried isset() empty() but seem to be getting the same result. Any ideas how to solve this? The code I am using is below. if($page->vessels->id == 1039 && !$page->cruise_spaces) { $page->cruise_spaces = 12; $page->cruise_single = 2; } Cheers Jon
-
Hello guys thanks for the response, I did reply to this yesterday but must have forgot to post it doh! I managed to get the site working after following pwired advice and replacing the site directory, debug worked. Which showed a problem with the AssistedURL field type module. So I updated that and seemed to work. Which was a bit of odd one as the site worked when I tested it on another server and domain. Maybe something server related. SteveB iam using php5.5 The site is http://redmooncruises.co.uk if anyone's interested. Still got a few things to tidy up. Cheers Jon
-
Hello all, I seem to be having trouble moving a site to new hosting / domain. Just getting a 500 internal error. I have tried the following. 1. Commenting out .he access lines. 2. Installed the site onto another domain and different hosting with worked fine. 3. Install a new copy of pw onto the domain and hosting in question which worked. Iam not really getting any other error massages to just wondering if anyone has had something similar. Iam using processwire3
-
Hello, Iam just wondering is this would be the right away to go about this. So I have a order form on my site which will store my order as a $session before transferring away to my payment gateway (WorldPay). I'll be passing the order number from the $session within payment. Once the payment has been processed/cancel/declined the user will be redirected back to a confirmation page which will display the relevant information and if the order is process ill be using the $session data to generate a order (page) Iam just wondering if that's a ok use of $session? Cheers Jon
-
Thanks both works great now. Such a useful module!
-
Hello, How do you add "InputfieldPageListSelect.min.js" to the module to fix the 0 issue with the link field? Ive tried hooking into the "InputfieldPageListSelect::render" but couldnt get it to work.
-
Button on dashboard that creates new page with a specific template
Jon replied to Jon's topic in API & Templates
That's prefect Jan exactly what I was trying to achieve! Many thanks Jon -
Button on dashboard that creates new page with a specific template
Jon replied to Jon's topic in API & Templates
Hello Mr Fan, That is similar to the code I've used, But doesn't set the template. Basically what I have is a parent "Reviews" which can have 3 different Child templates. When dashboard button is press I would like to set a specific template or even if I could set a default template but still have the option of selecting the 2 other templates. What happens at the minute is the last template used if remembered. Cheers Jon -
Moved site from WAMP to test server and now getting Error
Jon replied to Jon's topic in General Support
Hello Guys, Thanks for the responses. Turned out to be that my SQL import was only importing half the tables managed to get it sorted. Thanks for your help again! Cheers Jon -
Hello Guys, Ive just moved a site over to a test server but I am now getting the following error. Any ideas? Error: Exception: Field does not exist: top_nav (in /home/clearbox/public_html/clients/ml/wire/core/PageFinder.php line 538) #0 [internal function]: PageFinder->___getQuery(Object(Selectors), Array) #1 /home/clearbox/public_html/clients/ml/wire/core/Wire.php(398): call_user_func_array(Array, Array) #2 /home/clearbox/public_html/clients/ml/wire/core/Wire.php(333): Wire->runHooks('getQuery', Array) #3 /home/clearbox/public_html/clients/ml/wire/core/PageFinder.php(280): Wire->__call('getQuery', Array) #4 /home/clearbox/public_html/clients/ml/wire/core/PageFinder.php(280): PageFinder->getQuery(Object(Selectors), Array) #5 [internal function]: PageFinder->___find(Object(Selectors), Array) #6 /home/clearbox/public_html/clients/ml/wire/core/Wire.php(398): call_user_func_array(Array, Array) #7 /home/clearbox/public_html/clients/ml/wire/core/Wire.php(333): Wire->runHooks('find', Array) #8 /home/clearbox/public_html/clients/ml/wire/core/Pages.php(216): Wire->__call('find', Array) #9 /home/clearbox/public_html/clients/ml/wire
-
Just wondering how you would go about changing the icon for custom admin pages?
-
Thank you guys, used the following $this->pages->addHookAfter('saveReady', null, 'order_number'); function order_number($event) { $page = $event->arguments[0]; if($page->template != 'booking') return; if(!isset($page->booking_orderno)) { $max = wire('pages')->get("template=booking, sort=-id"); $lastNumber = $max->booking_orderno +1; $page->booking_orderno = $lastNumber; } }
-
Hello Macrura, Thanks for that. I seem to be having a problem getting the highest number. I thought about using ->last() to get the last page ID for the template which would be the last order in theory. But for some reasons I cant pick it up in ready.php worked within a page template. The code I using is $this->pages->addHookAfter('saveReady', null, 'order_number'); function order_number($event) { $page = $event->arguments[0]; if($page->template != 'booking') return; if(!isset($page->booking_orderno)) { $max = $wire->pages->find("template=booking")->last(); $page->booking_orderno = $max + 1; } }
-
Hello, I am wondering what would be the best way to generate a consecutive order number. I have template "order" which I would like a number for. My thoughts would be to retrieve the last order number on page save. Would that be the best solution?
-
Ah Thank you very much! Iam such a PHP newbie!
-
Hello, I seem to have having a problem the save hook. I would like to field value based another field during the save process. But my values are not updating 13 seems to be enter no matter what and $vessels doesn't save updates. The code I am using is the following. <?php $this->pages->addHookAfter('saveReady', null, 'cruiseSpaces'); function cruiseSpaces($event) { $page = $event->arguments[0]; if($page->template != 'cruise-dates') return; $vessel = $page->cruise_vessel; if($vessel = 2) { $page->set("cruise_spaces", 13); }else{ $page->set("cruise_spaces", 10); } } Any ideas where Iam going wrong?
-
Thats prefect! Exactly what I am looking! Many thanks for the module Cheers Jon
-
I'am looking to show hidden field data at the top of a admin pages like the attached image. Would I be right in thinking this would be done with a hook or would I be better off creating a Custom Admin Template for this? Basically I only want this to appear on 1 template type. Ive tried hooking in using the HelloWorld.module but cant seem to figure it out
-
Thanks Adrian! Such a simple solution! Ill just delete that css display:none I added
-
Hello Great Module, Just wondering if its possible to not show to show a dashboard in the I have 2. The first one links into the other but I dont want people going to the second one without clicking the link in the first.