Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 05/07/2013 in all areas

  1. Hi Grays, I have attached a printable Cheatsheet, its laid out on 2 A4 pages. It covers $page, $pages and PageArray. I hope it helps. Ryan pointed out: I'm very new to processwire and I understand where you are coming from. I'm praying for that "AHA!" moment too! When I see encouraging and friendly threads (like this one) I feel like Processwire is worth the time. Good luck processwirecheatsheet.pdf
    4 points
  2. In the pages tree, if a page is locked for edits and the user doesn't have Lock/Unlock permission, then the edit link shouldn't show.
    2 points
  3. Where is the censor filter when you need him.
    2 points
  4. This makes sense to me, I've gone ahead and changed it. It should appear on the dev branch next time I'm pushing updates to it, probably later this week.
    2 points
  5. A wife, family, kids, also a dad of successfull processwire. You are doing fine, just fine Ryan. Congratulations.
    2 points
  6. Holey Smokes! Where have I been! Now I can see why a bunch of MODXers have been jumping over to ProcessWire! I have been playing around with it and going through the tutorials! I have to say so far I LOVE IT! This is going to make my life so much easier! Thanks for making a great product! So got a goal to finish one site by this weekend! Keep up the great work! *But I know I have so much to cover and go through but heck I love what I see so far* One small question though - this forum - is this also an add-on to ProcessWire? *I have a community site I would love to build and if I can add on a forum that would be absolutely SPLENDID*
    2 points
  7. In a rare display of personal work I’ve made a photographic site to show some of my pics. I hope you like it. http://stlmv.in/mw
    1 point
  8. Sorry I'm a little behind with messages here, I'll be caught up by mid week. But I've got a good excuse. Yesterday Karena Savannah Cramer was born. She is our 2nd daughter (Hanna Ryan, age 3 is our first). We will all be coming home from the hospital hopefully tomorrow.
    1 point
  9. Hello Everyone - I am pretty new here - came across this CMS based on a friend of mine who has indicated she used this CMS and loves it. So when she says she loves it then I take her word for it - you might know her as Eisteinboi or Mary. I have been a long time MODX user (and I see there has been other MODX users who have jumped over here as well - so that helps me) Did an install of ProcessWire for one of my Personal Projects I am doing here for the Deaf Community here in Houston. So I am looking forward to my Processwire Journey. So now just need to jump in and figure out how everything works. I'm excited about this Processwire journey, and hopefully if I like it - then maybe more projects to build with it. Thanks for making an awesome product! Have a great one! Billy Koch
    1 point
  10. If $config->urls->root will suffice for a given situation, it is potentially a lot less overhead to use it. When you access $config->urls->[anything] you are just accessing already-loaded properties. When you access $pages->get($id)->url, you are triggering a page load, if the page isn't already loaded.
    1 point
  11. Anyway, if you would decide to do that check, you could do it like this: if ($pages->get("parent.name=$input->post->date, name=$input->post->name")->id) // set error to 1 edit: Ryan has some important additions to this on a post bellow
    1 point
  12. I also feel that repeaters are not the best way to go for you. Reapeaters are for information that will be needed more than once, In your case would be more than one per company. I'm guessing that you used the repeater fields to organize the information in blocks. If this is right, that would be better done with with fieldset or fieldsetTab. The first one groups visually the fields in the template, and the second, separates them in tabs (in the backend, this is not the answer to your question about tabs in the frontend). To use them, create a new fieldsetOpen field for each of the groups you have there (Applicant Details, Primary Contact, etc...), and it will automatically create also a "fieldName_END" field for each. In your template organize the fields between the opening and closing field of each group, and you will have a nicely organized edit page. Same applied for fieldsetTab, except that it creates a tab for each group instead of only grouping them visually under a name. To create the tabs --this will depend a lot on what js plugin you will use, if you will use one. I will take the jQueryUi tabs as an example--, you will need to organize the content inside the tabs divs: <div id="tabs"> <ul> <li><a href="#tabs-1">Applicant Details</a></li> <li><a href="#tabs-2">Primary Contact</a></li> <li><a href="#tabs-3">Secondary Contact</a></li> </ul> <div id="tabs-1"> --here goes content-- </div> <div id="tabs-2"> --here goes content-- </div> <div id="tabs-3"> --here goes content-- </div> </div> The frontend will ignore the groups that you created in the backend, so you will have to organize everything manually: <div id="tabs"> <ul> <li><a href="#tabs-1">tab name</a></li> <li><a href="#tabs-2">tab name</a></li> <li><a href="#tabs-3">tab name</a></li> </ul> <div id="tabs-1"> <p><?=$page->organisation_name?></p> <p><?=$page->sector?></p> </div> <div id="tabs-2"> <p><?=$page->primary_first_name?></p> <p><?=$page->primary_last_name?></p> <p><?=$page->primary_email?></p> <p><?=$page->primary_phone?></p> </div> <div id="tabs-3"> <p><?=$page->secondary_first_name?></p> <p><?=$page->secondary_last_name?></p> <p><?=$page->secondary_email?></p> <p><?=$page->secondary_phone?></p> </div> </div> edit: I changed the field names of the contact to primary_something, and secondary_something, because they are different info, and they need different names on the same page.
    1 point
  13. You'll have to get access to the form builder support forum. This is recently a post by Ryan on a recent update.
    1 point
  14. Congratulations Ryan, she's gorgeous!
    1 point
  15. Maybe simpler to do this: if($page->is("name=slideshow18|slideshow28|slideshow38|slideshow88")){ // page has one if the names } Or if it doesn't matter what number if($page->is("name^=slideshow")){ // page name starts with slideshow }
    1 point
  16. You could also do this: if ($page->is("name=slideshow18|slideshow28|slideshow38") { I prefer this method, since it's slightly shorter, bit more readable and doesn't need to fetch any additional pages just for comparison.
    1 point
  17. Congratulations to you and your family! Very beautiful pictures! Take time off as much as you want Ryan because you deserve it.
    1 point
  18. The best way is to avoid having PW in subfolder and on root on production. Search replace the sql dump is maybe most simple. And there's also this module http://processwire.com/talk/topic/236-module-page-link-abstractor/
    1 point
  19. .. what hook did you use? ;-)
    1 point
  20. Welcome to the world Karena! Nice work Ryan.
    1 point
  21. 1 point
  22. Congratulations for all the family
    1 point
  23. 1 point
  24. Congrats ryan, cute family! Wish you all the best for the future!
    1 point
  25. Congratulations Ryan and family!
    1 point
  26. Congratulations and all the best for you and your family!
    1 point
  27. Congratulations, Ryan! Excuse accepted
    1 point
  28. Hi Ryan, Congrats to you and your family! Enjoy your little one
    1 point
  29. Hi Ryan, Great work. Congratulations! Without a doubt our children are our finest work. I hope she's a sleeper Regards Marty
    1 point
  30. never mind.. I found the reason inside `renderPosts()` function.. if(empty($page->summary)) { // summary is blank so we auto-generate a summary from the body $summary = strip_tags(substr($page->body, 0, 450)); $page->summary = substr($summary, 0, strrpos($summary, ' ')); }
    1 point
  31. That line is there for a very good reason, you don't want people accessing your template files directly like you just did. don't remove it. The best way to do what you want is to create a template with that contactengine.php file, and then a page with that template (lat's say you name it "contactengine"). Then you can do this: <form method="post" action="<?php echo $pages->get("/contactengine/")->url;?>">
    1 point
  32. PWired, I think what is being said here is that there is more to site rankings, SEO than writing lots and lots of articles. Of course, you can write lots of articles if you want...but it doesn't mean your site rankings will go up. There are a number of issues you raise here so maybe not good to get mixed up. Here's my take. Blog: You can easily create a blog in PW. This will come with all the ease of templating and powerful API that PW offers. Of course you can create one in WP too and none of us will be offended . Personally, I wouldn't create anything with WP..I've tried it before and don't want to go there again SEO/Site rankings: Whether a blog or some other sort of site, there are tips on how to improve your search rankings. Google these. Templating: There are a number of approaches. Key questions are these: Do I need lots of templates or few? How do I justify whether few or lots? The fewer the templates you can get away with the better for you, I think. By using PHP conditional statements (if's) with PW you can be as versatile as possible and use a few templates. How to organise your pages: Here I refer to the images questions. I'm sure you know that there are various approaches to this in PW. You can use Soma's image manager (in Alpha currently!); You can create one page to hold all your images. You can upload multiple images for each page. You can include inline images in the rich text editor (not all like this ). Which one you choose depends on your needs. Read more, etc...that's ridiculously easy in PW. Have you looked at the default PW installation? There are a number of ideas there. E.g. , the text before the read more can come from a description or summary text field. You click more it shows you the whole article. E.g. echo "<p>{$myarticle->summary}<a href='{$myarticle->url}'>Read more...</a></p>"; That will give you something like: I gotta run. I'll probably write more later. This reminds me, I really need to write that tutorial about how to approach templating... Hope this helps...
    1 point
  33. I'm not sure what you're exactly trying to say here, but the answer is "definitely not." There's nothing WordPress can do that ProcessWire can't do. Actually I'd go as far as claim that it's quite the opposite. Articles or blog posts? Just create templates for those and start writing. In case that you need help for specific problems and/or parts or ideas, ask. If you'd prefer to start a proper blog from the scratch, check out Blog Profile. Did this answer your question or is there still something you're wondering?
    1 point
  34. I didn't know this, but in CKEditor you can also paste the image. Just tried it, and worked
    1 point
  35. Habemus papam! I've used the plugin that Wanze indicate me along with jquery validation and then sanitizing my input fields as Soma suggested. I'm on php validation now, I'm going to dig into the forum to find the right solution to make my form a bit safer to play with Thanks guys, you rock!
    1 point
  36. You can generate name, value and validate CSRF in PW like this $csrf_name = $session->CSRF->getTokenName(); $csrf_value = $session->CSRF->getTokenValue(); echo "<input type='hidden' name='$csrf_name' value='$csrf_value'/>"; And validate it with if($session->CSRF->validate()){ // valid }
    1 point
  37. The result of the find is an array, so you can't get the children of it. If there's only one page with that template you can do: $results = $pages->get("template=news-month-archive")->children("sort=-news_date, limit=10");
    1 point
  38. Something like this? $allPages = $pages->find('template=template-X'); $selectedPages = $page->pagesWithTemplateX; foreach ($allPages as $p) { $selected = ($selectedPages->has($p)) ? 'selected' : 'not selected'; echo $p->title . " is {$selected}"; }
    1 point
  39. Also wanted to add that you don't sanitize values or check them except the email (but you're not validating it in php), so anyone can inject something directly submitting to the submit.php... // Send all form submissions through ProcessWire sanitization $email = $sanitizer->email($input->post->email); $username = $input->post->username; $password = $input->post->password; $provincia = $input->post->provincia; $genere = $input->post->genere; $orientamento = $input->post->orientamento; $annuncio = $input->post->annuncio; Validation just with jquery.validate isn't sufficient to make a secure form. And it just get a little (lot) more complicated.. Also you're not having a CSRF attack prevention with your form.
    1 point
  40. Have you tried this? print_r($_FILES); //Shouldn't be empty Edit: You can't upload files with ajax in some browsers, thats a browser security restriction. There exists a fallback-solution with a hidden iframe makes it work in every browser. Check out this plugin and FAQ: http://malsup.com/jquery/form/#file-upload
    1 point
  41. Ok, but now that's a completely different story using validate and post the form using AJAX and form.serialize... This might be of interest http://stackoverflow.com/questions/4545081/how-do-to-file-upload-using-jquery-serialization Still your error handling isn't going to work. You'll have to return some readable error handling like json encoded php array, then read the data on success in the ajax function. ... // if errors return them to the js ajax request if(count($errors) { $errors['error'] = true; echo json_encode($errors); } This will return something like this: {"error":true,"upload":"no upload"} then in the js ... success: function(data) { if(data.errors){ // do something to show the errors in data returned by php script $('ul#errors').append($("<li>"+data.upload+"</li>")); else { // no error occured } }, ...
    1 point
  42. You could check if the files are sent to the server, somwhere on top of your script: print_r($_FILES); //Shouldn't be empty Check your php settings for UPLOAD_MAX_FILESIZE, MAX_POST_SIZE edit: Soma wins
    1 point
  43. ... Beer Pee videos and films ... get it?
    1 point
  44. Taking your code just as is (commenting out the page creation/saving) the upload works for me. I'm not sure where it's failing for you. Does the uploads folder really get created and is writable? Is upload and post max size enough for the file you trying to upload? If the file is too big it won't do anything and just fail silently is possible. Also noticed some things in your code. I am not sure why you have two files for form and php ? And in the form action just "./"? I've put both scripts in one file form.php in the root and changed the include of index.php and the action to action=""; You also have if(!count($files)) { $u->error("Sorry, but you need to add a photo!"); return false; } The $u->error(...) will never show up as you're not using the PW way of creating the form with InputfieldForm. So you would need to handle the errors yourself. Something like this: $errors = array(); if(!count($files)) { $errors['upload'] = "Sorry, but you need to add a photo!"; } Then check before creating and saving page: if(empty($errors)){ //... do stuff } Also you have those return false; return true; in the code... Those will prevent the code from going futher and you won't have a chance to output the form again and show some errors. Just stick with a way to create a errors array and fill in, then before the form output you check for errors and ouptut them.
    1 point
  45. to make the first page in the admin the one that appears by default. I was working on custom admin pages module, and occurred to me that PW could be flexible on this also. Although personally I really like the tree as the default view, I thinks it should be the responsibility of each one to decide about something like this.
    1 point
  46. Hi Grays, welcome to the forum. Even though I have been playing with PW for a couple months now, I too am still very green and new to it. I was in the same boat as you and still am trying to grasp the basics, but take the advice of everyone else above. The people here on the forums are very helpful and friendly. Don't be afraid to ask questions. There are a lot of smart peeps here and I find this is one of the most friendliest, most responsive CMS forums of them all. Make friends with other newbies (such as myself) and follow the questions they ask. Seach the forums for the ones asking basic questions and those will more likely be the newbies. I think for me, the best thing I could do was to take it slow and lower my expectations. I fell in love with PW right off the bat and wanted to be a a pro in it. But, even though I had read a few PHP books and took some courses beforehand, in reality I was lost and dissapointed. It's more a mental/confidence thing with me, but once I accepted the fact that it was going to take some time, and I wasn't going to be an immediate whiz, things got easier. So. I started off (still am) doing the basics, one thing at a time. Break up your site into smaller parts and work on each one by one. When you get something simple working, your pride will fuel the next challenge and before you know it, you'll be at the top. Analyze the code here in the forums and don't just copy/paste. Try to really understand it by cross checking with how PHP works. A great thread started not long ago on learning PHP is here. You may not understand it in one try, I know I didn't. Sometimes it takes days or weeks for something to "click" in your head. Read, re-read, read again. Things DO get easier but it takes time, and time is the secret. Practice helps. It's inspiring what you can do with PW and what keeps me going is knowing this is the best CMS out there. I have researched and tried almost all of them over the years, but nothing compares to PW. I am inspired every day to continue learning and not giving up because it's absolutely worth it. MY breakdown to how I am learning: Take it slow. Break code examples down line by line. Moving on to the next line only after knowing what each before it does. You'll get it! Don't attempt something expecting results the first time. Take pride in humiliation. You can only learn after making mistakes. Read this PW wiki Study Codecademy PHP course along with a couple PHP books. Try to go through every forum completly. Go through each page one by one, bookmarking where you left off. I do this before I go to bed. Before you know it, you'll have read all the forum topics and can know be updated when new threads post. ask questions. I know this can be kinda hard because you don't want to look like an "insert insult", but the truth of the matter is if everyone is afraid to ask then it's hard for newbies like you and I to find answers to basic questions. It's a win win for everyone and the CMS itself. breaking down basic elements of a site one section at a time and searching the forums for how to do it (navigation, multi-level navigation, photo gallery, forms, etc..) You may have to read multiple threads but it's all there. Good luck and don't give up! I can never look back at any other CMS, even during times when I'm frustrated or lost! I only get frustrated with PW because I do not know YET how to proficient. I was frustrated USING other CMS's because of how they were built and I knew their code. Says a lot right there.
    1 point
  47. What any newbie should do first is learn Drupal. After 2 years of: awful theming, i.e. $element['#object']->field_video_embed['und'][0]['value'] instead of $page->field_video_embed searching through 500 line arrays to find out what module is injecting a certain markup in your code writing huge css files to deal with the divs nested within divs nested within divs nested within divs figuring out how to add a meta tag to your <head> using an API and an array getting carpal tunnel syndrome from constantly clearing the cache because Drupal is such a hog, everything has to be cached learning the Views module, a point and click interface that is 3X more annoying and difficult than learning and using straight SQL find a good host that is beefy enough to deal with the Drupal and has advanced caching capability After that, PW will be a walk in the park.
    1 point
  48. Ok, starting from the end. Put very roughly, $page represents a single page while $pages represents all pages. The methods from $page http://processwire.com/api/cheatsheet/#page can be applied to any object that represents a single page. $page, when used simply like this, represents the page that called the current template (usually by being viewed in the browser), but the $page methods can be applied to any Page object (other pages, even if they didn't call the current template). How do we get all those pages that are not represented directly by the variable $page? You guessed, using $pages http://processwire.com/api/cheatsheet/#pages $otherPage = $pages->get("/about/"); The get() method of $pages, returns always only one page. Meaning that $otherPage, is now an object equivalent to $page. Because of this, you can apply to it all the methods and call all properties of the object $page: echo $otherPage->id; While get() returns a single page, find() returns an array of pages, to be more precise a PageArray, and to those arrays you can apply any of the PageArray methods and call it's properties http://processwire.com/api/cheatsheet/#wirearray $pagesList = $pages->find("template=basic-page"); $pagesList->shuffle(); //same as: $pagesList = $pages->find("template=basic-page")->shuffle(); and because $pagesList is now a list with lots of $page equivalents inside it, you can go to each one individually and apply the same methods and call the same properties as with $page: foreach($pagesList as $individualPage){ echo $individualPage->id; } Disclaimers: I did an over simplification of the terms (same as in the cheatsheet). To make it clear: $page is a variable that holds a Page object that represents the current page. The methods I keep referring and that are on the cheatsheet, are in reality methods of Page objects, and not $page itself. The same applies to $pages and Pages. I must have some errors there because I'm far from a PHP specialist (even less concerning OOP). edit: Ryan, I saw that you answered before me, but I think to the first part. I will read now
    1 point
  49. I would say that the blog profile is not the best place to start. It uses more advanced techniques and was designed to be a demonstration of them– These are techniques I don't even use in my own site development, but felt like we needed a profile that would appeal to those looking for a dedicated MVC strategy. The best place to start really is the basic profile that comes with ProcessWire. When you understand that, you really can build anything. If you are wanting to go further, you might like to look at the skyscrapers profile. But the important thing to remember is that there is no "right" way to build your site in PW. This is why even tutorials can be a mixed blessing when you are learning, because they reflect one approach that may not necessary be the right one for you. Beyond the basic profile, you just need to read $page, $pages, PageArray and about Template files. Ignore everything else, because you may never need it. Don't feel like you need to remember or understand everything on those pages. But read through them and make note of what's there. These pages cover 99% of what you will do in ProcessWire from the code side… and probably a lot you won't ever use too. Once you get going and developing stuff, you'll want to keep the Cheatsheet open, which has sections that cover what's on those links above more succinctly. In ProcessWire, you should be comfortable with HTML markup and CSS. But it's less important that you know PHP. You only need to learn a few basics. You really don't need to know any more than you need to know EE tags. Know how to get in and out of PHP from HTML markup. i.e. <?php ... ?> Know what a $variable is – just a place to store a value. Most ProcessWire API functions return a value. Know how to use an if() statement. In PW, you'd use an if() to test if something had a value you wanted to output. Know how to use a foreach(). In PW, you'd use a foreach() to cycle through a page's children, or the results of a $pages->find(...). Know how to output a value, whether: <?php echo $value; ?> or <?=$value?> …both do the same thing. Know how to use include() to include another file, i.e. "<?php include("./header.inc"); ?> I think that covers all you would have to know to do most things from the PHP side in ProcessWire. Can anyone think of anything major I'm missing? Lastly, when you are developing, enable debug mode in /site/config.php: $config->debug = true; This will ensure that you get helpful error messages rather than ambiguous ones.
    1 point
×
×
  • Create New...