Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 01/27/2013 in all areas

  1. http://pwdemo2.stonywebsites.co.uk/ This is built on my Bootstrap profile and is simply a demonstration site for clients - which may explain the slightly odd copy. Images are out of stock (and then heavily processed!), except the food images which are mine (I did the cooking too!) The demo includes a block creation and management system, a news system (ultra simple), a slideshow and is fully responsive (as is the admin ) I started the site from scratch at eight this morning, had half an hour for lunch and took the dog out for two hours this afternoon. It was developed on a local server and then uploaded to a sub domain. The entire site is only just over 4 mb including large images. It loads nice and fast!! (Thanks Ryan) There is NO WAY I could have done this so fast on any other CMS - the only way I could have done it as fast would have been as a static site - but then it would not be easy to manage. Don't you just love this system? Joss PS: The ice cream on the food page is mine - made over the summer from our own home grown strawberries and then mixed in a very basic ice cream maker with just a dash of cornish clotted cream. Thought I would drop that into the mix.
    5 points
  2. I can see why you exploded the relatedPages as when you echo $page->relatedPages it outputs a string of page ID's with a | character separating them, so what you did seems logical if you're not familiar with the API, but as teppo says you don't need to do that. It is basically a PageArray of it's own and that | separated list of IDs is useful if you want to use that in a selector - something like $pages->find("id=$page->relatedPages, images.count>0"); <-- So you could do something like that to only return related pages with 1 or more images if you see what I mean. The other thing to note is that since it's a PageArray, you can loop through as teppo says, but don't think that it's adding extra overhead. The act of grabbing fields as you need them in the foreach loop is pretty efficient in terms of speed - it doesn't grab all the fields for each page, just the ones you need as you need them (so I understand). I think ryan said it best elsewhere that there might be a few extra queries this way, but overall you're making savings in terms of storing data in memory and since each field is a table and well-indexed it's arguable as to whether there is any speed difference at all from other systems where all of a specific template's fields are stored in a single table. Not sure why I felt the need to try and explain some of the mechanics, but there we go. I'm sure someone could explain it better than I did as well
    3 points
  3. Hi casey, You can use $image->url foreach($page->images as $image) { $big = $image->size('', 800); $thumb = $image->getThumb('thumbnail'); echo "<a href='{$big->url}'><img src='{$thumb}' alt='{$image->description}'/>"; } The Cheatsheet is very handy to check methods and properties: http://processwire.com/api/cheatsheet/ Cheers
    2 points
  4. I had a chat with ryan about this a while back and I hope he won't mind me mentioning this, but some commercial profile ideas (real estate etc) would benefit hugely from the inclusion of FormBuilder. It's win-win in that case as ryan sells a FormBuilder license with every sale of that theme and the theme developer makes money as well. So if you've got any ideas where you think a complex theme is going to give you a headache in terms of forms then think about how you might do it packaging FormBuilder along with it to handle that aspect. Of course there are some logisitcal things to work out there, but it's something to bear in mind and certainly opens up some possibilities. For those that are curious, I originally arrived at that conversation with ryan when a few of us were discussing a real estate profile late last year (I still plan to do more work on that, but have been sidetracked with client work). Of course, when you see the Skyscrapers demo it's easy to see how it's possible to build these sites, but I thought that FormBuilder could take it one step further - allowing potential buyers to fill out details, show interest in certain property's etc and essentially create a sort of mini back-office for real estate staff (dammit, they're Estate Agents in the UK - feels wrong every time I type it the US way ). Just some more food for thought that might give you a few ideas EDIT: @casey - I'd be happy to help out on that side of things. It takes me far too long to be happy with any design I do myself so if there's room to collaborate with you doing some design work and me and a few others on the technical side of things then I'm all for that!
    2 points
  5. This is a very interesting topic. I'm a third party theme developer for WordPress (simplethemes.com) but by no means a purist. I just wanted to chime in and say that I'd be more than willing to collaborate with a few developers and more experienced PW users to bring some of these to life.
    2 points
  6. Thanks for the explanation, guys. Makes perfect sense. Really impressed with ProcessWire!
    2 points
  7. Hello there - and no worries, all questions are welcome In terms of logic and doing it "ProcessWire way" I think you've pretty much nailed it. Page fields are exactly what you'd want to use for these kinds of situations. Regarding your code sample there are two things I'd like to point out: PageArray acts just like regular PHP array in many ways, so you don't have to convert it to array with explode etc. before count or foreach. When you're looping through PageArray, you can access each pages content directly, so that way there's no need for new $pages->get() call each time This is probably how I'd rewrite that code of yours: if ($page->related->count()) { echo '<h2>'.$page->related->getTotal().' Related Entries</h2>'; echo '<ul>'; foreach ($page->related as $related_page) { echo '<li><a href="'.$related_page->httpUrl.'">'.$related_page->title.'</a></li>'; } echo '</ul>'; } Hope this helps!
    2 points
  8. Hi all, this is first complete version of czech localization pack for ProcessWire 2.3. Almost 100% of text strings are translated. Please download and test this pack. Send me any comments to improve it. I decided that version 1.0 will be published after longer testing period. Current version: 0.9.1 pw_czech_091.zip
    1 point
  9. Dear PW-ers. I would like to inform you that I’ve been in need of Tree View commenting system for a project being developed by me at the moment, thus, I’ve decided to make some additions to the commenting system developed by Ryan. Hereunder, I’d like to share the code with you for your kind information. You can also practice it in case of need. Some screenshots: Download link: FieldtypeComments.zip List of changed files: small change in main.css: Archive updated.
    1 point
  10. THis is now out of date and WILL NOT WORK with recent versions of ProcessWire This is a Bootstrap based admin theme This is a very early release and may not be up to production standards - use at your own risk, or just play around with it. UPDATE New version has lots of improvements (see screenshots) and has been updated to Bootstrap 2.3 And roll back to 2.2.2 - at least the JS. It runs into problems with the version of JQuery, I think. Important - this is developed for the DEV branch of ProcessWire and is not fully compatible with the current stable release. The Bootwire Admin theme uses the most current version of Twitter Bootstrap and should be easy to update as new versions come out. Any changes to Bootstrap are done with overrides and the bootstrap.min.css and bootstrap-responsive.min.css are left untouched. Features The theme has been kept sympathetic to the original PW admin colours and layout. The top menu features drop downs rather than linking to an intermediate page (thanks to Soma and his lovely Teflon theme for the menu). I have tried to make the theme as responsive as possible, but I was foiled on some pages by some Tables and TinyMCE - if you want a responsive edit page, make sure your TinyMCE tool buttons are over a couple of rows rather than one long one. Page list actions have been replaced with Icons so that they take up less space (useful for small viewports) Compatibility This was designed using the PW Development branch and using the Chrome browser. It has been tested on other browsers, but not extensively, so any problems, please yell! Overrides Overrides to Bootstrap are in the bootstrap-overrides.css file. Main,js has several overrides to turn elements Bootstrap compatible. There is also a commented out section which changes the page list icons to a dropdown button - however, this is not working in this version. Installation Unzip the archive and place the template-admin directory in your "/site" directory. Note: since this is not a full release, it is not available through Soma's Module Manager. Thanks Soma, for allowing me to steal bits from Teflon and helping with the menu markup Diogo for Teaching me a bit of JQuery and helping with the page list action button (still to be implemented) Ryan for making it possible to create an admin theme in a couple of days (including working on other stuff) Files Now on GitHub: https://github.com/jsanglier/Bootwire-Admin/ Download Hope you enjoy it - leave nice comments below! Joss Screenshots bootwire-admin-v0.4.1.zip
    1 point
  11. I already posted this issue to GitHub, but i am not sure if i made everything right over there (i closed the issue accidentally and reopened it) - so i decided to post it here, too: When i log in as a non-superuser and add an image to a repeater, it is loaded up but the image is not shown in the administration if the page is unpublished. If I publish it, the image is shown correctly - everything is fine. This just happens for an image field which belongs to a repeater. I tried to find out why this happens and it seems to have something to do with the minus-sign in front of the files folder which is used for unpublished pages. When logged in as superuser the image link is the same like for a non-superuser - the files folder is shown in the path without that minus-sign: /site/assets/files/1264/slide1.jpg But although the folder is named "-1264" the image is shown for superusers. Edit: Forgot to mention that i am using the latest dev version of PW
    1 point
  12. I get the idea, but have hard time to see a good use case or the clear benefits. I think I get the point but hardly felt need to share templates between languages. Care to elaborate a little more with some real examples or resources where this comes into play?
    1 point
  13. I wasn't yet born to webdesign when your friend froze in time....
    1 point
  14. Everytime I see <? rather than <?php I think... PHP3!!! Much to my amusement, I noticed that an old acquaintance of mine that does a little bit of really, really bad website design and hosts on his own server, is still doing everything in PhP3. But then, he is also still doing everything a fixed 640 width and with very little CSS. I think he sees "styles" as something the gaming kids play with while serious people use <font>. He has eventually stopped wearing cords, however.
    1 point
  15. Doolak, I will go ahead and make this translatable and included in the core this week -- didn't realize I'd missed this one.
    1 point
  16. Thanks Ryan. Been a while since I've visited the site and boy, it's changed a lot with lots of new faces. I think you've created a monster! (a nice monster though)
    1 point
  17. I could be wrong, but I don't think that the Redirects module works with source URLs that have query strings or anchors. I think you'd probably have to handle these redirects from your .htaccess file. The /#/pagename/ style URL is an unusual URL mapping system. It looks like it's trying to hack around using homepage anchor links to deliver different pages. Usually anchors would be to jump to different parts of the same page (in this case, the homepage). Google probably saw that it's being delivered completely different content for different anchors, rather than the expected homepage with an anchor point. It's probably not great from an SEO standpoint. I'm not sure how to account for an anchor in .htaccess rules, but I'm certain you could account for the query string "?" version with apache rewrite rules.
    1 point
  18. It should be fine to use $config so long as you aren't overwriting some property already in use. Though you might also look at using $page to store your runtime/temporary properties, as $page is more associated as a runtime variable.
    1 point
  19. Just quoting Ryan from another thread here and I think In many ways profiles are possibly THE most important path to growth Although, ironically, the most major users of the system will tend to be people who DONT use profiles, their very existence will probably be how they hear of PW in the first place. The profiles I would see as most important, with that in mind, are (in no fixed order): Ecommerce (demonstrating the full potential of a eCommerce module) Blog (extended version of the one Ryan created with pre-installed things like DIsqus, galleries, Facebook/Twitter, feeds and so on) News/Magazine system that allows for multi-authors, a proper editorial process and editors for specific categories (are user-groups saved in profiles?) Some sort of community system with "communities" or "groups" (depending on how you call them) - each having their own wiki, simple board, blog and so on and the ability to make some or all of it private - completely over the top this one! Extended business/brochure site with very simple "news/blog" system, product/services, gallery and so on. These profiles should be put together in such a way so that different CSS frameworks and designs can be slipped in with ease. (Is that possible?). So not like the way I have been doing it! This little group (with perhaps one or two more) could be good community designed projects. That would achieve two things (with any luck and a following wind): A bench mark standard of profile design that will help others who want to create profiles A handful of trusted an maintained tools to get less technical users off the starting blocks Encourage others to create profiles (where did that third one creep in from?)
    1 point
  20. I think pw would benefit hugely from well done commercial and/or free profiles.
    1 point
  21. Hi Aren I haven't used EE so I can't help you "translate" However, I will just deal with the slideshow for the moment. I will assume that the slideshow is just an image for the moment. You can do this with just one field - create a new field using the Images type. Call it slide_images (or anything) You can set that field to upload as many images as you like. It also comes with a description field which you can use for a basic caption. Add it to a template. The images field will return an array of the images. So, in the template file do: <?php foreach($page->slide_images as $image) { ?> <img src="<?php echo $image->url; ?>" /> <p><?php echo $image->description; ?></p> <?php } ?> That will return all your images - all you need to do is to make that work with your favourite slider! If you want a much more complicated system, you can use "repeater" fields, which is a way of grouping fields together and repeating them in the form, and also the Thumbnails module, which is an alternative image field (crop-image) that allows you to create whatever thumbnails you want while uploading image. http://modules.processwire.com/modules/fieldtype-crop-image/ http://modules.processwire.com/modules/fieldtype-repeater/ Joss
    1 point
  22. One more catch. /wire/modules/Fieldtype/FieldtypePage.module: 535 $select->label = 'Dereference in API as'; 536 $select->description = 537: "If your field will contain multiple pages, then you should select the first option (PageArray). " . 538 "If your field only needs to contain a single page, then select one of the single Page options " . 539 "(if you aren't sure which, select the last option)."; 540: $select->addOption(FieldtypePage::derefAsPageArray, 'Multiple pages (PageArray)'); 541 $select->addOption(FieldtypePage::derefAsPageOrFalse, 'Single page (Page) or boolean false when none selected'); 542 $select->addOption(FieldtypePage::derefAsPageOrNullPage, 'Single page (Page) or empty page (NullPage) when none selected'); Thanks
    1 point
  23. One way is to put all the PHPGoogleMaps folder inside the templates folder and load the library like this require( 'PHPGoogleMaps/Core/Autoloader.php' ); If you want more flexibility you can do this require( $config->paths->templates . 'PHPGoogleMaps/Core/Autoloader.php' );
    1 point
  24. I see you changed tactics Pete. Since you can't be faster, you will at least be more detailed
    1 point
  25. Ok I thought there maybe a way to construct PageArray's. You can't alter the children built in property I think as it is in fact a method to retrieve the children from the DB on runtime using selectors $page->children($selector), but you could add a custom value on runtime memory and make it another PageArray. Then add some children to it. Since you can't use "children" just have to name it different for example "mychildren" and it works. You can also then use all the PageArray methods on them as ususal. You will just have still the children() and parent(), siblings() etc available but they would be in the original context of where the page originally is and not in your pseudo PageArray. Here's a test script might useful for many others too. // note just simple test pseudo code // base array object $pa = new PageArray(); // get some pages to work with $category = $pages->get("/templates/"); $about = $pages->get("/about/"); $home = $pages->get("/"); // add new PageArray property "mychildren" $category->mychildren = new PageArray(); // add other pages in $category->mychildren->add($about); $category->mychildren->add($home); // you can sort them $category->mychildren->sort("-created"); // add the $category to the base array $pa->add($category); // output the nested PageArray using mychildren echo "<ul>"; foreach($pa as $p){ echo "<li><a href='$p->url'>$p->title</a>"; echo "<ul>"; foreach($p->mychildren as $child){ echo "<li><a href='$child->url'>$child->title</a></li>"; } echo "</ul>"; } echo "</li></ul>"; Gives a nested list: Templates About 2 Home
    1 point
  26. Hey guys, I've created an initial ProcessWire bootstrap repository if any of you want to use it. Try this, branch it out, do whatever you want with it. https://bitbucket.org/thatgibbyguy/base_html5_processwire The features of this bootstrap are: HTML5 Boilerplate Modernizr/HTML5 Shiv Javascript Libraries: Twitter Bootstrap Javascript Library jQuery-1.8.2 jQueryUI-1.9.1 jQuery.fittext.js jQuery.mobile-1.20 jQuery.scrollto-1.4.3.1 retina-0.0.2 CSS/LESS Frameworks: font-awesome (not 3.0 yet) KUBE Grid (in LESS) Twitter Bootstrap Library (in LESS - library.less) Base LESS file (style.less) Key changes to Ryan's initial download are just that I took each one of his calls and abstracted them out as includes. So Ryan's functionality has been abstracted into the following includes: Breadcrumbs -> breadcrumb.inc Page Titles -> pagetitle.inc Random Image -> randomimage.inc Search -> search.inc Sidebar -> sidebar.inc For example, to add the breadcrumbs to your site, simply include it in your markup like so: Also included is Soma's Markup Simple Module.
    1 point
  27. Thanks for posting this. Just wanted to say that you don't need to include all core and install files. Just the template and module folder would suffice. Or if you want you can use Profile Exporter module to export the setup as an install.
    1 point
  28. Frontend? I usually do this in my templates: <body class="<?php echo $page->template . ' page_' . $page->id; ?>"> Then in your css, you can define styles by Template or if necessary, by Page: /*Set styles for basic_page template*/ body.basic_page ul { margin: 0; } /*Or for a Page*/ body.page_2003 ul {margin: 20px; }
    1 point
  29. Ryan, maybe there is some strange problem because I'm using IIS as main platform for web dev, I'll try it on linux distro to check out if the problem persists...
    1 point
  30. GitHub it is then. It's of course the Right Way to do it as well. I think there isn't too much in PHPUnit that couldn't be done pretty easily and more straightforward even, at least at this stage. However, in my opinion there are a few advantages in using PHPUnit instead of a home-grown alternative: 1) It's production ready, so no need to re-invent the wheel; 2) It's a known tool, which could give the project some extra credibility; 3) There are some integration/extension possibilities there already that just might come in handy, for example code coverage analysis (with Xdebug) and Selenium integration. And maybe I should add some more personal ones: 4) It would have taken me ages to come up with a script decent enough; 5) I saw an opportunity to learn something that could be useful in the future. And so on . But, just to be clear, if there comes anything in our way that would stall the progress of testing at least the selectors, I know I won't be missing any tool and will be more than happy to choose another alternative in no time, be it home-grown or not. To write tests using PHPUnit the main thing to know is that any method with its name starting 'test' is considered a test and will be run as such. The tests are located in classes inherited from PHPUnit_Framework_TestCase (or ProcessWireTestCase in this case, which adds a little something there in between). I tried to follow some examples on structuring the tests by creating directory for Selector tests and creating the test case classes there. By the book there should be a test case class for every class that's being tested. But as these aren't really unit tests anyway, I took the freedom to group the tests a bit differently. So right now there are two classes under Selector: BasicOperatorsTest and ContainsOperatorsTest (classnames should end with 'Test') and there could be for example SubfieldTest, SortTest, PagingTest etc. I don't know yet how big each of those would grow so it could have been better to have just one class for starters - especially when with this kind of naming it wouldn't be clear where some more complex tests belong to. But there are other maybe even more logical ways to cut this into pieces, we'll see which direction we're going to take. There are only two test* methods in both of the classes at the moment: one for testing selectors in database and another for in-memory tests. Both methods use a data provider (see the @dataProvider annotation) that returns an array of arrays of arguments to pass to the test method. So basically all you need to do to add a new test that follows the same pattern, is add another array or arguments for the data provider method to return (description, selector string, array of assertions and an optional skip message to mark the test as skipped). More complicated tests can be added as new test* methods as well.
    1 point
  31. @Joss: like Pete pointed out before, what you're describing there is not only doable but actually very simple to do in terms of module development. In the most basic scenario you'd have a module with only the required methods and most of it's functionality would happen within ___install() and ___uninstall(). This way once the user installs that particular module, it would automatically add required fields, templates and pages via API calls. At least in my experience it's quite common for a client to want new "apps" later on, when site has already been built. In my opinion it would definitely make sense to have a library of "app profiles" (perhaps not the best name, but you'll get the point I hope..) that you could install via simple installer module, possibly even complete with basic "skeleton" template files. Sorry, I know I'm being more than slightly heretic here, but I'm not really promoting the use of modules which create their own markup -- more like modules pointing out that you could use this kind of very basic markup and modify it to your needs. Granted that ProcessWire makes building these kind of things from scratch very easy, still especially for simple, repeatable things these kind of modules could cut boring manual work (making developers happy) and unnecessary costs (making clients happy) and so everyone benefits. Of course this mostly applies to things like news and events etc. which most of the time fit the needs of multiple clients after only superficial modifications (CSS) Regarding original post, I believe that having more ready-to-use profiles is a good thing and something ProcessWire will really need to grow and reach more (especially less technology-oriented) users. One of the things that make our dearest competitor WP so compelling is the fact that you can simply pull out complete template if that's what you're looking for; we should keep in mind that even though PW makes building state-of-the-art hand-made sites very easy, it's not always what a client/user will want and/or would be ready/interested to pay for. Those hand-made piece-of-the-art websites are what I'd prefer to create all the time, but sometimes that's just overkill. Not to mention that sometimes even us developers would prefer to take something basic and just start using it. Anyway, this is just a quick thought and I'd love to elaborate it further, but now I'll have to run to a meeting
    1 point
  32. Evening Pete The reason I asked is that with a profile you are setting up a site from scratch. But what if, for instance, I have a basic brochure site and want to add a simple blog to it? With a module I can install a nice neat, ready to go system with very basic templates - I would have to do some extra work to get the template files as I need them for the site, but at least half the work will have been done. As I mentioned, this is possibly a bit impractical for someone to use as a "download and install a blog" since it would have bits missing, but very useful for my own work, if you see what I mean. Having said that, I suppose it could be useful for a third party as long as they appreciate it wont be completely plug and play and they are good with including stuff.
    1 point
  33. I think it's a good approach going forward to keep big modules like this out of the core. But doing it now with TinyMCE could create some real upgrade challenges for folks. The TinyMCE module is also a bit of a different animal in that it has a couple of supporting modules in the core as well: ProcessPageEditImageSelect and ProcessPageEditLink. At present, all the site profiles we distribute also use TinyMCE. I think by the time we hit PW 3.0, we'll be at a point where we can look at excluding it. Ideally PW of the future comes with nothing but the absolutely essential core modules, and I think it'll be possible in the future (especially with modules manager as a core module). But right now ease of setup and upgrades takes major precedence over file sizes, as we are still an largely unknown CMS trying to grow our audience.
    1 point
  34. Thanks but I am very happy with sublime text 2.
    1 point
  35. I just like to add work code, if some one have a problem to make it work, after install the Module. This code is for parent page when the city map or address will show all children inside map, echo "\n\n<div id='map1'></div>"; //div to show in template map $js = "<script type='text/javascript'>"; $js .= "RCDMap.options.zoom = 2;"; $js .= "RCDMap.init('map1', 0, 0);"; foreach($page->children as $items) { $js .= "\nRCDMap.addMarker('{$items->title}', '{$items->url}', {$items->map->lat}, {$items->map->lng});"; } $js .= "RCDMap.fitToMarkers();"; $js .= "</script>"; echo $js; Here is code for a single page for city, hotels, or what ever u want to use it, echo "<div id='map'></div>"; //div to show in template map $js = "<script type='text/javascript'>"; $js .= "RCDMap.options.zoom = 10;"; $js .= "RCDMap.init('map', {$page->map->lat}, {$page->map->lng});"; $js .= "RCDMap.addMarker('{$page->title}', '', {$page->map->lat}, {$page->map->lng});"; $js .= "</script>"; echo $js; CSS #map { width: 100%; height: 300px; margin: 1em 0; } #map1 { width: 100%; height: 500px; margin: 1em 0; } JS <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js" type="text/javascript"></script> <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script> <script type="text/javascript" src="http://www.di.net/almanac/site/templates/scripts/RCDMap.js"></script> /*this is from Ryan you can put it in your folder*/ Thanks to RYAN,
    1 point
×
×
  • Create New...