Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 12/01/2012 in all areas

  1. I'm new to PW and wanted to say thanks for such an awesome, elegant tool. I'm really looking forward to working with it. I hope to be able to help out and contribute some day. Really, though. I'm just blown away. Great job on your own site as well.
    8 points
  2. i'm very sad that the claim "Build Bigger, Faster, Stronger, Easier" has been given up. that was a strong message (and true btw.)
    4 points
  3. So, had same free time: https://github.com/NicoKnoll/TemplateEditor (just beta)
    3 points
  4. Looks like your prayers have been heard: http://processwire.com/
    3 points
  5. I'm excited! It feels like processwire is preparing for something big (2.3?)! I too miss the old "Build bigger, stronger, faster, easier." tagline too. That's exactly what brought me to processwire. In fact I just made an adhoc photo gallery last night, in about 30 mins it's done! I couldn't have done it using anything else. "Reaching the sky" is a bit vague and presumptuous. But if you think it works, then sure. Can't wait to see what else is up, and i think we're all up for a treat!
    2 points
  6. hi onjegolders, 99% of my projects i start with skeletongrid, which - from my point of view - is the most convincing css framework out there. in addition, i do heavy copy-and-paste from projects i've done before. that saves me the most time. i'm coding in sublimetext 2 (which doesn't seem to be developed further - very sad!). i have a huge collection of textpattern snippets but didn't start with pw snippets as i didn't need it so far. most is plain php, so why have pw snippets? regarding the admin workflow: i try to do as much as i can via the api. that's a huge time-saver. i've developed in contao, textpattern and pw. all of my projects always take longer than estimated (maybe that's why i dont have a fancy car and go playing golf). but at the end of the day i must say, that i'm most productive with pw. best, christoph
    2 points
  7. And there my first real module: https://github.com/arjenblokzijl/ProcessPagePathCopy The origin A client needed to copy a lot of handpicked pages. You can do it using "view" and rightclick, but I thaught a single click might be a bit easier. So I wrote (thanks to Soma) this little module which adds a "copy path" action. You can also select a prefix or select which template(s) the actions should be applied to. The client can use command/ctrl + c, switch to his e-mail, do command/ctrl - v, switch back press enter to continue to the next. I need to implement a flash based solution to make the last step redundant. Hopefully that is done the next couple of days.
    2 points
  8. Hi, I wrote a new module this evening: Template Editor This module adds the possibility to edit and rename template files directly from the backend. Requirement: It's important to have this module installed and PW 2.2 running. Download: http://modules.proce...emplate-editor/
    1 point
  9. oh dear, between two page refreshes the look and feel of processwire.com has changed completely. while more call-to-actions are there, which i like personally, the dominating color now is a "sky-blue" ... how do you feel about that?
    1 point
  10. Not sure what in detail you need, but got some example code mainly taken from the Template Form Processor render a pages form to edit in front-end. https://gist.github.com/somatonic/5011926#file-from-php Now you need to include scripts and css needed. Note this $config stuff is only populated after you generated the form in API. In the head.inc you could include script (taken from the admin template default.php and modified a little). Also you would maybe need the inputfields.css found in the admin templates folder. This somehwhere in the <head> Moved code to gist.github.com for convenience.. https://gist.github.com/somatonic/5011926#file-head-php This will give you the basic things needed, I have not tested all fields, but file uploads and date picker or even custom color picker etc works fine.
    1 point
  11. Hi Christoph, Your english is very good, don't worry. Not sure I understand exactly what you want to do but serving "views" is relatively easy to achieve by allowing urlSegments in the template settings. You can then serve different views dependent on the urlSegment (which you will append to your "a" tags). Eg: if ($input->urlSegment1 == "category") { include("./categories.inc"); } You can then create categories.inc where you will test for the urlSegment2 and show the relevant category. So if your link goes to "blog/category/news", your template would help you output just the pages linked to the "news" category. // categories.inc <?php $name = $sanitizer->pageName($input->urlSegment2); $category = $pages->find("template=category, name=$name"); $articles = $pages->find("template=article, category=$category"); ?> Hope this makes sense, if not I can try and show you in more detail
    1 point
  12. $f = $this->modules->get("InputfieldMarkup");
    1 point
  13. Well, the admin is built for that purpose to add and edit pages. Every user that has a login is able to see the admin, even if he can't edit anything and if he knows the url. Although you could add hooks to check for roles to redirect out of the admin in case. I didn't say use the module but look at it how it's done, it's also done using API (as everything in PW), so you would need that same codes anyway. I don't see any problems doing your own frontend forms based on a templates fields. But depending on the fields you need, it's not as easy as simply rendering the fields with a form wrapper and you're done (for the reasons mentioned). Jquery UI, inputfields css and scripts and the $config->js would also be needed for them, and some of them would be in the $config->scripts, $config->styles when you render fields on a page. I've never tried to rebuild the backend for the frontend, and always try to use some shortcut link on the pages for them to edit or create pages using a simple link with url to the right admin screen. If I combine that with &modal=1 and fancybox modal they don't even need to go to the backend. <a class="fancybox" href="/processwire/page/edit/?id=1123&modal=1">edit page</a> <a class="fancybox" href="/processwire/page/add/?parent_id=1022&modal=1">add page</a> That's in cases sufficient to give a simple frontend editing capability with 2-3 lines of code.
    1 point
  14. The overall look is very bright and contemporary, without going too far from the original. Now all we need is for the forum to match!
    1 point
  15. Well you could have a title field and a headline (like on basic profile) You could name the title on home "Home" which will be taken for the navigation, and the headline your other title you output on the page. That's much better than hardcoding it.
    1 point
  16. I never liked tinyMCE. Always angry with the code it creates or corrupts. So I was far from a big fan. Then I discovered PW, was very happy with the markdown it provides. But then after a while I discovered how well tinyMCE is integrated, how well it was configured. PW has changed the way I think of tinyMCE. It does function very well. The way i think to go for WYSIWYG editors don't drop tinyMCE till PW drops support for older browsers. Or don't drop it at all. Maybe we need a $config->onlyHtml5Browsers = true; ( or something ) That could make some room for third party WYSIWYG alternatives based on new standards.
    1 point
  17. It wasn't so much given up as much as replaced for a while. We are slowly transitioning the website from one-man-Ryan-machine built to community built one, so there are (and will be) few kinks here and there.
    1 point
  18. Oh dear! The CSS must have gotten mangled up or something
    1 point
  19. ah, maybe this is the only timesaving hint i have - i have a private wiki in evernote where i archive usefull posts, snippets etc. i find out there in the forum or in blogs etc. i also have checklists in evernote, for example how to install pw at hosting xyz. i consult this wiki quite often.
    1 point
  20. I had a birthday this week ... I am now a bit further into my second half century. I probably ought to speed up a little ..... hah! Oh, and I had to give up drinking (more or less) because of the first half century. I am sure there is something deeply philosophical in there somewhere. Now, I must get back to my new PW site. I have just found a right old headache between how PW likes to be organised and how Bootstrap menus work. Typical.
    1 point
  21. I was able to reproduce this in a repeater and tracked down a problem (and think I fixed it). Thanks for finding it. This problem would also affect any pages with images that didn't have a template file. Do you want to try the latest dev branch. Or if you are already up to date minus the latest commit, you can replace just /wire/modules/Process/ProcessPageView.module https://github.com/ryancramerdesign/ProcessWire/commit/e000252a264f35deccb081e995a40df451f82952 https://raw.github.com/ryancramerdesign/ProcessWire/e000252a264f35deccb081e995a40df451f82952/wire/modules/Process/ProcessPageView.module
    1 point
  22. Well deleting the original will leave you with a problem as you already know It would be relatively easy to script a batch resize all original images and run that once over all page that has images. Use the ImageSizer class. Working example: $pa = $pages->find("template=basic-page,images.count>0"); foreach($pa as $p){ foreach($p->images as $i){ $ImageSizer = new ImageSizer($i->filename); $ImageSizer->resize(120,0); } } It will resize all the original images to 120x*. And you're done. (This particular example show how cool the on-page images are.)
    1 point
  23. 1 point
  24. Hi guys, I'm Marco, Italian IT technicians and PHP developer. In the past I've used Symfony, Wordpress (and Drupal, Joomla, ..).. in this days I try to come close to EE2.. but these aren't a good days for EE2 community. I read about PW from a tweet, and now.. Have a nice day, Marco
    1 point
  25. Hi. As a fairly new person myself, I can vouch for how friendly and helpful the ProcessWire community is to newcomers.
    1 point
  26. Just experimented also a little and made a little example based on Martjin's code. With some improvements and simpler add image routine. No need to create a new PageImage as the page already has PageImages field. Just add the path to the file and save page. This can also be a remote web url. Also this example shows how error handling can be done. I also used a "/.tmp_upload" folder to upload images first and only add to the page if everything is valid. Since $u->execute() uploads the file to the destination specified, it could be a security issue, if not dealed correctly with it. As far as security goes this folder should be made publicly not accessible via htaccess (in comment). In 2.3 you could maybe use built in restriction to files on pages, but not sure it would be appropriate here. Further, I delete the images uploaded in tmp folder in either case. This is all example code and may even need additional security for real public uploads. (mime types check of files by the WireUpload is sufficient? Ryan?) I've put the code on gist.github: https://gist.github.com/4150974
    1 point
  27. ...and among a million other reasons, it's responses like this that make Processwire incredible. There's a lot in there I can learn from. Thanks for sharing.
    1 point
  28. I recently had to setup front-end system to handle logins, password resets and changing passwords, so here's about how it was done. This should be functional code, but consider it pseudocode as you may need to make minor adjustments here and there. Please let me know if anything that doesn't compile and I'll correct it here. The template approach used here is the one I most often use, which is that the templates may generate output, but not echo it. Instead, they stuff any generated output into a variable ($page->body in this case). Then the main.php template is included at the end, and it handles sending the output. This 'main' template approach is preferable to separate head/foot includes when dealing with login stuff, because we can start sessions and do redirects before any output is actually sent. For a simple example of a main template, see the end of this post. 1. In Admin > Setup > Fields, create a new text field called 'tmp_pass' and add it to the 'user' template. This will enable us to keep track of a temporary, randomly generated password for the user, when they request a password reset. 2a. Create a new template file called reset-pass.php that has the following: /site/templates/reset-pass.php $showForm = true; $email = $sanitizer->email($input->post->email); if($email) { $u = $users->get("email=$email"); if($u->id) { // generate a random, temporary password $pass = ''; $chars = 'abcdefghjkmnopqrstuvwxyz23456789'; // add more as you see fit $length = mt_rand(9,12); // password between 9 and 12 characters for($n = 0; $n < $length; $n++) $pass .= $chars[mt_rand(0, strlen($chars)-1)]; $u->of(false); $u->tmp_pass = $pass; // populate a temporary pass to their profile $u->save(); $u->of(true); $message = "Your temporary password on our web site is: $pass\n"; $message .= "Please change it after you login."; mail($u->email, "Password reset", $message, "From: noreply@{$config->httpHost}"); $page->body = "<p>An email has been dispatched to you with further instructions.</p>"; $showForm = false; } else { $page->body = "<p>Sorry, account doesn't exist or doesn't have an email.</p>"; } } if($showForm) $page->body .= " <h2>Reset your password</h2> <form action='./' method='post'> <label>E-Mail <input type='email' name='email'></label> <input type='submit'> </form> "; // include the main HTML/markup template that outputs at least $page->body in an HTML document include('./main.php'); 2b. Create a page called /reset-pass/ that uses the above template. 3a. Create a login.php template. This is identical to other examples you may have seen, but with one major difference: it supports our password reset capability, where the user may login with a temporary password, when present. When successfully logging in with tmp_pass, the real password is changed to tmp_pass. Upon any successful authentication tmp_pass is cleared out for security. /site/templates/login.php if($user->isLoggedin()) $session->redirect('/profile/'); if($input->post->username && $input->post->pass) { $username = $sanitizer->username($input->post->username); $pass = $input->post->pass; $u = $users->get($username); if($u->id && $u->tmp_pass && $u->tmp_pass === $pass) { // user logging in with tmp_pass, so change it to be their real pass $u->of(false); $u->pass = $u->tmp_pass; $u->save(); $u->of(true); } $u = $session->login($username, $pass); if($u) { // user is logged in, get rid of tmp_pass $u->of(false); $u->tmp_pass = ''; $u->save(); // now redirect to the profile edit page $session->redirect('/profile/'); } } // present the login form $headline = $input->post->username ? "Login failed" : "Please login"; $page->body = " <h2>$headline</h2> <form action='./' method='post'> <p> <label>Username <input type='text' name='username'></label> <label>Password <input type='password' name='pass'></label> </p> <input type='submit'> </form> <p><a href='/reset-pass/'>Forgot your password?</a></p> "; include("./main.php"); // main markup template 3b. Create a /login/ page that uses the above template. 4a. Build a profile editing template that at least lets them change their password (but take it further if you want): /site/templates/profile.php // if user isn't logged in, then we pretend this page doesn't exist if(!$user->isLoggedin()) throw new Wire404Exception(); // check if they submitted a password change $pass = $input->post->pass; if($pass) { if(strlen($pass) < 6) { $page->body .= "<p>New password must be 6+ characters</p>"; } else if($pass !== $input->post->pass_confirm) { $page->body .= "<p>Passwords do not match</p>"; } else { $user->of(false); $user->pass = $pass; $user->save(); $user->of(true); $page->body .= "<p>Your password has been changed.</p>"; } } // display a password change form $page->body .= " <h2>Change password</h2> <form action='./' method='post'> <p> <label>New Password <input type='password' name='pass'></label><br> <label>New Password (confirm) <input type='password' name='pass_confirm'></label> </p> <input type='submit'> </form> <p><a href='/logout/'>Logout</a></p> "; include("./main.php"); 4b. Create a page called /profile/ that uses the template above. 5. Just to be complete, make a logout.php template and create a page called /logout/ that uses it. /site/templates/logout.php if($user->isLoggedin()) $session->logout(); $session->redirect('/'); 6. The above templates include main.php at the end. This should just be an HTML document that outputs your site's markup, like a separate head.inc or foot.inc would do, except that it's all in one file and called after the output is generated, and we leave the job of sending the output to main.php. An example of the simplest possible main.php would be: /site/templates/main.php <html> <head> <title><?=$page->title?></title> </head> <body> <?=$page->body?> </body> </html>
    1 point
×
×
  • Create New...