Jump to content

Leaderboard

Popular Content

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

  1. ProcessWire now implements ALL of the jQuery traversal functions in the Page API. Existing ProcessWire versions already implemented most of them, but once we started updating parent() and parents() to support selectors, I figured we might as well be fully complete and consistent with the jQuery equivalents. Now we are. The following functions were added or updated: $page->parents([$selector]) -- Now you can specify a $selector and it will return parents that match your selector. $page->parent([$selector]) -- Now you can specify a $selector and it will return the closest matching parent. $page->closest($selector) -- Same as parent($selector) except that it considers the current page in addition to the parents. $page->parentsUntil($selector, [$filter]) -- Return all parents from current till the one matched by $selector, optionally filtering them afterwards by $filter (a selector string). Note that $selector may be a selector string, a Page, a path, or an ID. $page->next([$selector]) -- Now you can specify a $selector and it will return the closest matching next sibling. $page->nextAll([$selector]) -- Returns all siblings that come after this $page, optionally filtered by a $selector. $page->nextUntil($selector, [$filter]) -- Return all sibling pages after this one until matching the one specified. Optionally filters the results by $filter, which is a selector string. Note that $selector (the first argument) may be a selector string, a Page, a path, or an ID. $page->prev([$selector]) -- Now you can specify a $selector and it will return the closest matching previous sibling. $page->prevAll([$selector]) -- Returns all siblings that come before this $page, optionally filtered by a $selector. $page->prevUntil($selector, [$filter]) -- Return all sibling pages before this one until matching the one specified. Optionally filters the results by $filter, which is a selector string. Note that $selector (the first argument) may be a selector string, a Page, a path, or an ID. Arguments in [brackets] are optional. These functions duplicate the arguments and behavior of their jQuery counterparts. The exceptions are that parent(), next(), and prev() have a slightly different behavior: they will traverse to find the closest match (which I thought was a lot more useful in our context). In jQuery, they don't traverse beyond the direct parent/next/previous item in the DOM. As before, all the next and prev functions should be used cautiously when $page has a large amount of siblings. All these functions require loading all the pages they interact with, as comparisons are done in memory and not via SQL queries. All of them accept an optional last $siblings argument, which is a PageArray of siblings you want it to analyze (which is presumably a more limited set), and this is what you'd use if you need to scale to thousands of pages when using these functions. But if you aren't dealing with huge amounts of pages, then you don't need to consider this.
    9 points
  2. Hey guys of central europe and near Switzerland. Any interest in doing a conference/meeting in Switzerland, this year or any time in the near future? I was thinking about a location in Zurich. Event if it's just to meat and eat, drink and have some fun.
    6 points
  3. Couple of recent sites I've created: http://www.theartofdining.co.uk/ - Pop up restaurant http://samhofman.co.uk/ - still life photographer
    4 points
  4. Note that you can already "tag" templates using fields - I think you will find quite often that templates with certain tags are also going to have certain fields, so watch out for those cases and avoid using tags in those, since you may be duplicating semantics. For example, you can already select all pages that have the great_big_headline field, so you don't need a tag for templates that have a "great big headline". Edit: one case where I could see template tags being really useful, is to output the tag-names (probably with a prefix or suffix) in the class-attribute of the body-tag - something my HTML/CSS guy asks for all the time.
    3 points
  5. Next time, just say no to legacy code and hang out with the cool kids (us)
    3 points
  6. Hi everyone, this is my first post here, so let me start with a big thank you. These past few days I duplicated almost all the functionality of a site I've been working on for much longer in Drupal, and it's much leaner and nicer, and without 27 extra modules. I was looking for something similar that Marc is talking about. Drupal has a module called "imagefield focus", where you can specify a region that you want in all of your cropped versions, regardless of their size or aspect ratio. It also lets to specify another (bigger) region that you don't want to go outside of; it's good if the original image has a border that you want to get rid of. The awesome thing about this approach is that the API would remain the same, except $image->size(...) would now work with those boundaries. This, of course, requires the boundaries stored in the database, and also a timestamp to know when to update the already rendered images.
    2 points
  7. Greetings, Implementing a slideshow in ProcessWire is very intuitive. As long as you know the "standard" ways of including JQuery and CSS in your pages, and calling JQuery on a particular page, you are all set. There is just a bit of ProcessWire-specific syntax. I use BxSlider, Galleria, and FlexSlider in my sites. I find them very flexible and easy to use when implementing dynamic images. Below I outline the steps I use to get Galleria working. Step 1: Include the Associated JQuery and CSS Files The first step involves downloading the necessary files from the Galleria Web site and including them in your ProcessWire installation. In my example, I am using the basic Galleria CSS and JQuery, and I am using a Galleria theme, so I have three files altogether. 1. Place the CSS files here: /site/templates/styles 2. Place the Javascript files here: /site/templates/scripts 3. In your template, include the following in the <head> area (I include this in my head.inc file): <link rel="stylesheet" type="text/css" href="<?php echo $config->urls->templates?>styles/galleria.classic.css" /> <script type="text/javascript" src="<?php echo $config->urls->templates?>scripts/galleria-1.2.8.min.js"></script> <script type="text/javascript" src="<?php echo $config->urls->templates?>scripts/galleria.classic.min.js"></script> Step 2: Loop Through the Images in Your Template These instructions assume you have created an image upload field called "images." It also sets a size on the fly for the "large" gallery images and the "thumbnails." I run a test to assure that there are images. And I have linked the images to the content. You might do some of this differently. Just adapt your code. Add the following code (or something similar) where you want the slider to appear in your template: <?php /* Test to see if there are gallery images uploaded (number of images is > 0). If so, present a gallery. If not, leave this area blank. */ $image_num = count($page->images); if($image_num > 0) { ?> <div id="galleria_holder"> <div id="galleria"> <?php foreach ($page->images as $gall_image) { $large = $gall_image->size(640, 480); $thumb = $gall_image->size(200, 150); ?> <a href="<?php echo $large->url; ?>"><img src="<?php echo $thumb->url; ?>"</a> <?php } ?> </div> </div> Step 3: Fire the Galleria Script Directly below the code shown above, call the Galleria script and its options. Check the Galleria Web site for full instructions, but it is straight JQuery work at this point. The code below calls a Galleria theme, sets a "fadeslide" transition, and turns off the "counter" option (then closes the conditional statement opened in the snippet from Step 2): <script> Galleria.loadTheme('<?php echo $config->urls->templates?>scripts/galleria.classic.min.js'); Galleria.run('#galleria', { transition: 'fadeslide', showCounter: false }); </script> <?php } ?> There are some particular details for Galleria. But the three steps shown above are the same for just about any JQuery script I can think of. Thanks, Matthew
    2 points
  8. This is possible Create a field of type "FieldsetOpen". In your template, just sorround your fields you want to wrap in this fieldset with the fieldset created. //Example for fieldset with name "fieldset_advanced": fieldset_advanced date summary fieldset_advanced_END Btw there exists also a "FieldsetTabOpen", which displays the wrapped fields in a new Tab
    2 points
  9. Hi, I'm having the strangest problem, that I'm guessing someone will look at and figure out in two seconds. It's been that kind of day... I'm simply trying to loop through the children of a page using the code below: $my_page = $pages->get("/my-page/"); echo('<p>$my_page->numChildren: ' . $my_page->numChildren . '</p>'); // 84 $my_children = $my_page->children; echo('<p>count($my_children): ' . count($my_children) . '</p>'); // 0 foreach($my_children as $child) { echo('<p>Looping on $child</p>'); // never displayed } What I'm getting is not making sense... why would numChildren return the correct number of children of the page, but $page->children wouldn't? Thanks.
    1 point
  10. Hi guys, It's been a while since I was involved in the forums here. I've been away working with legacy Drupal, Joomla and WordPress systems due to client requirements. It's been a time hog and not all that enjoyable a process. I finally had a chance to use PW for a project again yesterday and what a breath of fresh air it has been! I had forgotten how easy, consistent and reliable querying pages was, no more temperamental WP_Query object in WordPress or complex render arrays in Drupal. It's great to see how the community has grown since I last checked in, as well as the improvements to ProcessWire overall. Ryan is steering forward in a very strong direction. I'm going to have to get the FormBuilder plugin I think, it looks to be fantastic. Anyway, I hope to be hanging around here more soon as a bit of work/life freedom approaches. Keep up the good work.
    1 point
  11. Sorry . Damn mobile reading i missed it. Ok but the answer to your problem is: You have to write children() as it's a method not a property. Some other API can be used both with and without so but in this case i think it doesnt. Maybe still something for Ryan to change in case it's this. Damn again, I shouldn't call from memory when having sleep loss. I think Wanze has a good point below
    1 point
  12. I was thinking about this alot in the past since translations are in PW. I can't remember if it was discussed already, I think only little. That's a valid question or concern I think we should have to recommendations for 3rd-party modules. I don't think it's tedious, just a question of how you handle it. Translations in core was added not so long a go and was a sponsored by Antii's company (?) feature Ryan added. It's s very well implemented but in some areas still a little rough (no offend Ryan). It works all well and even resulted having language text fields (adds inputfield for each language automaticly) and even possible to have alternate language fields (fieldname_de,fieldname_en) which is awesome. Creating language packs is hard work, but it's always possible to extend some things or create helpers int he future (did one recently created one here for Radek http://processwire.com/talk/topic/2540-czech-localization-textdomainhelpermodule/). Adding languages is easy but I still am not happy with the interface where the json files are stored. Hard to get an overview and deleting all is cumbersome (70+ files) manually. But the system is there and it's maybe only a matter of building a more advanced manager for the files, which shouldn't bee too difficult. Just takes some time. We are still not even a year into PW added translation and people are now slowly coming in and start to point out issues cause they're using it. So thanks for everyone sharing he's thought to show there's some need. I know Ryan doesn't use multilanguage feature and most western don't. We in Switzerland have the opposite, 90% of the sites have at least 3-4 languages. Mostly we do the front-end translation using yaml or php vars to have translatable strings at it doesn't have to be done with PW. Also, rarely we use modules that then would need translation for end users and most of the time the editors are one-languaged group of people. So haven't really come to using it that features much apart from the core admin. Some things may could be considered as mandatory for modules added to repository: All 3rdparty module should have it's text strings translateable. (some module were built before core translation, like Thumbnails) All 3rdparty module should have some folder for translation to be added. So other's translating it can add the json file.
    1 point
  13. Hi raydale, Welcome back! Yes, I've faced this problem before, particularly with WordPress users, as they seem to find WP easy to use, and trying to convince them to move from a system they feel comfortable with to a new system they have to learn is tough. Normally, what I do, is present them with a list of the benefits they will get if they make the switch. I also provide them with some initial training on how to get started with ProcessWire, highlighting the key points and how-tos. Once I show them how PW works and how it relates to the way WP works, they generally feel more confident in their ability to get along with the new system. Claudio
    1 point
  14. I probably would join it - it's not that far from Germany
    1 point
  15. Oh obviously u misunderstood my like Will be there
    1 point
  16. @adamkiss - well I am hoping that I can persuade clients to use PW more over the coming months as new business starts to flow again, I can maybe even persuade a few older clients to give WordPress a break. @MathewSchenker - Greetings to you too. It's interesting to see someone familiar with Joomla moving across to ProcessWire. There is a lot of hype in the Joomla community about 3.0 (with 3.5 slated soon too?), but still no CCK type features in core? I know what you mean about it being less work to start over. Both Drupal and Joomla have been a knightmare to upgrade and design for. WordPress less so, but some of the community plugins and even premium themes used by some clients are poor. I am primarily a designer, but I am still a little concerned about some of the coding practices in WordPress plugins and themes used. I have learned some big lessons over the past 10 months or so, especially in which CMS to use for which situation. I have to say that ProcessWire seems to more easily cope with nearly everything (the exceptions being forums and turnkey eCommerce at the moment). The trouble I am finding is that once a client is comfortable with a particular system, they are very reluctant to move away from it and building a convincing case can be difficult at times.
    1 point
  17. Meat and eat? No veggies allowed in Switzerland?
    1 point
  18. sorry... i just answered to the last post of the previous page
    1 point
  19. No Problem for Pw. Instead of a module, you have to generate the markup for the slider in your template. For example, check the documentation section of your first link: http://dimsemenov.com/plugins/royal-slider/documentation/ Do all the steps as described (add js, css etc..). Then simply grab the Images / Text from the fields. <!-- STEP 2, see the docs from the link above --> <div class="royalSlider rsDefault"> <?php foreach ($page->images as $image) { echo "<div>"; echo "<img class='rsImg' src='{$image->url}' alt='{$image->description}'>"; echo "<p>{$image->description}</p>"; echo "</div>"; } ?> </div> The code above would create a slide for each Image with the description text below. As far as you only want to slide Image + Text, there's no need for a repeater. You can use a field of type Image which allows you already to store multiple images with descriptions
    1 point
  20. You maybe have to simply do a $page->options->removeAll(), to then populate it with the checked again.
    1 point
  21. Greetings raydale, Your name sounds very familiar... I am one of the new people who arrived since your last activity. I am in a similar position as you. After building several sites in Joomla (with a CCK), I have fully moved to ProcessWire. And now I am in the position of having to "move" sites from Joomla to ProcessWire. In some cases, it's actually less work to just start over. Thanks, Matthew
    1 point
  22. Edit well if there not too many projects you could try and evaluate the dates and store them on runtime to sort by that value afterwards when you loop them out. $pa = $pages->find("template=project"); if(count($pa)){ foreach($pa as $p){ if(!$p->numChildren) continue; // no assignments // store a temporary value to the project page $p->tmp_date = $p->children("sort=-due_date")->first()->due_date; } // output the projects foreach($pa->sort("-tmp_date") as $p){ echo "<li>$p->title</li>"; if(!$p->numChildren) continue; foreach($p->children("sort=-due_date") as $a){ // output assignments } } } This will work well if you don't have thousands of pages. The module approach would be the more efficient and scaleable.
    1 point
  23. I don't see an easy option to do that, but with a little module you could on each save of a child page update a date field on the parent. Then sort it by that field. Let us know so we can help you get started.
    1 point
  24. The two one would have to consider are: Page Fieldtype -- keeps track of an ID from the pages table, if you choose to use the "parent" as the criteria for selectable pages. It doesn't add anything to the pages table, it just keeps track of an ID already in there. Repeater Fieldtype -- This one actually generates pages as you mentioned (and it's the only I'm aware of that does). Any continuous integration tool would probably want to exclude these two, or at least the Repeater one, until version 2+. I think it fits the commercial option well. My plan is to add JSON import/export to templates and fields very soon (very much like what's in FormBuilder). But this is just a quicker way of doing it manually (copy/paste vs. doing the work), it doesn't have the scope of a fully automated deployment tool.
    1 point
  25. I recently tried and gave up - many field-types actually store things in the "pages" table, so if somebody created a new page of content on the site while you were working on a local copy, you'll have overlapping page IDs. In the end, I had to tell people to back off the site while I was working locally and wait for me to signal the green flag - then replicate all the changes by hand. Ideally, I would like a module that provides automated one-click deployment and version control for all metadata, which, fortunately, thanks to good clean data architecture in PW, can be done by just handling Templates and Fields. I wonder, would anybody be interested in this module as a commercial option?
    1 point
  26. Greetings Everyone, Hosting is on our minds -- an important decision that doesn't seem as easy as it should be. Here's a related discussion I started on this, which might be helpful here: http://processwire.com/talk/topic/2427-lets-talk-hosting/ Thanks, Matthew
    1 point
  27. Does anyone know the CodeIgniter based "ionize cms"? http://ionizecms.com Some months ago I gave it a try but never used it in a project. I was looking for a "native-multilang-friendly" cms which can handle as many languages as I need with only one site-tree. Seems like there's also a new version out this year. Demo available, link is on the homepage. Cheers
    1 point
  28. There is other CMS'???
    1 point
  29. I myself am a static man - I love Middleman, Jekyll, Stacey & Kirby. I'd really love it if there was some crossover, something where you'd write your website, build it and then upload it having some tiny PHP router for doing tiny bits of runtime changes, like including different files based on $ajax, sending forms, etc.
    1 point
  30. ProcessWire is a native category system, whether by structure or relation. I think the distinction is that we don't call them "categories" or "tags". But "does not have" makes it sound like they aren't part of the plan. When in fact, it's one of the underlying purposes of the system. ProcessWire's grandfather (Dictator CMS) had a category system called "channels" and it took me awhile to realize it, but they were a complete waste of time... The literal channels/categories were immediately rendered useless once the Page reference type entered the scene. I continued using channels on the sites that had started with them, but this antiquated type of category system never felt right again. Today's ProcessWire not only has categories, it has them on steroids. If each business only belongs in one category, and that will always be the case, then categories by structure is a good way to go. Meaning, your structure would be: businesses web-design a1-web ryan-cramer-design accounting acme-financial architecture top-notch-houses dlux-office-design restaurants las-tortillas bread-and-cheese-house If each business can be in multiple categories, then you'd want a structure like this: businesses a1-web ryan-cramer-design acme-financial top-notch-houses dlux-office-design last-tortillas bread-and-cheese-house business-types web-design accounting architecture restaurants Then each "business" page would have a "Page" reference field called "business_type" where the editor can check one or more boxes. Each business would display their types like this: <h2>Types</h2> <ul><? foreach($page->business_types as $t) echo "<li><a href='$t->url'>$t->title</a></li>"; ?></ul> Each business type would display the related business like this: <h2><?=$page->title?> Businesses</h2> <ul><? foreach($pages->find("business_type=$page") as $b) echo "<li><a href='$b->url'>$b->title</a></li>"; ?></ul>
    1 point
  31. Great! I'm participating on discussions without even knowing
    1 point
  32. If you upgrade to 2.3 now, you'll just want to test everything in your site out to make sure it still works how you expect. There have been some core changes and optimizations that should not change any behaviors, but sometimes small things don't become apparent until it's in broader usage. So just test thoroughly. Also note that once you've got 2.3, you shouldn't go back to 2.2. It does make some minor DB schema changes in some cases, which 2.2 wouldn't know about. It also uses a different hashing mechanism for passwords that 2.2 doesn't support.
    1 point
  33. Something else good to say about ServInt is that they've been routinely upgrading the capabilities of their existing accounts over time, without asking for more money. In my case I have an Essential VPS account I bought with them years and years ago. The account doesn't stay at the specs you bought it at. If the capabilities of your plan gets upgraded for new/prospective customers, then it gets upgraded for you too. You don't even have to ask. It just happens and they let you know after the fact that "you now have an extra 10 gigs of space", for example. ServInt is good at keeping the customer happy in the long run. This is different from other hosts I've dealt with, and am currently dealing with. I've had a account with PowerVPS for as long as I've had one with ServInt. It's also been quite reliable, but it is configured identically to when I purchased it years ago. The ServInt one is now much more capable than the PowerVPS one, despite the fact that they started the same and cost the same. Now I am at the point where I'm looking to get rid of the PowerVPS one just because it's no longer competitive.
    1 point
  34. Not had any problems with Servint, plus they have an Amsterdam datacentre now as well for us European folks. Used LiquidWeb and then StormOnDemand (by Liquidweb, but cloud hosting) when the site that was hosted on the normal hosting there got a bit big. Being able to scale resources using Storm is a nice touch - had a few popular weeks on one site in particular and was able to just increase the CPU and RAM in a short space of time and, whilst you pay extra (to the end of the month on the higher resources I think) if you scale it back after your busy period you only pay for the time you used it at the higher resources - they basically sort it out over the next bill or two depending on what you used. The only issue with StormOnDemand is a recent issue whereby mod_seurity got upgraded and wiped out all of my rules. Since these rules were from years ago, it was a pain making it so every script worked again (fortunately it's only forum software, MediaWiki and ProcessWire, but it was still a few days of 404 errors when editing certain things). I think ServInt uses some other system entirely for handling attacks - some firewall that they've got set up - so I wouldn't have faced that particular problem with ServInt, but all that aside, I've not had any other problems with LiquidWeb at all over the last 5+ years. Stellar support at both companies so take your pick
    1 point
  35. I have been on Mediatemple for about 10 years now. I love them. I know people out there on the web have mixed feelings, but after trying and dealing with a tonne of hosts over the years I don't want to use anything else. I have about 150 domains on the MT grid and a couple V dedicated servers. Always awesome, great support, good prices. My 2 cents.
    1 point
  36. I completely agree with the things Joss said about scalability. But it's not such a big task to move from one server to another either (hosts like ServInt can even do it for you). So I wouldn't let scalability drive the decision unless your scalability needs are short term or recurring. If resources and redundancy are similar, I think it's worth paying a little extra for dedicated. If you get a seriously major cost, resources or redundancy benefit from going VPS, then I'd probably do that. Though I'm not sure that resources on a dedicated and VPS are apples to apples, so personally I'd sacrifice slightly on resources to have dedicated if I could get the prices in a similar range. I have (via my clients) both high end VPSs and dedicated servers in a similar price range. Both perform beautifully. But I feel a little better about the dedicated machines because the resources just seem a little cleaner... no worries about what other high traffic sites we might be paired with, burst memory/CPU, etc. Just raw resources ready for anything.
    1 point
  37. I suppose this is down to scalability in the end. If you have a very clear idea what you need and how much power you want, then a dedicated machine might prove a very controllable option. If however, you may want to increase scalability, then a VPS or cloud solution may give more versatility, both in price and power. Although things like Amazon can be pricey, I like the idea that you can scale DOWN as well as up! Also, there is the clients' needs (business-wise rather than technical). If they have no need for a dedicated server for themselves as such, then they may or may not be happy being tied into a developers machine; if the relationship goes sour, it gets very, very complicated. I look at this from the point of view of buying a car from a dealer. When you buy, it makes sense to take advantage of the dealers servicing options and so on. But you can choose to make that a contractual relationship or a casual one - if you just tend to use them out of habit rather than because you have welded yourself to them, when they mess up you can simply go somewhere else; you don't have to first of all get the car and the car keys back from them. In my main business (music production and writing), clients use me because they like me, not because they are contractually or technically bound to me. If I tried that, then they would go elsewhere pretty damned quick! I think at least part of the IT world has got itself into a mess because it has tried to enforce client loyalty rather than keep the client by offering good services and building a good relationship.
    1 point
×
×
  • Create New...