Jump to content


  • Posts

  • Joined

  • Last visited

Everything posted by bramwolf

  1. Hi Guys, I got the request to copy a site I created in processwire, which shouldn't be too much of a problem, but also to have to content ( Pages, templates and field contents ) loaded from the original site so that they stay in synch. With site one dictating the content on the second. How would I go about realizing that? would I be stuck with continuously importing data from site 1 via cvs export/import or XML feed, or could I link my second site to the database of the first? Also I would like to make small changes in the template of of the second site. For instance Site one hosts a Hotel listing, with price € 300, and on the second Site I would like to change it to "Price on request" with an email link. Could I adjust template files on the hosting of site 2 and still load data from site 1? Hope somebody can help :) Thanks guys!
  2. Hi, I used these emails to send mails to the administrator of the site. So I wanted to send from example.com to info@example.com this just worked. But I was testen from example.com to info@bramwolf.nl, which was outside the domain and thus didn't work. Easiest way to check if the emails will arrive at the admin is to send a test email and ask for a confirmation from the admin email account holder. Good luck
  3. Hey Guys, One of my clients asked me to look at the options for a very complex website, what to use and how to do it. And to be honest i've been thrown in at the deep end a little bit. There is so much software out there and it's kinda hard to try everything out especially in combination with each other, so I thought I would ask if anyone had any experience with such a website and the tools needed to get it up and running. I think the things I'm tryin to achieve are to complex to build solely in ProcessWire since it needs alot of complex modules, but I would love your take in this This is a list of things I would like to achieve within the website: - For one, the website will need dynamic content: news articles, company listings, company profiles, Job application listings ( doesn't have to be a full recruitement module per se ) - Memberships. Two types of memberships, a paid subscription for advertisers/companies that will be listed. And a free membership for visitors with personal interests, interests logging and preferences. - Advertising platform. My clients wants to sell subscriptions to advertisers though a webshop, and place them on the site and place banners on the site for them according to fixed paid-for agreements ( ex. 30.000 presentations of the banner over a period of 2 months ). Here we'll also need to track click throughs and be able to supply documentation about displays and performance of the banners. For this I was thinking about Google's Doubleclick although I haven't found it what it costs on their website. - Marketing automation. My client is looking for a platform that handles marketing automation for the free subscribed members. We would like to be able to segments the users, and target them according to interests, and naturally follow up and our offers. It would make sense to be able to use the same platform for holding the user data, as not to have a client system in our CMS and have a seperate one in our Marketing Automation software. First I was looking for one system to do all of this, but I think it next to impossible to achieve that. So now I'm thinking a good and expandable base CMS with good integration options for 3th party platforms and modules. My goal is not to create all these modules myself considering the complexity of just one of them, but to create a nicely integrated system which covers all attributes using as much pre-exisiting systems as possible for fast delivery and having fully tested and functional systems. Have any of you ever built such a site, or have any ideas what kinds of CMS or platforms you would use to achieve it? I would love to hear your ideas! Thanks in advance, Bram Wolf
  4. Thanks Robin! That did the trick perfectly! I'm adding this to my FormBuilder Readme file, and I think stuff like this should be included in it by standard. Most people say this isn't even possible, now it turns out it is, it would be nice if a hunt for this kind of syntax wouldn't take 2 hours. Thanx again Bram
  5. Any idea how I would go about doing that? Sorry im still pretty nood at PHP, thanks for the help
  6. Thanks LostKobrakai! But sadly to no avail: this: foreach($forms->get("reserveren")->entries->find("id>0")->sort($entry['datum']) as $res){ Return this: Error: Call to a member function sort() on array (line 210 of /public/sites/www.cafepool.nl/site/templates/agenda.php) This error message was shown because you are logged in as a Superuser. Error has been logged. Gr, Bram
  7. Hey Guys, I'm trying to sort the foreach results from FormBuilder but I can't seem to sort it by a field, only by created. How would you go about doing so? This works: foreach($forms->get("reserveren")->entries->find("sort=created") as $res) This is what I need but it doesn''t work: foreach($forms->get("reserveren")->entries->find("sort={$entry['datum']}") as $res) Thanks guys!
  8. Yes! SOLVED This is what I was looking for, quite obvious! But thanks alot // update password field attributes in a login or registration form $passwordField = $fu->form->get("password"); $passwordField->label = "New password label"; $passwordField->description = "Password description";
  9. hi pwFoo, thanks for your reply. I have indeed executed the register en login forms, and they work perfectly fine, the only problem I have is that I don't know which field to target to be able to change the password description text. Would you happen to know which one that is? Thanks Bram
  10. Hi Guys, I've been trying to translate the registration form to dutch and I've managed to do so with Username and Password. But I don't know which field to call for the password description field. Does anybody know which field to point to to change this? "Password must be at least 6 characters and have at least 1 letter and 1 digit. Password may not have whitespace." $usernameField = $fu->form->get("username"); $usernameField->label = "Gebruikersnaam"; $passwordField = $fu->form->get("password"); $passwordField->label = "Wachtwoord"; Thanks! Bram
  11. Hi Ian, Thanks for the offer, but I think we have second point figured out as well, I will post updates on a solution when I finalized it. Gr, Bram
  12. Sure thing! I actually already replied Ryans last post with new input but frankly, im on a very very tight lease here and I need this figured out as soon as possible, so I called in all the help I could get. I meant no disrespect or ungratefulness whatsoever. I'll make sure the answer makes it to that post as well Bram
  13. Hi Guys, I think I finally solved this Or at least, I solved it for my case. The problem I had with this was that I used a form which submitted the page to a "www." variant of the page while all other standard pages where rendered without the "www.". By changing this in the config.php file I was able to keep all session variables and cookies (which previously also got dropped) $config->httpHosts = array( 'processwire.com', // our primary hostname 'www.processwire.com', // alternate hostname 'dev.processwire.com', // staging server 'localhost:8888' // MAMP local dev server ); I changed the one first to a www. variant, and the second one to a non-www. variant. in /site/config.php I hope this helps someone in the future! Bram
  14. Hi Guys, Here are two issues that took my quite the amount of effort to fix so here im sharing the answers with you. 1. Non-admin user can’t edit profile information using Fredi. I installed Fredi and I sort of got it to work since when logged into Admin i'm able to edit my profile information, when logged in as anyone else however I don't get the "Edit" button. Also showing just certain specified fields doesn't work. When i call Fredi using this syntax and I'm loggedin as Admin it shows me all the editable fields of the user profile, not just "zzp_profiel_naam". $username = $user->name; $another_page = $pages->find("parent=user, name={$username}")->first; echo $fredi->render("zzp_profiel_naam", $another_page); Also I was wondering if it is possible to embed the edit-fields Fredi shows me in a lightbox directly on a page without the lightbox. This would make handeling the updates a lot easier also since it won't have to open the lightbox again on submitting changes, and you won't have to close it again after doing so. SOLVED Instead in using FREDI I used to backend modal to do this, include it like this: <?php $page->setOutputFormatting(true); ?> <iframe src="/cms/profile/?modal=1" style="width:calc(100% - 300px); float:left; border: 2px solid #ccc; padding:0px 0px 0px 0px;" onload="resizeIframe(this)"> </iframe> I used this javascript to change the iframe height to the height of the dynamic content, you could maybe add a onchange listener to resize it every time the height of the content changes. <script language="javascript" type="text/javascript"> function resizeIframe(obj) { obj.style.height = obj.contentWindow.document.body.scrollHeight + 'px'; } </script> A problem arose when trying to update single image fields, the modal added a second and left the first as it was. To remove the first when uploading a new one to a single image field add this to /site/ready.php // Make sure image upload into single image field deletes old image first $p = $page->process; $t = $page->template->name; if ("ProcessProfile" == $p && "admin" == $t) { $page->addHookBefore('InputfieldImage::fileAdded', function($event) { $u = wire('user'); $i = $u->place_your_image_field_name_here; while ($i->count() > 1) { $i->shift(); } }); } SOLVED Click here for the answer: https://processwire.com/talk/topic/10884-text-area-paragraphs-when-creating-a-page-from-a-form-submission/ 2. Line Breaks from Form Builder textarea not being transferred to the Rich Text Editor on the page it is saved to. What I need is for each textarea inside any form on the site to maintain it's line breaks like submitted by the user when transferred from entries to a page after being checked. The result in the form entries is what is is supposed to be, maintaining the line breaks. When transferred to a page however the breaks don't get transferred end I end up with one large block of non-breaking text. This is what me and some others have concocted to far. The upper part is working and sets a test message in the logs. The bottom one however is not. If I change the method to "saveForm" instead of "savePage" it does give me an error since afterwords I try to call objects that don't exist within the "saveForm" method, so I would assume it's getting called. // This is getting called and sets a test message in the Logs $forms->addHookAfter('FormBuilderProcessor::saveForm', function($event) { $processor = $event->object; $event->log->save('test', 'data=' . print_r($data, true)); $event->log->save('test', 'savePageFields=' . print_r($processor->savePageFields, true)); }); // This is not setting a log file, not even when I transfer the Form entry to a page $forms->addHookBefore('FormBuilderProcessor::savePage', function($event) { $processor = $event->object; $data = $event->arguments(0); foreach($processor->savePageFields as $fieldID => $name) { if(empty($data[$name])) continue; $field = $event->fields->get($fieldID); if(!$field || !$field instanceof FieldtypeTextarea) continue; $data[$name] = "<p>". str_replace("\n\n", "</p><p>", $data[$name]) . "</p>"; $data[$name] = str_replace("\n", "<br />", $data[$name]); $event->log->save('test', 'data=' . print_r($data, true)); $event->log->save('test', 'savePageFields=' . print_r($processor->savePageFields, true)); } $event->arguments(0, $data); }); If you can, please please please! Help me out, im really desperate and have been trying to fix these two problems for ages now Thanks in advance, Bram
  15. Hi Guys, First of, this is a great module! Realy nice But I have a few issues using this module and was wondering if you guys could help me out. I implemented it using: $username = $user->name; $another_page = $pages->find("template=user, name={$username}")->first; echo $fredi->render("name|zzp_profiel_omschrijving", $another_page); - This works perfectly when logged in as Admin, but not as a different user Role even though I added edit pages and edit profile to it's permissions. The edit button disappears in it's entirety when I'm logged in as a Superuser. - Also, this outputs all fields added to a user, not just the ones I specified ( name and zzp_profiel_omschrijving ) - Furthermore I was wondering if there is a way to embed the edit fields directly onto a page, without the edit buttons. So you would just get a page on the fontend with the field of the backend? Thanks a lot! Gr Bram
  16. Thanks for the hint in the right direction, after a few hours of searching I finally found the right syntax somewhere in the forum. I couldn't find this specific call anywhere in the documentation on FrontEndUser? This is how I logged in my user after a successfull login: // Login after succesfull registration $fu->addHookAfter('save', function($event) { $user = $event->object->form->fhValue('username','text'); $pass = $event->object->form->fhValue('password','text'); $this->session->login($user, $pass); });
  17. hi pwFoo! Thanks for the reply! I've been dabbling around with it for hours but I can't get it to work why is this so fucking hard? :( I just want it to log in after registration and it simply doesn't. $fu = $modules->get('FrontendUser'); // prepare register form $fu->register(); // Default parameter $fu->register(array('username', 'email', 'password')); // De rol "ZZP" toevoegen aan gebruiker $fu->addHookBefore('save', function($event) { $user = wire('fu')->userObj; $user->addRole('zzp'); }); // Login na succesvolle aanmelding $fu->addHookAfter('save', function($event) { $this->session->login(); }); // Additional email pre-register validation plugin (built-in) //$fu->register(array('username', 'email', 'emailValidation', 'password')); // Redirect destination: $redirect = $pages->get('/zzp-ers/gegevens/')->url; // process register / form submit $fu->process($redirect); // output register form echo $fu->render(); This is de code i've been using and on the page "gegevens" I just show the username if logged in, and "You're not logged in" when users aren't. Could somebody please show me how to get this to work? thanks! Gr, Bram
  18. Hi pwFoo, Thanks for your reply! I checked out Soma's code and I understand it for the most part, but I find it hard to translate the pieces of code for FrontEndUser to his examples since I don't know whether to use the same code, or change $form to $fu and so on... So i was hoping you could help me out abit. I implemented a register form already, and styled it myself O:) I'm redirecting that form to /profile when its submitted succesfully. Now it does create a new user with the right attributed ( a role ) but it doens't log the user in. And I don't know how to set this up. Also it would be nice to send the new User a small confirmation email with his email and password. Is there any change you could point me in the right direction for this? I would greatly appreciate any help with this Thanx! Bram
  19. Hey Guys, I just installed the module and it seems to work since it's actually outputting a register form, but I don't have any styling to go with it? The .css files in the modules directory are all but empty, just like the .js files, I also redownloaded the master file outside of processwire and it doesn't contain any styling either. I read that It's possible to overwrite the styling by putting files with the same names as the ones in the modules directory in templates/FrontendUser, but the originals are pretty much empty, so what is there to overwrite? Also, I can't find where I could change sentences like: "Password must be at least 6 characters and have at least 1 letter and 1 digit. Password may not have whitespace." Can anybody help me out? thanx! Bram
  20. The select fields I was using on the page seemed to want to use a single non-spacing term of word as a identiefier object, and the second as value. I only inserted one value per line, with breaks, and those were the ones that did not work. I solved this by changing the fields on my page to text fields which contain the value supplied by the select field from the form. And I think I could have doen it by inserting the value after for example: 1:=Value One. Hope this might help somebody one day
  21. Hey Guys! I ran into some really strange behavior when trying to save selected Selectfieldtype values from a form to a select field in a page. I have three different dropdowns in this page, all with different values and they randomly get saved en sometimes they don't. This is my setup: Form Page: Dropdown a: Dropdown a: - - V - - - V - Dropdown b: Dropdown b: - - V - - - V - Dropdown c: Dropdown c: - -V - - - V - I have no idea what is causing this since it happens completely randomly, does anybody have any ideas? Like, would it make more sense to only use a text field on the page side to recieve the value? and if so, why? Thanks in advance Gr, Bram PS: In the screenshot you can see the three filters that pick up the dropdown values and show the entries that are equal to the filter. And you can see the dropped values in the submissions.
  22. Hey Manfred, Yes my language pack is installed properly, and it still doesn't work
  23. When I click translate file as you describe I get a red bar with an error: does not exist or is not a directory And the page below it says: "The process returned no content."
  24. Im feeling extremely retarded by now, but I installed the language support and Dutch pack. Where can I change those two urls?
  • Create New...