Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 09/13/2013 in all areas

  1. Ryan, I like your honesty, how gracious you are, and the fact that you're just such a nice guy
    4 points
  2. Hi all, I'm a big fan of the Sublime Text 2 text editor and of course of huge fan of ProcessWire, so I went ahead and created a library of PW snippets to be used with the ST2 Snippet system. I followed the PW cheat sheet, and created Advanced and Basic versions. The Advanced version contains only those seen in the advanced mode of the cheat sheet, so if you want the full set, you'll want to get both Basic and Advanced. They are on GitHub here: https://github.com/evanmcd/SublimeProcessWireSnippetsBasic https://github.com/evanmcd/SublimeProcessWireSnippetsAdvanced I've just submitted the Advanced set for inclusion into Package Manager, so hopefully that will be added soon. See the README for more info. Any feedback welcomed
    3 points
  3. Sounds strange. Maybe you have forgotten a = somewhere like this: if($page->id=1){} instead of if($page->id==1){}
    3 points
  4. 2.4 will be released once the dev branch source has sat for a week or so without any necessary fixes or major additions (meaning, it's reached a stable state). I think that's probably soon, but don't want to promise any dates since I'm actively working on the code almost every day.
    3 points
  5. 3 points
  6. I would go with the child pages strategy. the tree could be organized like this: home -home_content ---area1 (give meaningful names to these) ---area2 ---area3 ---... -about -whatever -etc "home_content" need a template, but not a template file. Not having the file will hide it and it's children from the website (see answer #17 below http://processwire.com/talk/topic/4487-homepage-with-multiple-content-areas/?p=47926). The "area" pages would have their own template files (no header, no footer, only their own markup): <h2><?php echo $page->title?></h2> <?php echo $page->body?> Then you can build the homepage like this: <body> <h1>Look at my nice areas of content!</h1> <section id="area1"> <?php echo $pages->get("/home_content/area1/")->render()?> </section> <section id="area2"> <?php echo $pages->get("/home_content/area3/")->render()?> </section> <section id="area3"> <?php echo $pages->get("/home_content/area3/")->render()?> </section> <section id="area4"> <?php echo $pages->get("/home_content/area4/")->render()?> </section> </body> edit: or, if you get easily tired of typing <body> <h1>Look at my nice areas of content!</h1> <?php foreach($pages->get("/home_content/")->children as $c) { echo "<section id='{$c->name}'>"; $c->render(); echo "</section>"; } ?> </body>
    3 points
  7. SELECT name,modified,modified_users_id FROM pages WHERE id=2
    3 points
  8. Hello there, In my long slow way of discovering coding, I ended up realizing I needed something like... the Pages Web Service. I installed it, tried it and thought.... Woa! How can Ryan do so much... It seems perfect for my needs right now! I was stcuk and now I can go forward again. So I'll keep on exploring and trying to do my stuff. But on my way, I wanted to stop and say THANKS to Ryan for his work and the way he's sharing it... I sometimes ask for help, this time, no answer needed ;-)
    2 points
  9. Today needed a simple way to add text to an image. I ended up serving a page with images headers. So using this image from other pages is: <img src="<?= $pages->get(1234)->url; ?>" /> Settings for the template: - not using a slash at the end - enable template caching - be shure you end the page name with .png .gif or .jpg example code --- Maybe someone comes in the same situation
    2 points
  10. Good thinking! Diogo teached me to turn them around. This way you notice the error more quickly. if(1 == $page->id) { // Do stuff }
    2 points
  11. I had some updates to push on dev related to InputfieldPage and the <select> dependencies, so went ahead and did that, just so that we're all testing on the same version of things here. This is a little off-topic here, but wanted to mention before I forget: @Soma: I implemented something so that you can specify which classes should behave like InputfieldPageListSelect/InputfieldPageListSelectMultiple, where the "parent" setting reflects the root of a tree rather than an immediate parent. Rather than having those hard coded in the class, they can now be specified by making your class implement the interface "InputfieldPageListSelection". This interface doesn't currently require any methods, so it's a blank interface. You can have your Inputfield class defined like this to be treated as a tree selection: class YourInputfield extends Inputfield implements InputfieldPageListSelection { Non-selected pages aren't actually part of the POST submission. They are no different from unselected items in a <select multiple> ... actually that's exactly what they are behind-the-scenes, as this jQuery UI widget is just a progressive enhancement to <select multiple> in the same way that asmSelect is. The data that they represent can't go beyond what is represented by a <select multiple>.
    2 points
  12. @ diogo Lets say i made the site for my client. My client is a company and in it there will be 5 people administrating the site. So after my job is finished my client have no access to thoes oryginal images, and non of thoes 5 admins can use same images on site (well meaby if they send it to eachother by email). Having all files in one module make things easier cause they are accessible for all users of the site. I would honestly donate some money for this to be developed. Cheers
    2 points
  13. Greetings bodhic, Thanks for sharing a mockup (looks better than my hand-drawn ones). You got some good ideas from diogo, and there are a lot of possibilities (almost endless actually). In this post, I offer some ideas of how you could handle each content area on your home page. Along the way, I try to show various ways to use ProcessWire search and display options. 1. The "Featured Service" Carousel There are lots of great JQuery carousels out there. For this example, I use bxSlider. Let's say you have a content type called "service," and that content type has a field called "intro_image," where you also enter a description. Let's also say that you have a checkbox field called "featured_service" (when that checkbox is checked, the service is featured). In the code below, we locate all service pages where you checked the "featured_service" checkbox (meaning it has a value of 1), then we sort the results randomly, and display each "service_image" as a 600px x 450px image. Each image links to a full "service" page: <div class="featured_service_block"> <ul class="featured_service_slider"> <?php $services = $pages->find("template=service, featured_service=1, sort=random"); foreach ($services as $service) { ?> <li><a href="<?php echo $service->url ?>"><img src="<?php echo $service->intro_image->size(600, 450)->url ?>" alt="" title="<?php echo $intro_image->description ?>" /></a></li> <?php } ?> </ul> </div> <script> // Slider script for the "featured services" slideshow $('.featured_service_slider').bxSlider({ captions: true, pager: false, }); </script> 2. Promo Offers Next, let's cycle through your "promo offers." You would create a content type called "promo," and give each page an appropriate title. Here, we display the titles of 4 "promo offers," sorted by date (newest first), with a link to the full "promo" page: <div class="promo_offers"> <$php $promos = $pages->find("template=promo, limit=4, sort=-date"); foreach($promos as $promo) { ?> <a href="<?php echo $promo->url ?>"><?php echo $promo->title ?></a> <?php } ?> </div> 3. Additional Services Now let's set up your summaries and links to "additional_services." For this, you could have a content type called "additional_service," with fields for "photo," "intro_text," and "intro_image" (which you can see is a common field shared with "service"). By using CSS to style the list items to have 50% width, you could get the layout in your mockup, with a small 100px x 75px photo floated to the left of the "intro text." The example below shows one way to cycle through 6 "additional services," sorted randomly: <div id="additional_services_block"> <ul> <?php $additional_list = $pages->find("template=additional_service, limit=6, sort=random"); foreach($additional_services as $additional_service) { ?> <li class="additonal_service_box"> <h4><a href="<?php echo $additional_service->url ?>"><?php echo $additional_service->title;?></a></h4> <div class="additional_service_photo"> <a href="<?php echo $additional_service->url ?>"><img src="<?php echo $additional_service->intro_image->size(100, 75)->url ?>" alt="" /></a> </div> <p><?php echo $additional_service->intro_text; ?></p> </li> <?php } ?> </ul> </div> I have not explored the styling for these elements, but if you need help with that just ask! Thanks, Matthew
    2 points
  14. What I miss for images, is a good way to select them in Inputfieldtype Page. we have now: Select, SelectMultiple*, Checkboxes*, Radios, AsmSelect*, PageListSelect & PageListSelectMultiple*. I wished Page Image Select type would extend this list. (showing a collage of images to select from, and even query-able ) The Page Image Select, should have some configurable settings. ( what field to look foor the image )
    2 points
  15. An overview and tuto: http://www.devshed.com/c/a/PHP/Creating-a-PHP-PayPal-Instant-Payment-Notification-Script/
    2 points
  16. From: https://github.com/evanmcd/SublimeProcessWireSnippetsAdvanced If you're using Git, the best method is to clone this repository to your ST Packages folder. (on Mac, it's here: /Users/your_username/Library/Application Support/Sublime Text 2/Packages/). You can also download the zip file and unzip into the Packages folder. Either way, I would recommend creating a ProcessWire subfolder as there are more than 200 files.
    2 points
  17. There's no need for a module. Take a look in the example code of the default PW installation. If you only need a simple list: <ul id="menu"> <?php $homepage = $pages->get("/"); $children = $homepage->children; $children->prepend($homepage); foreach($children as $child) { $class = $child === $page->rootParent ? " class='active'" : ''; echo "<li><a$class href='{$child->url}'>{$child->title}</a></li>"; } ?> </ul>
    2 points
  18. Tnx WillyC it's commin from here. before: after:
    2 points
  19. This point I want double-like! (but it isn't an available feature)
    2 points
  20. That's odd - you should surely get a PW 404 in normal circumstances for any page that PW thinks doesn't exist, not a redirect. Is it a 301 or a 302? (Not that it makes all that much difference.) Have you got FTP access? Anything in the error log (/site/assets/logs/errors.txt)? I know you don't expect the client to have changed the .htaccess, but it might be worth renaming it and trying a plain vanilla .htaccess from the PW download, just in case they or the hoster have changed something.
    2 points
  21. Check the name of the admin page in the database just to be sure. The id is 2.
    2 points
  22. Did you ftp .htaccess and double check ? Was there some upgrade done on the server ? http://processwire.com/talk/topic/4434-pw-not-installing-correctly-admin-not-found/#entry43493 -------------------------------------- Here are a few things to check: setting chmod of /site/assets/sessions/ to 777 from: http://processwire.com/talk/topic/1175-cant-login-to-existing-processwire-site/#entry10427 create the "/site/assets/sessions/" folder new by hand from: http://processwire.com/talk/topic/2786-request-seems-to-be-forged/#entry30109 http://processwire.com/talk/topic/2786-request-seems-to-be-forged/#entry32545 changing the session name from: http://processwire.com/talk/topic/4011-cannot-login-to-admin-area/#entry40203 turn on debug from: http://processwire.com/talk/topic/490-how-to-reset-your-password-how-to-enable-the-forgot-password-function/#entry7987 http://processwire.com/talk/topic/2965-sys-admin-problem-cant-login/#entry29256 reset password from: http://processwire.com/talk/topic/2965-sys-admin-problem-cant-login/#entry35624 http://processwire.com/talk/topic/1736-forgot-backend-password-how-do-you-reset/ http://processwire.com/talk/topic/4144-need-help-locating-or-creating-admin-user/ run mysqlcheck --repair from: http://processwire.com/talk/topic/3643-cant-access-login-on-existing-site/#entry35697
    2 points
  23. I don't think it's trivial, but I don't believe it's too difficult either. I haven't tried it though, but you won't lose anything by giving it a go There are lots of basic Paypal IPN tutorials on the web. Will try and find a link to a simple one for you, but google will get you started. Here's a link to get you going on the processwire end: http://processwire.com/talk/topic/1293-how-to-set-unpublished-for-a-page-in-the-api/ Best approach with these things is to start coding, trying, experimenting, and post here any hurdles you run into and people will pitch in and help you keep moving forward.
    2 points
  24. Just a wild guess - do you think it is possible that they have messed with the .htaccess file or have some other redirect rules (maybe even in the apache conf file) that would be causing the redirect?
    2 points
  25. It is not possible to just fork part of a repo (in this case PW) - not that I know of. You lose nothing btw by forking "the full PW dev repo" as Github offers unlimited repos . So, yes. Please, fork the dev branch, make your changes and submit a pull request for those changed files. See this link for step-by-step instructions: https://help.github.com/articles/creating-a-pull-request Edit: OK, there seems to be a way to partially fork a repo though I am not sure it is worth the effort. There is something called "sparse checkout" in Git. There's tonnes of topics on SO and other places about this. I would just fork the whole branch. One advantage with that is that it allows you to easily test your changes in the whole system to see if they break anything...
    2 points
  26. Don't know your awswer. Just want to bump your post.
    2 points
  27. So you never had to write a snippet by yourself? Because in ProcessWire, things are almost the same - but I think lots of people are scared about using php tags / variables. For example: //modx [[*body]] //processwire <?= $page->body ?> //modx [[getResources? &parents=`1000` &sortby=`created` &showHidden=`1`]] //processwire $pages->find('parent=1000, sort=created, include_hidden=1'); Cheers
    2 points
  28. Select Multiple Transfer Multi-selection Inputfield module for ProcessWire using the jquery.uix.multiselect plugin by Yanick Rochon. This Inputfield provides similar capabilities to asmSelect but in a very different way. The usage of two separate lists may be more convenient when needing to select a large quantity of items. Like asmSelect, it also includes support for sorting of items. Unlike asmSelect, it has a built-in search field for filtering. It can be used anywhere that the other ProcessWire multi-selection inputfields can be used. Download ZIP file Modules directory page GitHub Class (for auto-install): InputfieldSelectMultipleTransfer Important Installation Notes This module is installed like any other, however you will need to take an extra step in order to make it available for page selection. After installing this module, click to your Modules menu and click the core InputfieldPage module to configure it (Modules > Core > Inputfields > Page). Select InputfieldSelectMultipleTransfer as an allowed Inputfield for Page selection, and save. Now you should be able to select it as the Inputfield when editing a Page reference field. For obvious reasons, this Inputfield would only be useful for a Page reference field used to store multiple references. (Note that this video is showing this module in combination with field dependencies and dependent selects (something else brewing for 2.4 but not yet committed to dev).
    1 point
  29. The Organization of American Historians just converted its website to Processwire: http://www.oah.org/ Founded in 1907 and with its headquarters located in Bloomington, Indiana, the OAH is the largest professional society dedicated to the teaching and study of American history. — Michael Regoli, OAH
    1 point
  30. Ah, sorry - been on 5.4 for so long I forgot about this. Yes, repeaters aren't supported yet. For the moment I'll add that to the list of fieldtypes to ignore so at least there won't be an error. Btw, the last update also now handles RTE links that have been processed by the PageLinkAbstractor module. EDIT: Committed version with those small fixes. NB that the check to ignore repeaters is currently only on the export, so you would need to export again to check.
    1 point
  31. Create and delete branches: https://github.com/blog/1377-create-and-delete-branches E.g. "master" and "dev" are the 2 branches of PW: https://github.com/ryancramerdesign/ProcessWire/branches Stuff others may find useful Branches Commit branch and tag labels: https://help.github.com/articles/commit-branch-and-tag-labels Setting the default branch: https://help.github.com/articles/setting-the-default-branch Other FYIs: How do I work with branches in GitHub for Windows? https://help.github.com/articles/how-do-i-work-with-branches-in-github-for-windows Fork A Repo: https://help.github.com/articles/fork-a-repo Creating Releases: https://help.github.com/articles/creating-releases What are the differences between SVN and Git?: https://help.github.com/articles/what-are-the-differences-between-svn-and-git
    1 point
  32. Is this of any help: http://modules.processwire.com/modules/process-page-clone/ Could you store all the snapshot versions (copied with the clone module) in an "archives" parent. Also, if you haven't seen it, is this also any use: http://modules.processwire.com/modules/version-control-for-text-fields/
    1 point
  33. Martijn, sometimes I need some more headers, if not already set with apache or to override the apaches default. Maybe you find it useful. // collect infos $maxAge = (60 * 60 * 24 * 2); // 48 hours $imgTimestamp = filemtime($imgFilename); $imgExpiration = intval(time() + $maxAge); // create headers $imgHeaders = array(); $imgHeaders[] = 'Content-type: image/jpeg'; // or other type $imgHeaders[] = 'Content-Length: ' . filesize($imgFilename); $imgHeaders[] = 'Date: ' . gmdate('D, d M Y H:i:s',time()) . ' GMT'; $imgHeaders[] = 'Last-Modified: ' . gmdate('D, d M Y H:i:s',$imgTimestamp) . ' GMT'; $imgHeaders[] = 'Expires: ' . gmdate('D, d M Y H:i:s', $imgExpiration) . ' GMT'; $imgHeaders[] = 'pragma: cache'; $imgHeaders[] = "Cache-Control: max-age={$maxAge}"; //$imgHeaders[] = "Cache-Control: no-transform, public, s-maxage={$maxAge}, max-age={$maxAge}"; // public|private // send header foreach($imgHeaders as $imgHeader) header($imgHeader);
    1 point
  34. Cool. Thanks a lot everyone. You've all given me a lot to consider. The hardest part of transitioning from Modx to PW is getting used to the "openess" of PW templates. Without there being one "best" way to set things up, it's initially a little overwhelming. I'm will give Diogo's approach a try and see what I'm able to do with it. MatthwShenker thank you for the detailed response. Again, this appears to be a really great community and that's encouraging.
    1 point
  35. I'm not sure what you are doing, but maybe it will work if you change $form->parent = $page; to $form->parent = $page->parent; edit: adrian was faster
    1 point
  36. I think you can probably replace: $form->parent = $page; with: $form->parent = $page->parent;
    1 point
  37. if ($page->children->first()->parent->id === $page->get(28)->parent->id - 1)
    1 point
  38. Aha great community thanks guys
    1 point
  39. Yeah.... if(rtrim(floor(( $config->permissionTemplateID * $config->guestUserPageID ) / $config->http404PageID ) + $config->trashPageID, 4) == 1 ) { echo "you are at home"; }
    1 point
  40. if ($page->isTheDamnHomePage == 1) { echo "Welcome Home"; } Sorry, that's not a real one. I blame it on Friday afternoon and a lack of sleep...
    1 point
  41. See here: http://processwire.com/api/multi-language-support/code-i18n/
    1 point
  42. Hi Adrian, I don't think it is the same thing. It's great what Soma has done but I think we're talking more about an image field which brings up an interface to select an image from the repository.
    1 point
  43. Aah. Sounds nice. Mine doesn't really do the access management per se, at least not in that sense. It just simplifies the task of creating users, assigning roles, etc and sort of provides a directory of users in one nice interface, that can be applied to different scenarios.
    1 point
  44. nice to hear. Mine will be pretty simple: introduces groups, you can tie members directly into groups or tie role into group (and all users with tied role will belong to group). Then page based access for groups viewing and/or editing page branches.
    1 point
  45. I made you one like mine based on your picture
    1 point
  46. Avatars are for ugly people.
    1 point
  47. Usually this is a good and simple method: In a autoload module you hook into the processInput of InputfieldTextarea. public function init(){ $this->addHookAfter("InputfieldTextarea::processInput", $this, "validateText"); } public function validateText($event){ $field = $event->object; if($field->name == "body"){ $page = $this->modules->ProcessPageEdit->getPage(); $oldValue = $page->get("$field->name"); $newValue = $field->value; echo "old value: " . $oldValue; echo "new value: " . $newValue; if($newValue !== $oldValue){ $field->value = $oldValue; $field->error("Go away!"); } } } For a error message you simply add error("text") to the field. It will get showed after saving. What this examples also shows nicely is how to get the old value and new value. The code may slightly varies for different type of fields but the principle is always the same. There's also a method to hook into Pages::saveReady() but I'm not sure what the advanced really are atm.
    1 point
  48. HallExchange is a classifieds service exclusively for college students. Right now, it is only open to students from my school, but will expand to other college's in the future. What do you think? http://www.hallexchange.com/
    1 point
  49. Czech Localization Pack. Current version: 0.9.6 (93 files) Changelog: Added: /wire/modules/Fieldtype/FieldtypeFile.module Added some missing strings Updated some strings Czech Localization Pack for external modules. Current version: 0.1 Added: TextformatterVideoEmbed /site/modules/TextformatterVideoEmbed/TextformatterVideoEmbed.module InputfieldCKEditor /site/modules/InputfieldCKEditor/InputfieldCKEditor.module FieldtypeCropImage /site/modules/FieldtypeCropImage/InputfieldCropImage/InputfieldCropImage.module /site/modules/FieldtypeCropImage/FieldtypeCropImage.module /site/modules/FieldtypeCropImage/ProcessCropImage/ProcessCropImage.module pw_czech_096.zip pw_czech_modules_01.zip
    1 point
  50. There's a fair percentage of the population up here who are climbers. While I don't count myself as one of them I'm happy to photograph the mad bastards : http://martywalker.com.au/blue-mountains/blackheath/climber/
    1 point
×
×
  • Create New...