-
Posts
364 -
Joined
Everything posted by hellomoto
-
I read a post somewhere before when I was trying to find out about this, where the guy was creating corresponding like frontend profile pages, separate from the users themselves, to store additional profile data. I know this is totally a possibility, or a number of other ways, I guess. PW, endless possibilities. But I thought I would just do it directly. I suppose I might as well take that same route though, for the same reason: not to corrupt the native user template/variable... I mean it is slightly more time consuming, but in the long run if this is going to happen it'll actually save me a ton of time. I am curious about the answer to this question but... I could just try another way. I guess I'll go look for that thread again and see what's good, how he does it...
-
Hey thanks for the welcome. I have definitely read through much of the documentation, forums, Google searched extensively, and tried and inspected (not that extensively but somewhat) several of the site profiles already, and yes I understand the PW structural fundamentals. I have a lot going on in this site already. I put off adding this field because that's when it happened last time, and I had to put it all back together, and then some, and now I added this field again and again I have this issue and nowhere in the documentation that I have seen does it say anything about this not being ok to do. So... this is just a freak incident it seems (except for that this is the second time, so.. 2x freaky, but I still have no answers), and I am hoping that since there doesn't seem to be anything in the documentation about this error, or anywhere in the forums, and no additional information other than the profile not saving is provided, that maybe somebody in these great forums might be able to help. Hence, this, and my last post about this. I looked at ProcessProfile.module and don't see any reason the profile wouldn't be saving. It's just an unexplained error. Like, I simply did this, nothing should be wrong with it, if something is, and I'm not doing this right, please do tell: I have /about/locations/ with children location pages. These are public, with frontend templates... if it matters... So I then I add a page field to the user template, office_location, with template=location for selector. The thing is, it works. I was able to set locations for all my users with roles=broker. However... that I did by editing the users from my superuser account, and then next thing I know, I check if I can save my profile, and I can't, and neither can I logged in as anyone else. So if page fields can be used in user templates, and this is in fact a commonly done thing, why is this happening to me, what about that is wrong that I did? Why does this break the profiles? Seems crazy to me, but there must be something I'm missing here, I just wish I knew what.
-
How to install an exported site profile?
hellomoto replied to hellomoto's topic in Themes and Profiles
I just ended up installing my exported site profile this time around and luckily it worked perfectly anyway. That wasn't too long ago, I'm ok to continue from here. -
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.