hellomoto
Members-
Posts
386 -
Joined
Everything posted by hellomoto
-
How to install an exported site profile?
hellomoto replied to hellomoto's topic in Themes and Profiles
You mean this? https://github.com/adrianbj/ProcessMigrator Looks quite promising. Do you know if it's compatible with 2.5? I guess I'll give it a try. Couldn't hurt at this point. I hope my install isn't already screwed even if it's exported... oy... I'll see... and report back. Thanks. -
I have one I want to install. I copied the index.php and /wire directory to a fresh site directory and added in its /site put all the files from my exported site profile. When I access the site it says "404 page not found (no site configuration or install.php available)". How am I supposed to install this?
-
I would think relating users to other pages would be a fairly common requirement too, so... if it is that... 1. why won't it work when I remove the field, and 2. why would it even break my user profile saving capability in the first place? How can fix this? I don't want to start over again.
-
I posted about this before and nobody had any input. I started again from scratch on account of this mysterious problem, and I cannot figure out how to even troubleshoot it. I really don't want to have to start it ALL over again; that'd make 3 different copies going of the same project. No particular errors are given, just that it won't save. It does seem like both times this happened after adding a page field to the user template, relating the user to an office location. If I remove the field, I am still unable to save profiles. When this first happened I removed all the custom fields from the user template and disabled every module one by one. Never again could I save profiles.
-
I'm trying to send an email notification for each inquiry submitted. Currently they're just saved as pages. I want to email notify too. So I have (mail part is at the bottom): // check if the form was submitted if($input->post->submit) { // determine if any fields were ommitted or didn't validate foreach($required_fields as $key => $value) { if( trim($value) == '' ) { $error_message = "<p class='error'>Please check that you have completed all the required fields.</p>"; $error = true; } } // if no errors, create a new page if(!$error) { $p = new Page(); // create new page object $p->template = 'vessel_inquiry'; // set template $p->parent = wire('pages')->get('/sales/inquiries/'); // set the parent $p->name = $input->post->vessel_id . '_' . date('YmdHisu') . '_' . $input->post->user_id; $p->title = $input->post->title; // set page title (not neccessary but recommended) $p->save(); //create the page // populate fields $p->message = $input->post->message; if($user->isLoggedin()) { $p->user = $input->post->user_id; } else { $p->fullname = $input->post->fullname; $p->email = $input->post->email; } $p->vessel_id = $input->post->vessel_id; $p->status = $p->status | Page::statusLocked; $p->save(); //save the populated fields $success = true; $mail = new WireMail(); // chained method call usage $mail->to('my@email.com')->from('some@email.com')->subject('Message Subject')->body('Message Body')->send(); } This is just to test email sending period. (The to and from emails are actually different ones that I have access to.) I've tried several times to submit inquiries and am not getting anything in spam or anywhere. I'm using XAMPP on OS X. I know email is complicated and not exactly a ProcessWire matter but do you guys know how I might be able to troubleshoot or resolve this? Surely others here have experience using wireMail() on similar setups... Thanks much.
-
$page->set($fieldName->address, $value); does not seem to work.
-
I have a model field that depends on the selected manufacturer. Its options update upon manufacturer selection (both are page select fields). In my model field > Input tab > Selectable Pages > Custom selector, I have: parent=page.make, template=model, sort=title, include=all Where 'make' is the name of my manufacturer field. Try that?
-
This works for me to support page references in Ryan's ImportPagesCSV.module, in function importPageValue: elseif($field->type instanceof FieldtypePage) { $value = trim($value); if(wire("pages")->find("$name=$value")) $page->set($name, $value); } I need to also be able to import repeater fields though.. Anyone know how to do that?
-
Can't echo out page title (="$") on frontend
hellomoto replied to hellomoto's topic in General Support
Thanks, apeisa. ->title is what I tried first... but, I never tried ->first()! Of course! That's what it was all along. That I should have known... at least... Thanks a mil! -
Can't echo out page title (="$") on frontend
hellomoto replied to hellomoto's topic in General Support
It's the pages themselves or the field. I changed their titles to their names and still can't get them. Couldn't get the names anyway. -
Can't echo out page title (="$") on frontend
hellomoto replied to hellomoto's topic in General Support
Yeah that's what I was going to do. I will. But why is that happening? I just tested another template type I have, renamed the title to '$' (sans quotes) and it appeared on the frontend... -
I have a price_currency field that references child pages of a page Currency. Its names are three-letter currency codes, and the titles are symbols: $, euro and pound. I tried inputting both $ and $ as the title instead for $ to see if it would echo; it's not. How can I get these values to appear? $item->price_currency outputs the ID, but $item->price_currency->name doesn't even work either...
-
public function init() { // add a hook after each page is saved $this->pages->addHookAfter('saved', $this, 'populateDefaults'); } /** * Populates model defaults after save for corresponding blank fields. * */ public function populateDefaults($event) { $page = $event->arguments('page'); if($page->template != 'vessel') return; //$this->message("hi {$page->model->hulls}"); if($page->model && !$page->hulls && $page->model->hulls) { $page->set("hulls", $page->model->hulls); $this->message("hi $page->hulls {$page->model->hulls}"); } } This sort of works; the message echoed is "hi 1082 1082". When I set the hulls to null in the above code, it then goes back to "hi 1082". However, it doesn't update the select input in the edit screen, and the "Missing required value" error for that field remains... Also the message shouldn't even be showing if $page->hulls is set... How can I get it to update the field value and the input?
-
I have a page field 'make', which consists of manufacturer template pages. A new page can be created from that field, but I currently have that functionality disabled, since following that field is another page field 'model' with a custom selector, 'parent=page.make, template=model'. So since the model field parent is dynamic, new pages cannot be created from the field, as the first requirement for that feature is that a single parent and template be pre-selected... Is there some way I can hook into the options there and add an 'Add New' option at the bottom, opening up the new model in a modal? Thanks.
-
Questions regarding the making of a simple a viewtracker module
hellomoto replied to hellomoto's topic in General Support
How can I access the input variable from within this function? I want to add URL segments to the records. I tried adding: // record if segment $event->return = str_replace("</body>", "<p>Hello {$this->input->urlSegment1} World!</p></body>", $event->return); } also tried $page->input->urlSegment1 and $input->urlSegment1. Update: never mind, just had to make it $this->input->urlSegment(1) (in parentheses). -
I want to make a little module that tracks pageviews. This is my first module. I'm starting with a copy of helloworld.module. I already created the template pageviews and pageview manually, but I'll add their creation into the module later. Here's what I have: public function viewTracker($event) { $page = $event->object; // don't add this to the admin pages if($page->template == 'admin') return; if($page->template == 'vessel') { $r = new Page(); $r->template = 'pageview'; $r->parent = wire('pages')->get('/viewtracker/'); $r->user = $user->name; $r->vessel_id = $page->id; $r->name = $user->id . $page->id . date('YmdHisu'); //$r->status = $r->status | Page::statusLocked; $r->save(); } // add a "Hello World" paragraph right before the closing body tag $event->return = str_replace("</body>", "<p>Hello $user World!</p></body>", $event->return); } but the $user variable isn't coming through. How can I access the logged in $user? Edit: Got it. Replaced the $user with $this->user..... public function viewTracker($event) { $page = $event->object; // don't add this to the admin pages if($page->template == 'admin') return; if($page->template == 'vessel') { $r = new Page(); $r->template = 'pageview'; $r->parent = wire('pages')->get('/viewtracker/'); $r->user = $this->user; $r->vessel_id = $page; $r->name = $this->user . $page . date('YmdHisu'); $r->status = $r->status | Page::statusHidden; $r->save(); } }
-
I just installed a fresh copy of PW 2.5.3 and the admin looks different now than it did even when I installed it. The font is slightly larger, and there is a new link alongside every page in the Page List, together with the "edit", "view", "new", and "move": "edit template"? Also the additional info in the Page List is formatted funky: , [model.title: L380 | model_year: 2006 | listing_status.title: For Sale] Anyone know why this might be...
-
ProcessAdminCustomPages works wonders.
-
Sounds like a job for ProcessPreview?
-
I can't get this to work for the life of me. I've tried literally everything, everyone's snippets. I'm on localhost, PW 2.5.3. The closest I managed to get is a shot of the whole world, or a relative close-up of the correct location, without the ability to drag and see anything around it, and sans marker.
-
Please help: Can't save profiles ("Profile not saved")
hellomoto replied to hellomoto's topic in General Support
So I added the office field back to the user template, since that's not the culprit. However I can't even edit that from the user edit screen, don't know why. I can edit the phone number and full name fields I added. Not this page field though. Doesn't show. Shows in my own uneditable profile edit screen (changed the selector to !=37 which is guest so the field is visible for all internal users) (also shows in the broker's uneditable profile edit screen; I have them both up side by side). I need to be able to edit profiles via profile screen and also need to be able to edit users' "office" value as superadmin or user admin...