Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 03/14/2013 in all areas

  1. Some additional updates posted to the LanguageSupportPageNames module. Previously you could only define multi-language page names after the page already existed. Now you can define them when you are adding the page. See screenshot.
    8 points
  2. This is a companion tutorial to the Basic Website Tutorial and the Simple News Tutorial. This tutorial teaches you how to create a multiple album gallery system in processwire using a lightbox plugin (colorbox) and a slideshow plugin (Flexslider). As with all tutorials, it is meant as a starting point for you to create your own system rather than an instant plugin. This can be used standalone on a new installation of ProcessWire, but it was initially designed on top of the Basic Website Tutorial structure. If you are new to ProcessWire, then I suggest doing that tutorial first. http://wiki.processwire.com/index.php/Simple_Gallery_System Joss
    3 points
  3. You could also create a module that would hook to save and update a field holding the value of modified minus created. Then you could use $pages->find("modified-created>0");
    2 points
  4. I'm using MySQL Dumper to backup the database. Configure it once and then you will have your backups as tar.gz files on the server. Now you could use Cobian to save these or - another feature of the MySQL Dumper save the backup to an external FTP server. It's running for two years now on my old forum without problems.
    2 points
  5. Hi Totoff, HeidiSQL for Windows is a nice tool which can do manually Backups from Databases. Not only dump into files, also transfer from one DB to an other, and some more. But DB's must be accessible from outside, not only from localhost.
    2 points
  6. Note: added some clarifications and corrections to my post above, I'm still stuck to some bad habits learned from PHP 4. Posting here to notify anyone who's following this thread (plain edit's don't seem to cause notifications or make the thread show up in list of new content..)
    2 points
  7. Thanks VERY much teppo and adrian; I am relieved to say I actually understand the concept of scope (a bit) and so I totally get the distinction. I had just never realized until now that the PW API stuff such as $input->urlSegment1 were not somehow 'god-mode' things that worked everywhere, now I know they are (sensibly now I think about it) limited by scope in a similar way to variables I can totally see that some other construct such as wire is needed to show I need to look 'outside' the function. Brilliant! I feel I have learnt something subtle but significant thanks to you helpful fellows, thanks again!
    2 points
  8. Slightly longer explanation is that it's a problem with scope; you might want to take a closer look at PHP manual entry about variable scope. Essentially you need to use wire() (which is a function) instead of $input (which is an object and thus subject to same scope rules as variables) when you're in the context of a function. You could also pass the function a copy of (or reference to) whatever object or variable you want: function fDtest($input) { if(isset($input->urlSegment1)) echo ":)"; else echo ":("; } echo fDtest($input); .. but that's probably not what you want here. Anyway, hope this helps clear things out a bit Edit: removed reference sign from function call, that way of using references has been deprecated in PHP 5.3.0 and removed from 5.4.0.. and it wasn't even necessary step here, since in PHP 5 objects are by default passed by reference (kind of.) Because of this you need to be very careful when making any changes to objects such as $input inside a function since it'll affect global scope too. To pass an object by value you'd need to use clone instead. Variables, on the other hand, need to be prefixed with reference sign "&" in function definition in order to pass them by reference -- by default they're passed by value.. Thanks to @Nik for pointing these out, my information was outdated!
    2 points
  9. codecademy recently started an interactive php course for beginners. http://www.codecademy.com/en/tracks/php looks good so far. i was not sure if it fit's the "getting started" section of the forums, but maybe it's an interesting hint some people. maybe someone has links to add.
    1 point
  10. A short tutorial/help package aimed at new users (Note, a more step by step version of this tutorial is now available on the Wiki as a follow on to the Basic Website Tutorial - http://wiki.processwire.com/index.php/Simple_News_System ) - BE CAREFUL - don't mix the two. Either use the wiki or my files, not both at the same time. To be honest, you will learn more using the wiki version. This is an example script showing how to create a very basic news system with categories in PW. It includes templates and functions and full instructions of how to use it, which fields to create and so on. This is NOT a module or an instant solution, but it will help get you going faster if you have not done this sort of thing before. This example is for when you have a site carefully constructed round the page hierarchy, but want to add a basic news or blog that sits at least partly outside that tree. The system helps you to create a single news page that lists articles that are stored under a hidden parent. The articles are sorted by category - categories are created under another hidden parent and are selected with a page field. Full instructions are in the main newsfunctions.inc script and everything is commented. You can find it all here: https://github.com/jsanglier/Pw-News Joss PS: This is just one way to do a news system and should be taken as an example, not as the best way.
    1 point
  11. Hi all, So, I've got a site that's being migrated from Joomla (ouch) that has a bunch of pages at the root - i.e. http://site.com/page1 http://site.com/page2, etc I know I could just create these in the admin below the home page, but, as I've got dozens and more being added all the time, I'd rather keep them as sub pages under a generic structure page, which I'd call something like "Landing Pages". But, of course that would leave me with http://site.com/landing-pages/page1, etc I know I could add htaccess rules for each specific page, but non-devs will adding these pages, so that's not a good option. I've looked at Netcarver's URL Shortener module a bit, and that may be an option. But, ideally I'd be able to have it managed all from the page itself. What do you all think is the best way to manage this? Thanks. P.S. Working with Joomla has made me appreciate PW all the more. I'm sure it's good for some people but... yuch, not for me
    1 point
  12. hi there! after playing a bit with pw, i decided to choose my own new website as a first project to test it. im realy happy with it and i will use it as my number 1 choice for my own clients in the future. the first time working with an cms i've got not the feeling that i need to "fight" against it. i was realy suprised how easy it is to use ajax with pw, which i did for my references page, i'm still looking for an easy to implement url/hashbang ajax-solution - this is something i will add in the future to the site. a little blog will follow:) http://chrisvaupel.de constructive critics are welcome PS: it's a small site, but i bought procache and formbuilder, becouse i was curious and wanted to give a little bit of money support - anyway, i just like to say that booth are working realy well
    1 point
  13. Ha, the awesome Soma made this autoload module which adds the properties to the page: https://gist.github.com/5166076 so you can do: $page->is_hot =D
    1 point
  14. So I asked in the irc channel, and Soma was so kind as to list a ton of solutions, the best being (imo): $page->status->has("name=is_hot")
    1 point
  15. You can do this instead, and then cache it. http://processwire.com/talk/topic/2210-help-getting-a-custom-styles-php-file-working/?p=20641
    1 point
  16. Thanks for the links! Here are some I have bookmarked: 01. http://net.tutsplus.com/tutorials/php/the-best-way-to-learn-php/ 02. http://php.net/manual/en/getting-started.php 03. https://phpacademy.org/ 04. http://www.coursehero.com/courses/5/Intro-To-PHP/#intro 05. https://tutsplus.com/course/php-fundamentals/ 06. http://net.tutsplus.com/sessions/codeigniter-from-scratch/
    1 point
  17. Selectors have to have a defined value after the operator. There is no defined value in "modified>created", as those are two fields. You can go straight to SQL to accomplish this one: $pageIDs = array(); $result = $db->query("SELECT id FROM pages WHERE modified>created"); while($row = $result->fetch_row()) $pageIDs[] = $row[0]; $pageArray = $pages->getById($pageIDs); // $pageArray contains what you want
    1 point
  18. At the top, I'm thinking you want to add something to avoid acting on pages that aren't of your defined type. Something like this: if(!$page->template != 'project') return; Because this is a single-page reference field (from what I can tell above), I don't think this line would work: $page->project_status->remove(1157); That's calling the remove() method of $page, which just unset a value. Since the page likely doesn't have a variable named "1157", the line above essentially does nothing. What you would want to do instead is set project_status to be a blank value, or another page. $page->project_status = null; // this $page->project_status = $pages->get('some other page'); // or this
    1 point
  19. The link side is just hitting the link button in the TinyMCE editor that comes automatically with the Body field or can be added to any textarea field (under the details tab). With images, when you click on the image button on TinyMCE it will open a popup that will list any images you have in images fields for that page. NOTE: If you are going to allow users to insert images into the TinyMCE editor, probably ought to make sure there is an images field in that template! (You can also insert images from other pages on the popup). When you select an image by clicking on it, you can select alignment, select whether you want it to be linked to a larger version (the original) of the image, and select the size. PW will create a cached version of that image size automatically. There are some extra tricks you can do. If you are using a lightbox system like Colorbox (as I use on the Simple Gallery Tutorial) you can add a little bit of JQuery to insert the right classes into the image you have inserted into TinyMCE. The html produced will be something like: <div "myarticlecontainer"> <p> blah blah blah </p> <a href="/path/to/image.jpg"> <img src="/path/to/image-300x200.jpg"> </a> </div> This is the result of you returning your textarea/TinyMCE field inside a container of some sort. So, if you add some JQuery to your page that looks for that sort of construction, then you can add the correct class and any other attributes for your lightbox. $('.myarticlecontainer img').closest("a").addClass("colorbox ").attr('rel', 'group'); This looks for image fields within your <div> and then adds a class and rel="group" to the <a> tag that surrounds it. By keeping it within a specific container, it stops it adding it to strange places! Obviously, you must have JQuery and Colorbox installed in your tempates, but I cover that in the gallery tutorial.
    1 point
  20. I noticed that when I resize the image in TinyMCE in Chrome it wouldn't resize really. The dragged image is smaller and width and height set in image tag. But when saving and looking at source the image is still the original! I noticed this because of responsive image css with max-width: 100%; It wouldn't show scaled version but still same size. In FF it worked and I tracked it down to in Chrome the click event check for the nodeName wouldn't return IMG for the first mousedown event for some reason. The check for the nodeName on the selection of TinyMCE would not return "IMG" . After trying to find a solution deperately I found a really minor fix that solves the issue in Chrome while it still works in FF. The trick is to just get the event.target instead. And I hope in other browsers it still works too but I'm sure it will. But maybe with IE could test this out? I made a pull request on the responsible TinyMCE PW plugin file. https://github.com/ryancramerdesign/ProcessWire/pull/174 Changed file https://github.com/somatonic/ProcessWire/blob/7c4d160152aae3aeb33b68a852c45c35008b0b54/wire/modules/Inputfield/InputfieldTinyMCE/plugins/advimagescale/editor_plugin.js
    1 point
  21. It looks okay to me. I would double check that $timestamp is an integer (which PW wants if you set it as a literal unix timestamp), so you may want to typecast it: $timestamp = (int) $timestamp; PW will happy take a string or integer, but if it's a string, it assumes it has to run it through strtotime() first. Whereas if you give it an integer, it knows it's a unix timestamp and doesn't attempt to translate it.
    1 point
  22. The issue is that these two statements are not compatible: From what I can tell, almost every page on your current site has information stored in the database so there is no simple "file" to edit to change content - that's the main roadblock for you in terms of finding a simple solution. I honestly think you'll have to move the content across to any system you look at, be it ProcessWire, Perch or any others (Perch works with static files, your site appears to be mostly database-driven and would need to remain database-driven for things like the search and other functionality to work). ProcessWire is based around pages and all sorts of content is treated as pages. It uses its own database so you can't just say "use this unknown database here for old pages and the PW database for new pages". Even if the database structure were the same (and I guarantee they won't be) it would still be very difficult to achieve and not worth your time. To get any CMS playing well with your current database you would have to write a lot of custom code, which is far harder than simply (and I realise it's not that simple) importing the current site into ProcessWire. I do believe though that moving the existing content into ProcessWire would be easier than any other CMS I've used, and I've used quite a few over the years. The beauty is the content is already in a database so we don't have to parse any static pages to do the job - it means the relevant field contents from the existing DB can be more easily ported to related fields in ProcessWire. For example, you can bootstrap the API in an external PHP file, query and iterate through your current database and create pages like this: http://processwire.com/talk/topic/352-creating-pages-via-api/ There's no need to overhaul the site - the existing page templates are fine if you're happy with them - the content just needs moving across and all page queries replacing with ProcessWire selectors, which is easier than it sounds at first (and results in far less code ).
    1 point
  23. the value of a repeater is pageArray, so getNext() should work. What value are you using as the parameter? Edit: Ok, quickly tested, and everything works as expected. I will post here my test so you can analyze and make sure that you are using it the right way: $repeaterArray = $page->repeater; $firstElement = $repeaterArray->first(); echo $repeaterArray->getNext($firstElement); //returns successfully the second element echo $firstElement->next(); //also returns the second element
    1 point
  24. Well, bit of fun - and it is meant to be what I do as a living! It is rather tatty, I am afraid, but I got the challenge at 7:58 on the 23rd feb from Diogo and got it finished and posted at 9:26 the same day - so I didn't have time to refine it! Glad you liked it.
    1 point
  25. Use filter on template screen above to show system templates. Select user template add fields to it you want.
    1 point
  26. Thank you so much for your considerations and guiding! You see me diving into another phase of learning stuff for the first time. I think I'll try to build a module. Should I ever finish it and anyone might possibly find it useful, I'll publish it on your site.
    1 point
  27. Hi Ryan, only need read-access to: $filename $extension $imageType $image $modified
    1 point
  28. Thanks Ryan and Antti! To get the source option working with inline mode you need to download the new plugin http://ckeditor.com/addon/sourcedialog and then include it in the extra plugins - sourcedialog and then in the toolbar layout - Sourcedialog.
    1 point
  29. Wow, this fixed the problem... I solved it in XAMPP by uncommenting ;extension=php_openssl.dll in xampp\php\php.ini , u've gained one like
    1 point
  30. This is already implemented in the upcoming version 2.3. Try it yourself by downloading the Dev branch on GitHub.
    1 point
  31. Aaaaand another time: Thanks, Ryan...
    1 point
  32. OK, it's been a while since I looked at this, and much of it was inspired or guided by Ryan. I had to boil it down a little to make it generic enough to make sense, so this exact code hasn't been tested, but it should get you started. Here's a proof of concept that works. Template for your calendar page <?php function pagesToJSON(PageArray $events) { $json = array(); foreach($events as $event) { $json[] = pageToArray($event); } return json_encode($json); } function pageToArray(Page $event) { $data = array( 'id' => $event->id, 'title' => $event->title, 'start' => date("Y-m-d H:i:s",$event->start_date), 'end' => date("Y-m-d H:i:s",$event->end_date), 'url' => "./$event->id", // event ID is the url segment ); return $data; } if($input->urlSegment1) { // event ID provided as a URL segment to this page $event = $pages->get("id=$input->urlSegment1"); include("./includes/head.inc"); echo $event->title; echo $event->body; include("./includes/footer.inc"); } else if($config->ajax && $input->get->start && $input->get->end) { // fullCalendar making an ajax request of events $start = (int) $input->get->start; $end = (int) $input->get->end; $events = $pages->get("/calendar/")->children("sort=start_date"); $events = pagesToJSON($events); echo $events; } else { //display the calendar $config->scripts->add('/site/templates/assets/js/fullcalendar.min.js'); $config->styles->add('/site/templates/assets/css/fullcalendar.css'); $config->styles->add('/site/templates/assets/css/calendar.css'); $config->scripts->add('/site/templates/assets/js/cal.js'); include("./includes/head.inc");?> <div id="calendar"></div> <? include("./includes/footer.inc"); } // end else ?> head.inc <!DOCTYPE HTML> <html> <head> <title><?=$page->title?></title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <!-- CSS includes defined via $config->styles->add --> <?php foreach($config->styles as $url) echo "<link rel='stylesheet' type='text/css' href='$url' />";?> <!-- include jQuery --> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.3/jquery.min.js" type="text/javascript"></script> <script>!window.jQuery && document.write(unescape('%3Cscript src="/site/templates/assets/js/jquery-1.6.3.min.js"%3E%3C/script%3E'))</script> <!--js includes defined via $config->scripts->add --> <?php foreach($config->scripts as $url) echo "<script type='text/javascript' src='$url'></script>";?> </head> <body> footer.inc </body> </html>
    1 point
  33. Greetings, As Soma explained, you can turn off the need for the title field. However, I would want to make sure this is a good idea. If you ever need those pages for other purposes, you'll likely want the title. Also, the "title" can be anything (any field). It does not need to be an extra field, and the user does not even have to know that it's a "title." For example, I'm working on a site with separate pages for numerous retail stores. Stores each have a unique "store number," and I just made that the "title." The user does not know that when they enter the store number they are simultaneously creating a "title," but now I have that bit of information to use in my template code. Based on your description, it sounds like your users are already building invoices through field entries. Maybe just use the "invoice_number" field as the title? Thanks, Matthew
    1 point
  34. Remove global flag from title so you can remove it from templates. Name field is required, as it is sort of the "id" of the page that is needed to have.
    1 point
  35. And does it work? I don't know really what is if it doesn't work. Maybe something like this? http://stackoverflow.com/questions/5444249/unable-to-find-the-wrapper-https-did-you-forget-to-enable-it-when-you-config
    1 point
  36. http://urbanmotionbeats.info About the site Urbanmotionbeats is a party website featuring facts about events, galleries and a list of DJs. The main goal was to create a site, where they can upload their photos after a party. Processwire was perfect for this: We could make a template with all details about an event, add the image field and were ready to go. Features Processwire with ProCache enabled together with Lazyloaded images for a good page speed Event template with gallery and several text fields Homepage with random images, latest events and some text. Integration of the Facebook Comments and like boxes Responsive/Adaptive Design, because a lot of people will using this from their smartphone Problems We mostly had client problems. How to use the admin backend. Where are the limits of the Backend? How can I do X? Why does Safari on Windows not work with Drag'n'Drop? I've never though about, what would happen if someone uploads 300 pictures from a DSLR with 20MB each (Script Timeout). We've fixed most problems but also learned alot. Overall you can say, Processwire performed well. If our not so tech-savy clients would have to use another more bloated Backend they would be totally helpless. What's next? This site is only the first in a row. Other event "brands" from them will follow with a slightly modified design. We've written a JSON output so we can later combine all events from all sites (4 are planned) together in a portfolio site with a more business focused audience.
    1 point
  37. I stumble upon Object Oriented Programming in PHP tutorial. I quickly glance over it and looking good. http://www.tutorialspoint.com/php/php_object_oriented.htm
    1 point
  38. yup, php is the language that drives the web - and processwire. I wished I started learning php 10 years ago. https://tutsplus.com/course/php-fundamentals/ http://www.w3schools.com/php/default.asp http://www.tizag.com/phpT/
    1 point
  39. Hi everyone, Event Mentor is now running on ProcessWire and ProCache (it previously on Hero Framework). It's also linked up with DigitalDeliveryApp to handle payments and digital downloads. Site design by monodesign. Cheers Marty
    1 point
  40. Great find diogo. And in case you guys don't know about it, there's very useful extension named WhatFont that I use all the time to know what fonts are used on the pages I'm browsing.
    1 point
  41. Okay this was very short notice so it is incredibly rough! But this is for Diogo and all those others wedded to PW http://21stcenturyblues.co.uk/pwdream1.mp3 (Organized, try listening at less than 120db!)
    1 point
  42. Not wishing to repeat myself here......
    1 point
  43. I've been working on a site recently that is in WordPress, and have wasted several hours on not noticing that the previous dev had used a mad-crazy image based menu system (should have inspected the CSS more closely). Since I'm not used to WordPress, I was trying to sift through the many (and, in a lot of cases for this site, unnecessary) plugins to find the fault. So okay, it was partially my fault for not noticing that, but just the whole rest of the experience has drawn a line in the sand - everything is so difficult and time-consuming to achieve that I think even if I knew it inside out it would still be long-winded So, no more WP clients for me, thanks all the same, even if there are big bucks on the table it's not worth my sanity any more and is too draining. I'd much rather roll out/update PW sites and enjoy myself rather than tear my hair out over the many and varied caveats of working with WordPress. Call me lazy, but I think it's more about using the right tool for the right job.
    1 point
  44. Okay, I admit I quite like designing forms too - getting the layout really nice and logical so the user is easily walked through the process is really satisfying. There is an amazing amount of human psychology in a good form design! Not that I am any good at it, mind you!
    1 point
  45. Thanks for the welcome Can't say I have a lot of time on my hands, but our real time analytics showed a new link sending traffic our way, so thought I would check it out
    1 point
  46. There is other CMS'???
    1 point
  47. Hi antknight That wouldn't work - like I wrote that would produce an error 500. However, I found the cause of the problem in the .htaccess file: #Options +FollowSymLinks Once I commented out this directive, the problem disappeared. I found the solution here: http://www.wallpaper...pache-t718.html And a general explanation of the directive here: http://www.webmaster...orum11/1962.htm I hope this helps others with the same problem. /Allan
    1 point
  48. Hmmm, think I have it. Got the feeling it was to do with the path part of setcookie, Ryan's tip to have a look in Chrome was a good one, the path was getting set for that page only and just specifying "/" didn't work, I had to add null to the domain part as am on localhost setcookie("InfoBar", $info_bar, time()+3600, "/", null);
    1 point
  49. Thanks for sharing your experience. I stopped working on WordPress sites some time ago, but I offered to help a friend with his WordPress site recently and was surprised by how little had changed. That's rarely the case, but I did have a big client request WordPress once. They were very amenable to other suggestions though, as the work got rolling. Pretty soon the WordPress site was a thing of the past, and the character of the work changed toward a more flexible, powerful collection of tools and resources. Earlier this year I sat in a meeting with a client, across the table from a social media consultant who looked at me and said at one point, "we are using WordPress for this site, correct?" I was sort of shocked, but she didn't really know of any other software, and was used to using WP for everything. She is a bit frustrated that she has to re-train just to use a client's site, but what can I say...it's not like learning new stuff is some rare thing in our industry. This client would have been lost with WordPress. I'm even frustrated by MODx these days, so I must be turning into a real CMS snob. Just got a client's OK to move a large, fairly prominent MODx site to ProcessWire after I built a newer, smaller site in PW for them. So looking at my work, it'd almost seem that "the right tool" is always ProcessWire. But I think it's mostly that ProcessWire is a flexible tool that is well designed to solve common problems.
    1 point
×
×
  • Create New...