Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 02/21/2014 in all areas

  1. New Processwire Website. Built with HTML KickStart. http://www.carscallen.com Feedback welcome.
    10 points
  2. Hi guys, this one comes a bit late since it was published already some time ago. It's the website for a charity in Sollihul. http://www.madhatterscharity.com/ We wanted to do something fun and appealing to both children and adults, and came up with the idea of simulating handwritten type and pen drawings (created by us) on a rough cardboard, and using different colours for each page. The site is responsive, of course More about this work on our website http://www.milktop.co.uk/projects/mad-hatters-tea-party-charity/ And a short post about the drawings http://www.milktop.co.uk/news/mad-hatters-tea-party-the-making-of/
    6 points
  3. Hi Jason - I am currently writing a loooooonggggg tutorial for people like you, but it is a long way from being finished. However, to get you started: Your template file (as opposed to a template) is just html with some bits shoved in it. So the best way to get started is to create a template file called something.php and make sure it is inside the site/templates/ directory. For the moment, dont worry about headers or footers, but just write a bit of very ordinary html. Now, to get around you really need some navigation, but to get you started we will even forget about that. In admin, go to setup > templates and create new. You will see your something.php listed. Click on it and save it. Now, go to Pages, click on Home and click on new. Call your new page, My Page (why not?) and select the template that you have created. Save it, then publish it. Now, to to the front end of your website and in the address bar type yoursite.com/my-page/ And your page will come up - completely blank. But it is a start! Most of this you already know, but there is a good reason for reminding you - when you are lost, it is easier to start with the basics. Now, open your template file something.php in your editor. Somewhere in the body you need to tell the template file to use the fields that are in the associated template in the backend. At the moment, you only have one field: title. So, open a php statement: <?php and we then need to echo out the title: $page - that says we want a field directly related to this page -> tells the system that we are going to define something title - that is the name of the field (not the label, but the actual name) so .... echo $page->title; and end the php with ?> The final thing can be written in one line <?php echo $page->title; ?> Save that and reload the page and you will see the title appear. From this point on, basically EVERYTHING you do will use this workflow: Field > Template > Page > Template file. Now, admittedly it gets a bit more complicated after a while but the principle remains the same - in the template file (or in any file you are including into the template file) you simply retrieve the data you have in the fields and you echo them out so you can see them. Now, that is very, very basic - but that principle is core to the way you will work and once you have understood that, everything else is just variations on a theme!
    5 points
  4. Yes, that's right. I use a 404 log with file: public function init() { $this->addHookBefore('ProcessPageView::pageNotFound', $this, 'hookLog404Errors'); } public function hookLog404Errors() { // determine the URL that wasn't found $url = $_SERVER['REQUEST_URI']; // if installed in a subdirectory, make $url relative to the directory ProcessWire is installed in if($this->config->urls->root != '/') { $url = substr($url, strlen($this->config->urls->root)-1); } $ua = isset($_SERVER['HTTP_USER_AGENT']) ? substr(trim(strip_tags($_SERVER['HTTP_USER_AGENT'])),0,240) : ''; $this->log->save('404-errors', "{$url} \t :: \t {$ua}"); } The API variable $log was introduced with 2.3.1-dev and is available in 2.4 stable now: http://processwire.com/talk/topic/3768-processwire-231-dev-branch/
    5 points
  5. No problem, another alternative would be: $pids = array(1010, 1011, 1022); $downloads = $pages->get("1114"); if (in_array($page->id, $pids)){ echo "$downloads->body"; } This would be cleaner if your list of pages started getting longer.
    4 points
  6. Nice catch horst Can I go one simpler: $pids = array(1010, 1011, 1022); if(in_array($page->id, $pids)) { echo $pages->get("1114")->body"; } or even just: if(in_array($page->id, array(1010, 1011, 1022))) echo $pages->get("1114")->body";
    3 points
  7. @adrian: if the actual page isn't in $pids, there is no need to load page 1114 into memory $pids = array(1010, 1011, 1022); if(in_array($page->id, $pids)) { $downloads = $pages->get("1114"); echo "$downloads->body"; }
    3 points
  8. It is validated and sanitized and throwing error.. But I think its not good if you create own registration and sanitize it before storing as you would end up with different password if you don't take care of showing a error to the user.
    2 points
  9. Check out this module: http://processwire.com/talk/topic/4420-page-list-migrator/ It is still in development, but it allows you to export a hierarchy of pages, templates and fields from one PW installation to another and import them into another PW installation. It currently doesn't copy the actually template.php files, but that is the easy part really A blog setup is definitely one of the uses I am thinking of for this module, but at the moment you will find on the import page of the module the ability to import/create the pages/templates/fields for lists of countries and a few state lists. I really do want to get back to finalizing this module, but it is in a usable state already although I would definitely recommend running it on a test installation of PW and not one with data that you care about first. If it works for your needs then use it wherever.
    2 points
  10. Just stumbled upon this: http://typequest.org/ Type in web is maturing! --- ps: I will watch Porto playing against the club from my second city now
    2 points
  11. 2-2, keeps everyone happy
    2 points
  12. @dragan: that's good to know and definitely not nitpicking -- my intention at this point is to make this module support all native fieldtypes (except images and files, though I'll hopefully get there eventually), including checkboxes. I'm starting to realize that not writing specific tests for multilanguage part was a huge mistake, obviously there are quite a few weird things happening there As soon as I get the time, I'll write a test case for checkboxes (for starters) and see what exactly is going on. It should work.
    2 points
  13. One correction: currently, yes. But there is no hard coded requirement for field to store data in database. It could be Amazon S3, flat file, 3rd party api... anything really.
    2 points
  14. http://modules.processwire.com/modules/service-pages/
    2 points
  15. 2 points
  16. Hi everyone, Another overhaul today. A few bug fixes and a bunch of new features. I have updated the first post here to detail them better, but key things are the ability to make use of the following variables in the filename format: $page, $template, $field, and $file. To accommodate some of possibilities this opens up, eg: $file->description, there is new logic to handle renaming after page save if the filename format can't be properly evaluated at upload because the field isn't available yet, or is still blank. If possible, renaming will still occur during upload - "on save" is just a fallback if needed. Another key addition is the ability to give each rule the option to rename the file again each time the page is saved. There are obvious issues with this if images or files are being linked directly by their URL, so care is needed with this option checked. It does allow for some incredible flexibility though. You could even have a field in your template called "Filename" allowing the user to rename the file whenever they want. In most scenarios of course this would not be at all desirable, but it suited my needs, so thought it might come in handy for someone else as well If nothing else, it might be useful during development, but could be disabled once the site is live. Let me know if you find any bugs with this new functionality.
    2 points
  17. Hi Guys, Probably this has been asked, or have some modules which have the similar functionality. If you think so please link to it . I did searched a lot whether any question is asked. My apologies if I didn't find that. I was wondering whether there is a way in PW which can create the needed fields for my template, and copy the template to the site/templates folder. I noticed the __install() hook can be used to create Fields and FieldType. $field = new Field(); $field->setName('somefunnyfield'); $data = array( 'label' => 'Some nice label', 'type' => 'Page', ); Now the problems are more customization. Is there a module or something that can generate the necessary information from the already created fields? The idea is want to create module say ( Blog ) which has certain fields and that can be installed in any PW installation, which out any changes other than in code. Thank you
    1 point
  18. Wow, amazing...simple little things really do make a difference. That worked and Menu Showed up Apeisa. Now to figure out why the dropdown menu isn't showing... *long night ahead*
    1 point
  19. You have typing mistake, $option vs. $options
    1 point
  20. Hmm - I think it would be much better, if no repeater template settings would be involved? If someone has time to check what it would require to support repeaters without access stuff, please send pr.
    1 point
  21. http://processwire.com/talk/topic/3543-register-users-and-add-page-same-as-username/#entry34854
    1 point
  22. Yes...repeaters, behind the scenes have their own templates You have to enable "show system templates" under : admin/setup/templates filters. Select radio button "Yes" to show system templates (you can disable this later). Then, under admin/setup/templates system, you will see your specific repeater template named "repeater_nameofyourrepeater" - you know what to do from here...
    1 point
  23. I don't think that's what Nico is talking about pwired. I think it's about getting your webserver to send compressed html/css/js over the line via mod deflate or alternatives.
    1 point
  24. Super great! I really like this. Very detailed throughout. I love the form fields too.
    1 point
  25. There is no sorting in that module, it just handles the Pagearray as it is. Sort on date doesn't exists if you don't have a Datetime field called date. if you want to sort on date created it's: $posts = wire('pages')->find("template=post, sort=-created, $selector"); if you want to sort on date modified it's: $posts = wire('pages')->find("template=post, sort=-modified, $selector"); if you want to sort on a date field it's: (thats is what you've done now) $posts = wire('pages')->find("template=post, sort=-nameofdatefield, $selector");
    1 point
  26. Hey kongondo - no worries. Maybe it will be ready for the modules directory sometime soon. I just need to find the time to get back to it - maybe this post will get me motivated to find the time - I do think it has lots of potential and most of the hard work is already done
    1 point
  27. It sounds like you have given the editor edit permissions, but you might need to check the Access tab for the template in question to make sure that role has editing permission.
    1 point
  28. It took my host almost two weeks to complete the installation, but now I have RSVG 2.40.1 installed, and it's working like a charm! The poor tiger's face is no longer destroyed when converted to PNG, and finally looking exactly like it should. This is great. Thanks again for your hard work and help, adrian. I see that you keep pushing updates (I'm on version 0.1.3).
    1 point
  29. I'd definitely like to see this. I use SwiftMailer at the moment and love its object orientated approach over php's mail(). I send most of my mail through Mandrill or Mailgun. I currently use SMTP but it would be nice to have transports that send via their APIs as these offer a few more options. It would also be a really easy route for ProcessWire to receive mail in a standardised manner - you ust provide an enpoint for their webhooks and a hookable method for consuming them.
    1 point
  30. Looking very nice! Great job!
    1 point
  31. It isn't always as simple, but in the case of this module with the way that statement is structured, you can simply replace "live" with "on". If you want you can file an issue over at: https://github.com/NicoKnoll/ProcessPageDelete/issues/new and ask Nico to make the change. I don't think there is any need to worry about detecting the availability of "on" anymore with a "live" fallback, because PW is using jQuery 1.8 which supports "on".
    1 point
  32. This looks great! Nice work. Only suggestion would be a retina version of the logo.
    1 point
  33. Nice one..! Only issue for me is that it could be somewhat "tiring" [can't get a better, more subtle word] to navigate after some time since one needs to scroll down to view the content....which just peeks at the bottom of the screen... Uh, missing image [carcallen-values.jpg] here: http://www.carscallen.com/firm/core-values/
    1 point
  34. Nice - I really like the look with the rockies photos and the geometric patterns!
    1 point
  35. Hi John, Welcome to PW and the forums. 500 internal errors like that normally point to an Apache error, i.e. something on your server. In addition to Adrian's suggestions, note that some web hosts don't allow some rules in .htaccess file, e.g. these: Options -Indexes Options +FollowSymLinks Options +SymLinksifOwnerMatch Comment those out one by one and see if your site loads. If not, also, check /site/assets/logs/errors.txt although I doubt you'll see anything there at this stage.... Other: if you have access, check your Apache error log Are the folders in your /site/assets/ writable? You actually have a .htaccess file? If you do, rename it temporarily to htacess.txt. Does the problem vanish? If yes, then Apache is definitely unhappy with some rule in your .htaccess file. Are you installing in a sub-directory? Version of PW?
    1 point
  36. Just a little word of caution: The fieldtype checkbox is also in the allowed field-types. At least with multi-lang sites, this creates strange entries in the DB: default language: 1 (OK - checked) all other languages: some string value from another, totally unrelated field Maybe leave out checkbox input type in the module config / settings dialogue altogether? (I know, I'm nitpicking here... to avoid confusion, I have removed that field from the watch settings)
    1 point
  37. David, Welcome to PW and the forums. This module is now part of the core so you don't need to install it this way. If you are using PW 2.4 (i.e. the latest version) you should see it under the "Core" tab under /modules/. I believe its called "Languages Support - Tabs" (see category Language)
    1 point
  38. Better approach would be autoload module, that will hook into 404 error, and saves hits into a custom db table (instead of fieldtype). See https://github.com/apeisa/ProcessRedirects/blob/master/ProcessRedirects.module module, since it is pretty close (it checks 404:s for redirects). Here is the relevant hook: https://github.com/apeisa/ProcessRedirects/blob/master/ProcessRedirects.module#L20
    1 point
  39. I haven't read your code of the project. Just want point out that: If you have to call PHP scripts directly (not include them), with it's URL, you cannot store them into the sites/... folder. If it is only one script, you may place it into the root besides the index.php of pw. Also if you want / have to collect some output from that script within pw, you can bootstrap PW within that script, store a result into a $session->var and also use $session->redirect according to that output, if you need that.
    1 point
  40. You may do this by a module like that: public function init() { $this->addHookAfter('ProcessPageListRender::getPageLabel', $this, 'addPageListLabelItems'); } public function addPageListLabelItems($event) { $page = $event->arguments('page'); // then you do your conditionals and your styling, like for example: if($page->myField >= $myMinValue && $page->myField <= $myMaxValue) { // add your styling here } // or like that: if('architekt'==$page->template) { // add the styling here $styleItem = $page->ortarchitekt == '' ? ' <span class="jhpPageListItemEmpty"><strong style="color:white">kein Ort eingetragen</strong></span> ' : ''; // now add the new style item to the existing output $event->return = $event->return . $styleItem; } } This way I get outputs like that: EDIT: Ah, have found it: here is a module from Soma: http://modules.processwire.com/modules/page-list-image-label/ that adds a Thumbnail to the list. That was the startingpoint for my customized PagetreeList. If you are not (yet) familiar with modules please have a look to the HelloWorld-Module or ask here for further assistance
    1 point
  41. @mbrett5062 Hello, welcome to the PW forums, and thank you for posting! I am not personally familiar with Drupal but I have become familiar with PSR-0/1/2 in the last year, along with composer and packagist (nice mention @SiNNuT) -- both of which I highly recommend as they have really helped me kickstart various projects since I found out about them. @all Although my (now historical) personal coding style preferences were not reflected in PSR-1 and PSR-2 I have now adopted them for all my PHP work and it probably took all of a week after making the decision to adopt them to start using them fluently. It really wasn't hard once the decision was made. As one of the maintainers of the Textile formatting library I was starting to get feedback from users who were dropping textile because it wasn't PSR-1 and 2 compliant. This meant that including the textile library in their projects was causing their projects to fail compliance tests (many folks were using things like phpcs as part of a CI setup.) Going PSR-1 + 2 compliant fixed that, widening my experience in the process. Whilst I don't see PW being used in quite the same way as textile, having textile up on packagist has been a big win for our little project. As PW does come at things as a content management framework (not just a CMS) it may well reap some benefit from PSR-0 compliance and packaging for composer, as that will gain it more exposure and make it really easily accessible as a component in larger projects. Bottom line: I'd love to see PW move over to at least PSR-0 compatibility and available via composer. The other bottom line: My old preferences as to coding style were holding back textile - I'm now glad I switched.
    1 point
  42. I've been working on this one for a few months and just launched it this morning: http://villasofdistinction.com I also did the previous iteration of this site, 5 or so years ago (which was running ProcessWire 1.0). The new site is powered by ProcessWire 2.4 (2.3 dev). The site is responsive and designed for a good experience on both desktop and mobile. While I did all the development, the site's design/look and feel was created by the client (they have their own internal design agency). Most of the work in this project was actually not anything you can see on the front end. Instead, most of the work went towards back-end management, workflow and web services. The client has a large number of editors and agents that needed various capabilities, workflows, feeds and such. So there's a lot more going on here in terms of a management platform than in the previous iteration... and that's mostly what kept me busy for so those few months. Modules used here: Foundation 4 Profile All In One Minify (AIOM) FieldtypeMapMarker (with MarkupGoogleMap) Pro Cache Form Builder Hanna Code Redirects Selector test Changelog Version Control for Text Fields Batcher Admin Template Columns CKEditor Select Multiple Transfer CollagePlus And a few custom modules
    1 point
  43. I find this useful. And I have searched the core code (wire) and found only three function calls: https://github.com/ryancramerdesign/ProcessWire/blob/master/wire/core/shutdown.php#L73 https://github.com/ryancramerdesign/ProcessWire/blob/master/wire/modules/Process/ProcessForgotPassword.module#L166 https://github.com/ryancramerdesign/ProcessWire/blob/master/wire/modules/Fieldtype/FieldtypeComments/FieldtypeComments.module#L290 It could be replaced by a hookable function called pwMail() or something like that. public function ___pwMail($to, $subject, $message, $additional_headers=null, $additional_parameters=null) { return @mail($to, $subject, $message, $additional_headers, $additional_parameters); }
    1 point
  44. ups... I didn't realize that modules now have separate Core tab finally perfectly works! Thanks, Soma.
    1 point
  45. I had a problem with this module before I discovered this thread, getting the same error Martijn Geerts noted above. After taking a look at Ryan's original Vimeo/YouTube module, I changed line 117 from: $this->embedSoundcloud(&$str); to: $this->embedSoundcloud($str); removing the "&" in red before "$str" in the first example above. Now it works as expected, including multiple embeds on a single page. However, there is one anomaly: unlike the Vimeo/YouTube module, this Soundcloud module is sensitive to its order among other TextFormatters (in Edit Field --> Field Type Details --> Text Formatters). The SoundCloud module won't embed when Markdown Extra module follows it, but embeds OK when Markdown precedes it. I hope that makes sense, thanks for your work on this, Marvin!
    1 point
  46. Mine do! If possible I like to surround it with bouncing ball, flashing arrows and a horde of Angels singing "We'll meet again" Oh, and I tend not to have it linked .... This is one for Bootstrap classes. (I have left off the dancing chihuahuas) <ul class='breadcrumb'> <?php echo "<li><a href='{$pages->get("/")->url}'><i class='icon-home'></i></a> </li>"; foreach($page->parents as $parent) { echo "<li><a href='{$parent->url}'>{$parent->title}</a> <span class='divider'>/</span></li>"; } echo "<li class='active'>{$page->title}</li>"; ?> </ul>
    1 point
  47. I've used this script, built from stuff I learned here to back up sites in the past. It will only work on Linux hosting though. To use it, create a folder above your public_html folder called "backups". In this create two folders called "site" and "db". It must be above the public_html folder else you will end up backing up your backups and you will soon run out of disk space that way Now you need to open the attached file and change the path near the top to the path to your backups folder. Next, scroll down to line 41 and enter your site's root username and password (or a database users that you have created that can read all relevant databases for your site). That's it really - upload it into public_html and call it via a web browser to test it, but it should backup the entire contents of public_html and all databases, plus as a special bonus your mail folder, which on this type of hosting means that even if the whole server bursts into flames you can just re-create the mailboxes, put that folder back and the mail is back too Since it uses system commands to run the backups it won't work on restricted hosting, but the easiest way is to follow the above instructions and if it creates files in your /home/yoursite/backups/site and /db folders that have a filesize greater than 0kb then it will work on your hosting. Because it uses system commands rather than PHP to back up, it won't mater much what size your site is and is suitable for sites in the gigabyte range (all depends on your hardware of course). The other thing to note is that it keeps 7 days of backups and cleans out anything older. You can change that by altering the $livecutoff variable to something other than 7. This could use some improvement of course, but I use SyncBack Pro to download the backups each day to a local drive, and also periodically back these up to an external drive kept elsewhere (can you tell I've had trouble with hosting and hard drive failures before? ). cronbackup.php
    1 point
  48. This example assumes that you've already setup your fields and added the pages just as they are in the link you posted. It further assumes that each staff member is a page living under /about/staff/. An example would be: /about/staff/jemma-weston/ I'm going to assume these are the field names: title (person's first/last name) image (person's photo) team (per your link) job_title (per your link) email (per your link) To output the staff listing, you would do something like this: <?php echo "<ul class='staff_listing'>"; foreach($page->children as $person) { if($person->image) { // make 150px wide thumbnail $image = $person->image->width(150); $img = "<img src='{$image->url}' alt='{$person->title}' />"; } else { // make some placeholder (optional) $img = "<span class='image_placeholder'>Image not available</span>"; } echo " <li> $img <ul class='staff_detail'> <li><strong>Name:</strong> {$person->title}</li> <li><strong>Team:</strong> {$person->team}</li> <li><strong>Job Title:</strong> {$person->job_title}</li> <li><strong>Email: {$person->email}</li> </ul> </li> "; } echo "</ul>"; Optional Another scenario might be where you want the "team" or "job_title" fields to be from a pre-selected list, and to themselves be pages that the user could click on to view everyone in the "Audit and Accounts" team (for example). The way you would set that up is to create a new structure of pages that has all of the Team types (and/or Job Titles), like this: /about/staff/teams/audit-and-accounts/ /about/staff/teams/business-services/ /about/staff/teams/practice-management/ ...and so on... I would use a new template for your team types, something like team_type.php. The only field it needs to have is a title field. At the same time, I would move your staff members into their own parent like /about/staff/people/. In your staff template, you would make the "team" field be of the field type called "Page". When you create it, it will ask you from what set of pages you want it to use, and you can tell us to use /about/staff/teams/. It'll ask you if you want it to hold one page or multiple pages (PageArray), and you'll want to choose Page (one page). Likewise, where it asks you to select what type of input field you want to use, choose a "Select" or "Radio Buttons" field (and not one of the multiple select types). Add that new "team" field to the staff template, and when you add/edit a staff member, you'll select a team rather than type one in. Your markup to output that field in the staff listing would instead be like this: <li><strong>Team:</strong> <a href='{$person->team->url}'>{$person->team->title}</a></li> Your team_type.php template would list the staff members just like your main /about/staff/ page did (it might even be good to include your staff_list template to do it for you, or convert it to a reusable function), except that it would load the staff members like this: <?php $staff = $pages->get("/about/staff/people/")->children("team=$page"); foreach($staff as $person) { // ... } The main thing to note in the example above is the "team=$page" portion, which is essentially telling ProcessWire to pull all staff members that have a "team" field that points to the current page. So if you are viewing the /about/staff/teams/audit-and-accounts/ page, then it's going to load all staff members that are in that team.
    1 point
×
×
  • Create New...