Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 05/31/2016 in all areas

  1. I think you got it right. What PW does is quite simple, you're probably just having trouble to accept that this is so different from what you are used to with Drupal. PW is actually a Framework in its essence, the CMS is just a nice extra that was built exactly with the tools that the framework offers. Resuming, you can and should use the CMS to build your sites, because it makes your life and especially your clients life easier, but what you are using is actually the framework and its' API. Because the main goal of PW is to let you built your templates without interfering, you are also quite right that it feels like building static templates. This is of course just a feeling — in reality PW injects a set of objects, and also includes some helpful files in your templates — but the truth is that you almost don't feel its interference because nothing is outputted, so you could even output only static content if you wanted. By the way, welcome to the forum, I think you will have a good time here with us
    8 points
  2. Sad to hear that you're put of by this, but the demo is mostly a showcase on how content modeling is handled in processwire and a peak into the admin backend. (Frontend)-Performance is dependent on so many factory, that the demo won't give you any reasonably insight anyways. E.g. we just recently switched hosting to a new quite beefy bare metal server, which is understandably faster than the previous one. Would you consider ProcessWire better because of that speed improvement? In the end rendering speed is probably most dependent on what you're implementing with processwire as on the system itself. If you really want to evaluate processwire by the demo: ProCache is only active for guest users, therefore as soon as you log in as admin you'll not get any ProCache cached content. Also the whole backend interface is not cached as well and really it's just another kind of frontend rendered by processwire. Additionally you won't need to ask for a new demo, you can install it yourself using the skyscraper installation profile.
    7 points
  3. I'm starting to add some structured data to sites too, where relevant, to see what sort of impact it does have on search results. From a technical perspective though, I'd highly recommend using json_encode() over generating strings. Here's one I made earlier (very simple): <?php $socialLinks = array( 'facebook' => 'https://www.facebook.com/BestPageEver', ); $ldJson = array( '@context' => 'http://schema.org', '@type' => 'Organization', 'name' => $homepage->title, 'url' => $homepage->httpUrl, 'sameAs' => array(), ); foreach ($socialLinks as $name => $url) { $ldJson['sameAs'][] = $url; } ?> <script type="application/ld+json"> <?= json_encode($ldJson, JSON_PRETTY_PRINT); ?> </script>
    6 points
  4. Based on own experience as well as observing some topics on here, I would say "yes, but...". The "but" is that certain things need to be done differently, and other things need to be thought about: Code Where will the code that handles the app's business logic be stored and how will it be structured? Bespoke PW modules or use template files? Data The data that you will be storing - what does it looks like? How will it get from the source into the database? What output or reporting requirements are there? URLs Have one or two main entry points and call your custom code? Or have a new Page for most/all URLs. Automatic page name generation Every page has to have a name, and if many pages will be created using the API what is the naming scheme? Re-use admin vs creating custom front-end There's been some talk about this very recently, and the route chosen may depend on: who your audience is, what level of branding is required, and what functionality is available to who. Having said that a lot of the stuff you need from an app framework is already there. Sessions, Users/Permissions, the data layer, output, templating, and other things I can't remember. One thing I've found missing is a robust generic form validation library. I don't like the config format of valitron, so currently using a slightly modified simple-validator. At my company, we've built various SaaS apps and CMSs over the years using CodeIgniter. More recently though, we have used PW where CI may have previously been chosen. Perhaps an interesting example is a recent project where we used only the PW back-end. The branding was changed a bit, but there was no front-end at all. The main function of the app was to generate an HTML5 product showcase/catalogue/datasheet browser, for use on tablets (built with Backbone JS and JSON datasource). The PW admin was perfect for users managing the data. We built a bespoke Process module for the back-end that allowed users to preview and download the HTML5 app.
    5 points
  5. All the language sites should now be up too. i.e. de.processwire.com and so on. wiki.processwire.com didn't survive the server change. Somehow its database had grown to multiple gigabytes, and it appears that it may have been hacked or something. I've lost trust in MediaWiki for our use. Since everything on there is pretty well out of date at this point, we opted not to copy that over to the new server. We could spend days trying to figure out why a small wiki had a 3.5 gigabyte database, so I figured we were better off without it.
    4 points
  6. Susy is totally great. It might have a bit of a steep learning curve at the beginning. But once you have wrapped your head around it, it is a pleasure to use and the most flexible grid solution I have encountered so far. There's a ton of great resources out there that can help to grsp the concept. Good starting point: http://zellwk.com/blog/susy2-tutorial/ Flexbox is definitely worth exploring. Recently I discovered https://flexeble.space/ which is a flexbox grid with inline-block fallback for >= ie9. But since everything can be accomplished with Susy and browser support for flex is not yet fully there, I prefer to wait until it is nativel;y supported in Susy. And there seem to be good reasons why you shouldn't use flex for overall page layout: https://jakearchibald.com/2014/dont-use-flexbox-for-page-layout/
    4 points
  7. @mikeuk Don't worry you are doing fine, don't take anything too seriously. We're all friends here and occasionally like to hit each other with the zen stick, but it's always friendly. The demo site is filling multiple shoes. Sometimes people ask where they can take a look at a Pro module, in which case I'll install it on that demo site since it's already all setup with guest admin logins and such. But LostKobrakai is right that ProCache is disabled as soon as you are logged in, so it's really only there as a demo of the configuration screen. Though admittedly, I do like having it installed there just because for whatever reason people like to scrape that entire site regularly, so ProCache lets them do it more quickly, without consuming too much server resources. I suppose that doesn't matter much now that we're on this new server which has a ton more resources than before.
    3 points
  8. As a web developer I always want to improve the search results of my websites in popular search engines. Because of that I find the topic of structured data very interesting and want to learn more about them. Recently I tried out a few of the ways how to provide more information to a website and want to share my solutions. Most of the structured data can be included directly in the markup or as JSON-LD at the end of your document (right before the closing body tag). I prefer the last one, because I don't like to have bloated HTML markup. Breadcrumbs Breadcrumbs are an alternative way to show the your page hierarchy inside search results, instead of showing just the plain URL. Just like the breadcrumbs on a website. Following the example, I ended up with this code: <?php if(strlen($page->parents()) > 0) { ?> <!-- Breadcrumbs --> <script type="application/ld+json"> { "@context": "http://schema.org", "@type": "BreadcrumbList", "itemListElement": [ <?php $positionCounter = 1; $separator = ','; foreach($page->parents() as $parent) { if($parent->id == $page->parents()->last()->id) { $separator = ''; } echo ' { "@type": "ListItem", "position": "' . $positionCounter . '", "item": { "@id": "' . $parent->httpUrl . '", "name": "' . $parent->title . '" } }' . $separator . ' '; $positionCounter++; } ?> ] } </script> <?php } ?> First I am checking if the page has parents, then I follow the follow the markup of the example. I save the position of each parent in the variable positionCounter and increase its amount after each loop. As a last step I tried to end the JSON objects by not include the separating comma after the last object. This is why I am using the separator variable. Site name and sitelinks searchbox Using JSON-LD you can provide an alternative site name and a sitelinks searchbox inside the search results (Inception ). <!-- WebSite --> <script type="application/ld+json"> { "@context": "http://schema.org", "@type": "WebSite", "name" : "Your site name", "alternateName" : "Your alternative site name", "url": "<?= $pages->get(1)->httpUrl ?>", "potentialAction": { "@type": "SearchAction", "target": "<?= $pages->get(1)->httpUrl ?>search/?q={search_term_string}", "query-input": "required name=search_term_string" } } </script> I am not 100% sure, if the sitelinks searchbox works this way. Maybe someone who made this work before could confirm it, that would help me out. Organization For organizations you could provide a logo and links to your social profiles. <!-- Organization --> <script type="application/ld+json"> { "@context": "http://schema.org", "@type" : "Organization", "name" : "Your organization name", "url" : "<?= $pages->get(1)->httpUrl ?>", "logo": "<?= $pages->get(1)->httpUrl ?>site/templates/images/logo.png", "sameAs" : [ "https://www.facebook.com/your-organization-url", "https://www.instagram.com/your-organization-url/" // All your social profiles ] } </script> This one I think is self explanatory. Article If you have an blog or a news site you could enhance your articles with structured data with an thumbnail and author. <?php if($page->template == "post") { ?> <!-- Article --> <script type="application/ld+json"> { "@context": "http://schema.org", "@type": "NewsArticle", "mainEntityOfPage": { "@type": "WebPage", "@id": "<?= $page->httpUrl ?>" }, "headline": "<?= $page->title ?>", "image": { "@type": "ImageObject", "url": "<?= $page->thumbnail->httpUrl ?>", // Image field in template "height": <?= $page->thumbnail->height ?>, "width": <?= $page->thumbnail->width ?> }, "datePublished": "<?= date('c', $page->created) ?>", "dateModified": "<?= date('c', $page->modified) ?>", "author": { "@type": "Person", "name": "<?= $page->createdUser->first_name . ' ' . $page->createdUser->last_name ?>" // Text fields added to core module ProcessProfile }, "publisher": { "@type": "Organization", "name": "Your organization name", "logo": { "@type": "ImageObject", "url": "<?= $pages->get(1)->httpUrl ?>site/templates/images/logo.png", "width": 244, // Width of your logo "height": 36 // Height of your logo } }, "description": "<?= $page->summary ?>" // Text field in template } </script> <?php } ?> Here I am enabling structured data for the template called post. I also have the text fields first_name and last_name added to the core module ProcessProfile, the image field thumbnail and the text field summary added to the template. Just a small note: I know you could use $config->httpHost instead of $pages->get(1)->httpUrl, but I found the second one more flexibel for changing environments where you have for example HTTPS enabled. Those are the structured data I have in use so far. I hope I haven't made a mistake, at least the testing tool doesn't complain. But if you find something, please let me know. I love how easy it is with ProcessWire to get all the information from various pages and use them in this context. As mentioned above, I am nowhere an expert with structured data, but maybe some of you would like to provide also some examples in this thread. Regards, Andreas
    2 points
  9. Hey folks, If I search for a page that is unpublished it can not be found by using the ajax search in the right corner in admin. It can only be found when I am logged in as a Superuser, but not if I am logged in as an Editor (who has page-edit rights!). Searching through lister works - but only if I choose to only search unpublished pages; but not via the ajax search at all. I already looked at the process page search module file and there is a line that allows unpublished pages to be searched if someone has paeg-edit rights, but somehow it does not work at all. Can someone help? Thank you so much!
    2 points
  10. Hi all This is curious. After spending quite a lot of time using, learning and advocating Drupal as an API interface rather than template builder, I come here and find Processwire seemingly having been doing this all along. I often thought Drupal became heavy and bloated from a page loading point of view, with so many users using modules (Views, Panels, themes with sub themes, etc) that control layout. So I thought, hang on, shouldn't we be making the template statically and adding the bits we want to it? Followed that route for a few sites, but found little interest in the idea from others. So here I am, experimenting with Processwire and it seems the whole ethos is that approach. Or I am a lot less smart than I thought and completely misunderstand this system.....
    2 points
  11. Did it really come across as insulting? That was defintely not the intention so apologies if it did. For quite a while I was helping out with a popular Joomla extension, and occasionallly learned some things from newcomers / outsiders who noticed things we didn't (especially things that affected the project's first impression). I genuinely felt the demo would make a better impression with Pro stuff not included. @LostKobrakai, thanks for the detailed response. That's good to know. Fully appreciate a demo is not a good test of frontend performance. I should also say, had I not liked the way it worked (see my other post), I would not have bothered posting
    2 points
  12. @mikeuk: If I were you, I'd be hooked. Such a thorough answer on an insulting 2nd post from a man that does not even sell the paid modules. When I first found ProcessWire I was really disapointed with FormBuilder being a commercial module. By now I know how to build complicated forms myself, but already got a copy of FormBuilder. I am sure you'll learn to substitute ProCashe with something free like Redis, but you'll probably won't have to do it to get times faster win over Drupal. Please through at us more of those provocative posts so we can show you one of the best things on the Internet from all of its shining edges)
    2 points
  13. sure, here are some examples, i have these in a file called schema_helpers.php, which is in my shared functions folder: 1.) function siteSchema() { $page = wire('page'); $schema = array( "@context" => "http://schema.org", "@type" => "Website", "url" => wire('pages')->get(1)->httpUrl, "name" => $page->title, "description" => '', "potentialAction" => array( "@type" => "SearchAction", "target" => wire('pages')->get(1000)->httpUrl . "?q={search_term}", "query-input" => "required name=search_term" ), "about" => array( "@type" => "Thing", "name" => "A very interesting THING", "description" => "Website about a very interesting THING" ) ); if($page->summary) { $schema['description'] = $page->summary; } else { unset($schema['description']); } return '<script type="application/ld+json">' . json_encode($schema) . '</script>'; } 2.) News function jsonldNews($item, $settings) { $image = $item->image ?: getFallbackImage($item); if(!$image) return; $out = ''; $jsonld = array(); $jsonld["@context"] = "http://schema.org/"; $jsonld["@type"] = "NewsArticle"; $jsonld["name"] = $item->title; $jsonld["headline"] = $item->title; $jsonld["url"] = $item->httpUrl; $jsonld["mainEntityOfPage"] = array( '@type' => "WebPage", '@id' => $item->httpUrl ); $jsonld["description"] = $item->summary; $jsonld["datePublished"] = date(DATE_ISO8601, $item->published); $jsonld["dateModified"] = date(DATE_ISO8601, $item->modified); $jsonld["dateline"] = date(DATE_ISO8601, strtotime($item->news_date)); $jsonld["wordCount"] = str_word_count($item->body); $jsonld['author'] = $settings['author']; $jsonld['publisher'] = $settings['entity']; $jsonld['articleBody'] = $item->body; $jsonld['articleSection'] = $item->categories_select->first()->title; // Publisher $pubLogo = wire('pages')->get(3525)->image; if($pubLogo) { $pubLogo = $pubLogo->height(60); $jsonld['publisher'] = array( '@type' =>'Organization', 'name' => 'A Publisher', 'url' => 'https://publisher.org/', 'logo' => array ( '@type' => 'ImageObject', 'url' => $pubLogo->httpUrl, 'height' => $pubLogo->height, 'width' => $pubLogo->width ) ); } // News Items may have a featured image $image = $image->width(696); $jsonld['image'] = array( "@type" => "ImageObject", 'url' => $image->httpUrl, 'height'=> $image->height, 'width' => $image->width ); $out .= '<script type="application/ld+json">' . json_encode($jsonld) . '</script>'; return $out; } 3.) Event function jsonldEvent($event) { if(!$event->event_location_select) return; if($event->template == 'event-child') { // inherit unset fields needed $event->event_link = $event->event_link ? : $event->parent->event_link; $event->body = $event->body ? : $event->parent->body; $event->event_location_select = $event->event_location_select ? : $event->parent->event_location_select; $event->price = $event->price ? : $event->parent->price; $event->currency_code = $event->currency_code ? : $event->parent->currency_code; $event->link = $event->link ? : $event->parent->link; } $out = ''; foreach($event->event_date_m as $ed) { $jsonld = array(); $date8601 = date(DATE_ISO8601, strtotime($ed)); $jsonld["@context"] = "http://schema.org/"; $jsonld["@type"] = "MusicEvent"; $jsonld["name"] = $event->title; $jsonld["url"] = $event->event_link; $jsonld["description"] = $event->body; $jsonld["startDate"] = $date8601; if($event->event_location_select) { $state = $event->event_location_select->state ? $event->event_location_select->state->title : $event->event_location_select->address_state; $jsonld["location"] = array( "@type" => "Place", "name" => $event->event_location_select->title, "url" => $event->event_location_select->link, "address" => array( "@type" => "PostalAddress", "streetAddress" => $event->event_location_select->address_street, "addressLocality" => $event->event_location_select->address_city, "addressRegion" => $state, "postalCode" => $event->event_location_select->address_zip, "addressCountry" => $event->event_location_select->country->title ) ); } if($event->price && $event->currency_code && $event->link) { $jsonld["offers"] = array( "@type" => "Offer", "description" => "Tickets", "price" => $event->price, "priceCurrency" => $event->currency_code, "url" => $event->link ); } $out .= '<script type="application/ld+json">' . json_encode($jsonld) . '</script>'; } return $out; } Also - I don't think you need to use JSON_PRETTY_PRINT
    2 points
  14. Sane is always good ... So is Sane's second cousin, Simple. I found this mini-book on CSS layout a short time ago. http://book.mixu.net/css/ . I liked it and found it helpful for myself. Plan on reviewing it every so often. Someone else might find it helpful also. Thanks again gentlemen.
    2 points
  15. You're probably triggering the hook on the newly created page object. The created timestamp is (probably) not part of that object by then and won't be available until the page is loaded from the db for the first time.
    2 points
  16. 2 points
  17. Hi Bill, Ever since I found Susy I've not used any other. I'm not a Flexbox user so can't comment on that, but Susy + SASS is a delightful combo, good luck to you Cheers, -Alan
    2 points
  18. A highly configurable and flexible ACE editor input field. This module is sponsored in part by Nibiri, aka forum member Macrura which was a great jump start. So many thanks to him. See this short screencast to get an overview: Get it from Github or the Modules Directory. Roadmap add full screen mode expose a jQuery api for resizing, setting row count etc. add image handling like in Adam Kiss' version
    1 point
  19. There have been some interesting discussions before how to use Processwire for application development; i.e. the typical user login/logout scenario with a set of different roles and related capabilities. The question I was asking myself in the last couple of days while skipping through the Laravel documentation: Can Processwire fully replace an application framework like Laravel? Some aspects have been discussed to some extent some time ago in 2012. Would be interesting to know if in 2016 any developer in the community has completely replaced a "traditional application framework" with Processwire.
    1 point
  20. i'm currently porting a clients website from joomla to processwire (finally, it's a good week ) and we are using the old design for that. today i recognized that on tablets the menu doesn't work as expected, since the menu structure changed from joomla-chaos to pw-awesomeness the problem is the old multilevel problem when you have items and subitems and want to show the subitems on hover. on touch devices your clients will perform a "click" anstead of a "hover" and they will trigger a new pageload. i came up with a quick fix and would be interested in your opinions. seems to work really nice here: $(document).ready(function () { var menu = $('...'); menu.find('a').click(function(e) { console.log('clicked'); // early return if the parent has no hover-class if(!$('...').hasClass('...')) return; // prevent click when delay is too small var delay = Date.now() - $(this).data('hovered'); if(delay < 100) e.preventDefault(); }); menu.find('a').mouseover(function(e) { var time = Date.now(); $(this).data('hovered', time); }); });
    1 point
  21. One of the things I've put off learning has been LESS/SASS, seeing as I've always managed ok with CSS and there's never time enough to learn every new technology is there?! Was just interested to see who used it occasionally, the whole time, never at all, waste of time, lifesaver etc... I've certainly never struggled with just CSS but that's the way with so many new things, you don't know what you're missing until you try it
    1 point
  22. Sometimes my choice of words might not be the best one, sorry for that. I am Russian-speaking most of the times, so please forgive me. I was trying to sound rather jokingly (this very phrase is partly translated with Google translate, so might not be quite what I was really intended to say either ). I have to say that paid modules in demos are something that turns me off too. We, the free open source users do not like commercial modules being pushed at us for sure! And I remember having a doubt about PW being "blazingly fast" exactly in the same context. Damn, It is still pretty slow on my Windows Xampp. But I like it on the live servers without any cache at all most of the times. P.S. And you are lucky! Ryan himself is here on Tuesday!
    1 point
  23. oops sorry meant this https://search.google.com/structured-data/testing-tool to see the json i usually dump it to tracy debugger
    1 point
  24. The thing I'm currently missing the most is probably a clear path to testing, which is still not the easy thing even in other libraries. Also you need to consider, that you'd need to implement any application logic (and it's structure) on your own, where other frameworks might already give you a predefined path e.g. for handling domain-events or queuing messages or just about where to put certain parts of the application. Validation is also a thing. I'm using nette/forms here, to have form generation and fronend-/backend validation covered.
    1 point
  25. that feature is quite hidden - i think that could be designed better from the ui side. i've also found it only by coincidence: https://processwire.com/talk/topic/7819-module-alternativegridfiles/?p=75845 sometimes it is also really nice to use your dev tools console for such things: $('.fa-trash').click();
    1 point
  26. I would like to take issue with this as well. It’s awkward for non-superusers not to find pages (or other users) they can otherwise reach, and I don’t really see why this restriction is in place by default. It is also not easy to implement a hook to change this behavior, which would be trivial to do the other way around. I.e. if the “include” parameter weren’t overridden by the Process function, that feature could be retrofitted like so: wire()->addHookBefore('ProcessPageSearch::executeFor', function($event) { if(!$this->user->isSuperuser()) wire()->input->get->include = 'hidden'; }); As well as any other custom restrictions one might need to respect custom roles and permissions. However, as it is now the restriction is hardcoded into the function and I’m not sure how to modify it in a non-destructive manner. Are there security reasons for the way it’s currently done?
    1 point
  27. Here's a nice (laravel centric) overview about what valet is and how to get it running: https://laracasts.com/lessons/laravel-valet-is-the-bomb
    1 point
  28. Especially as e.g. zepto will give you probably 99% of what you're using of jquery in a fraction of the filesize.
    1 point
  29. I'm afraid I don't entirely get the drawback of flexbox written in the "Don't use flexbox for overall page layout" article. Is it only the layout re-draw? If so, I can live with it.
    1 point
  30. Hi Bernhard, read and try his: http://osvaldas.info/drop-down-navigation-responsive-and-touch-friendly In the lower section of this page you can download this code doubletaptogo. I use this code in almost every project where a flyout navigation occurs. Robert
    1 point
  31. Interesting solution, indeed. But it feels a bit hacky. I'd rather present a different menu layout to mobile devices as to avoid the hover problem in the first place. Something like off canvas or the likes.
    1 point
  32. I'm doing all my structured data with helper functions, and for most sites i will have around 5-6 schema.org types. I have found that this is a major benefit for SEO, and for search results accuracy in general. Not to mention that some other 'competing' CMSs provide some structured data plugins or out-of-the box generated markup, and while it is generated automatically and therefore not always totally accurate, it has been shown to give some of those sites an edge on search rankings, and placement in things like google events, or news.
    1 point
  33. update: i'm using laragon now and love it! see this post: !!! OUTDATED !!! i'm using vagrant on win10 for all my development too. i really like it once you have the hassle of setup done. i'm now using scotchbox - i don't use the repo gebeer linked to. here is my new one: https://gitlab.com/baumrock/vagrant-pw-lamp/tree/master sorry, no time for documentation right now, but the readme from the old repo should also have some useful informations (as already linked by gebeer): https://github.com/BernhardBaumrock/vagrant-pw-lamp on win8 i had to switch GUI mode to OFF otherwise it didn't work. on win10 it was the contrary ^^ i'm too busy right know to give more help. gebeer and i have been talking about vagrant and pw development quite for some time now but it all seems too experimental to really recommend our setups to someone else... but if you want to try and have some specific questions please let me know some nice things i like and why i am using it: have a linux sandbox setup projects with "real" hosts in seconds; my workflow is like this: create a folder on my host like "example" "git bash here" clone my repo https://gitlab.com/baumrock/vagrant-pw-lamp vagrant up then i have my machine ready and can access my linux server on example.dev mailcatcher will catch all emails, so i can also test all email stuff, even when i'm offline i can do "grabpw" and get a fresh install of PW to choose from master/dev/devns i can do "backup" at any time, that will backup files + db i can do "restore", so i can move projects from one device to another i can even do "push" or "pull" of the whole website from my live server to my vagrant box, but that's a bit experimental when i'm done with the project i do "vagrant destroy", it will backup everything and keep only 1 backup and destroy the machine. so i don't mess up my host system with lots of GB of VMs ps: sorry i just realized that my repo is private... i can't make it public atm but you can pm me if you are interested
    1 point
  34. "breaking into a wordpress site without knowing wordpress/php or infosec at all" -> https://notehub.org/5zo2v
    1 point
  35. Hey! Welcome to the forums, skylundi! Almost everything is possible with hooks. But as it is your first post there is a chance you do not need complicated solutions. Please explain your case a littlt deeper - maybe there is some simple way we can suggest. And there is this nice module if you need just to show something on condition.
    1 point
  36. Hallo Neo! Follow the white rabbit. 1) Pages scale much better that repeaters. So if you will have really lot of banners you better use pages. Or consider commercial Repeater Matrix field. 2) You do not have to unpublish your banners. You can just add a datetime field and name it something like show_until. Then in the code just use this field in the selector and choose only pages that have show_until field value less than today. 3) If you really need to unpublish those pages you can use Lazy Cron module.
    1 point
  37. Tutorial now available on Tuts+ here: http://webdesign.tutsplus.com/tutorials/how-to-create-an-ajax-driven-theme-for-processwire--cms-26579 for Ajax site temp laying in PW.
    1 point
  38. Tutorial now available on Tuts+ here: http://webdesign.tutsplus.com/tutorials/how-to-create-an-ajax-driven-theme-for-processwire--cms-26579
    1 point
  39. For reference, you can also make sure this happens when a page is saved in the admin as well. <?php class AdminHelperHooks extends WireData implements Module { public static function getModuleInfo() { return array( 'title' => 'Admin Helper Hooks', 'version' => 1, 'singular' => true, 'autoload' => true ); } public function init() { $this->addHookAfter('Pages::saveReady', $this, 'hookChangeNameToID'); } public function hookChangeNameToID(HookEvent $event){ $page = $event->arguments(0); // get the page being saved if ($page->template == 'lost-property'){ // check the template $page->name = $page->id; } } }
    1 point
  40. Thanks for the feedback . The faulty field rendering was due to the fact that the Children tab loads via AJAX, so AsmSelect fields contained there don't get to attach their JS/CSS files in the document head in the render() method as they normally would. Have worked around this so should be fixed now in v0.0.3 I should have said in the first post that this module is only really good as a stopgap measure until either: a) this functionality is built into the core, as I think it should be b) someone builds a better module for this My dev skills are beginner/middling at best. I built this module for mostly for my own use and as a learning exercise. It gets the job done but I don't doubt for a second that there are better solutions possible. Regarding your suggestions: 1. Not sure this is a major problem as I think only multi-instance PW 3.0 sites are affected. But it was simple to change wire() to $this so went ahead and did that. 2. I have changed the template storage field to global. Not 100% sure this is the way to go so would like to hear more opinions on this. As for whether it is correct or not to use a fieldtype for storing the data - I have mixed feelings about this. I get where you're coming from and part of me does think it's a bit hack-ish. But on the other hand, the data stored in the field 'belongs' to the page so in many ways a fieldtype is ideal for this. I guess it depends if you believe a fieldtype should only ever hold page content and never page metadata. An example of another module that holds metadata in fieldtypes is Lumberjack so it's not without precedent. In any case, I don't have a good enough knowledge of MySQL to create a dedicated table and database interface in this module. Bitpoet does this in his TemplateParents module and maybe once I've learned a bit more about MySQL I could do something similar but for now I think this module will stick with the fieldtype approach.
    1 point
  41. ​ On the subject of the docs, I noticed that there is a typo on the following page http://processwire.com/api/ref/page/status/ Under the "See Also" section at the bottom, Page::addStauts() should read Page::addStatus(). Also the link is wrong and should be http://processwire.com/api/ref/page/add-status/ instead of http://processwire.com/api/ref/page/addstauts/ ​ ​I thought I'd mention it here rather than opening another thread.
    1 point
  42. Now you only have to convince Ryan to use this for Hanna Code, so we don't need to have two big ace installations
    1 point
  43. I've added and changed a lot of things on the dev branch. It'd be cool if you guys could test the current state to spot issues I have not encountered yet, so I can call it 1.0.0, merge it into master, and then publish it to the modules directory. Thanks! Changes, since the first post: 0.6.x - 0.12.x use noconflict version of ace implement possibility to add built-in extensions, by default emmet is enabled apply major PHP code refactoring 0.5.x enable field to be instantiated via API add interval check on editor.renderer.lineHeight and only initalize everything via callback when it is available add option to enable/disable localStorage make advancedOptions use the the Inputfield itself, INCEPTION! Regarding built-in extensions: They are sparsely documented, there are only two examples here. I have no idea what they all do. Some might even need additional libs, like emmet, which needs the core parser, that I included in this module.
    1 point
  44. I was just reading this post on how to make breadcrumbs in ExpressionEngine (http://bit.ly/hello_crumbly) and how you basically have to resort to a plugin to do it for you. It reminded me of some of the problems I had with EE when I was trying to use it and develop in it awhile back. One being that URLs aren't a primary/unique key to a page, natively in the system. Imagine ProcessWire with only it's root level pages and url segments, and that gives you an approximation of what you have to deal with in EE. I'm not saying it's wrong, but it's a different approach, and one that I found frustrating to work with. The post also made me realize I didn't have anything on the site demonstrating how you might make a breadcrumb trail (other than in the default site profile). It's really a simple thing (at least, relative to EE), so figured I'd post here. : <?php foreach($page->parents() as $parent) { echo "<a href='{$parent->url}'>{$parent->title}</a> "; } You may want to output those as list items or add some >> signs between items, but as far as code goes, the above is all there is to it. What it's doing is just cycling through the current page's parents till it reaches the homepage. Lets say that you also wanted to include the current page in your breadcrumb trail (which is probably redundant, but some sites do it). What you'd do is just append it to the list of parents that gets cycled through: <?php foreach($page->parents()->append($page) as $parent) { echo "<a href='{$parent->url}'>{$parent->title}</a> "; } The reason this is so simple is because every page is anchored to a specific URL and those URLs are representative of the site's actual structure. Pages in PW are actually uniform resource locators (URLs) whether on the front end or the back end. Because of that, there's no guesswork or interpretation to be done. In EE and Drupal (as examples) that data does not natively live at a specific URL. Instead that data is off in a separate container and the ultimate URL (or URLs plural) where it lives–and will be presented by default–are not as cut and dry. Yes, you can install plugins or go through strange taxonomic/channelistic/cryptic trials to approximate the behavior in other systems. And yes you can use url segments and pull/render any other pages you want in ProcessWire according to your own needs. But I'm talking about the fundamental and core system differences. This difference goes far beyond simplicity of generating breadcrumbs–it is a factor that translates to simplicity throughout the API.
    1 point
  45. Hello again kongondo, Thanks for helping me out. I had a read up on enabling URL segments cheers for pointing me in the right direction I didn't have that setup. However I have enabled it and now I get a 404 for pages in the console. I have my site setup on localhost/pw/ which might be causing the issues. I have included a base <base href="/pw/"/> in my <head> but it still errors "GET http://localhost/partials/about 404 (Not Found)" my base template for index "home" page <!DOCTYPE html> <html lang="en"> <head> <base href="/pw/"/> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title><?php echo $page->title; ?></title> <link rel="stylesheet" type="text/css" href="<?php echo $config->urls->templates?>styles/main.css" /> </head> <body ng-app="pwApp"> <nav> <ul> <li><a href="#/">Home</a> </li> <li><a href="#/about">About</a></li> <li><a href="#/work">Work</a></li> <li><a href="#/contact">Contact</a> </li> </ul> </nav> <h1><?php echo $page->title; ?></h1> <div> <div ng-view></div> </div> <?php if($page->editable()) echo "<p><a href='$page->editURL'>Edit</a></p>"; ?> <script src="<?php echo $config->urls->root?>/site/bower_components/angular/angular.js"></script> <script src="<?php echo $config->urls->root?>/site/bower_components/angular-route/angular-route.js"></script> <script src="<?php echo $config->urls->templates?>scripts/main.js"></script> <script src="<?php echo $config->urls->templates?>scripts/controllers.js"></script> </body> </html> My routing cofig var pwapp = angular.module('pwApp', ['ngRoute']); pwapp.config(['$routeProvider', function($routeProvider) { $routeProvider. when('/', { controller: 'homeCtrl', templateUrl: '/partials/home' }). when('/about', { controller: 'aboutCtrl', templateUrl: '/partials/about' }). otherwise({ redirectTo: '/not-found' }]); I also have a partials folder inside of the templates folder, then inside partials I have all my partial php pages about.php etc. Plus the partial.php with switch ($input->urlSegment1) { case "home": include("./partials/home.php"); break; case "about": include("./partials/about.php"); break; default: break; } any insights would be greatly appreciated.... Still learning!!! Thanks man
    1 point
  46. Hello, PageTable is described as a leaner way to enter large amount of repeatable data into the admin backend, possibly with different sets of fields (think different templates). The main advantages compared to the Repeater are: 1. PageTable can save new pages where you tell it to. Repeaters are saved deep down the Admin pages and are given cryptic names. 2. One PageTable field can make use of several different templates. Repeaters play according to the "One repeater = one template" rule (roughly put). PageTable is a PageArray, so relevant methods are applicable. For example, here is how to add and remove items from a PageTable field using the PW API: // create a new page // IMPORTANT: your PageTable field must be configured to use template 'basic-page' in the field Setup tab $newpage = $pages->add('basic-page', '/about/', 'address', array('title' => 'Write to us')); $page->of(false); // add the newly created page to 'pt' which is a PageTable field $page->pt->add($newpage); $page->save(); Here is how to remove the first item from a PageTable field: $page->of(false); // 'pt' is a field of type PageTable $page->pt->get(0)->delete(); $page->save(); That's a quick overview of this new field type. Give it a bit of your attention, it's quite promising. Cheers, Valery.
    1 point
  47. ProcessWire Forum Rules Version 1.1. Last updated November 10, 2014 Purpose of the Forums The ProcessWire forums are a self-help support forum where users can also contribute towards the future of ProcessWire. It is comprised of individuals from across the globe who want to help each other and who are giving much of their free time to do so. Many members have commented that the ProcessWire forums are exceptional in how equally friendly and hospitable they are to those who are very knowledgeable and those who are only just beginning to learn. A word about the rules The rules are here for the benefit of everyone. It says something about a community that we have not required any for four years despite the occasional heated debate. However, as the community has grown it seems only fair to create rules for both members and staff alike. Rules are not the same as laws. They are applied to each individual situation as the need arises and can be interpreted by the staff after reaching a consensus, where appropriate, or they may be enforced quicker in the case of situations requiring immediate attention or that are in very clear violation of the rules. Please respect the outcome of any decisions made by the staff. Rules for posting No Flaming. Never threaten the project, developers or other forum members. Threatening behaviour will be dealt with swiftly by staff and may result in a ban.. No Spamming. Spamming violations may result in your post count being reset, revocation of posting privileges, or even permanent banning from the site. There are several types of spam: Off-Topic posts outside the off topic “Pub” forum. If you wish to make an off topic post, please do this in the “Pub” forum. Multiposting. Multiposting is repeating the same message several times in the same topic, or, making a post directly after another, when you could have edited the additional comments into your first post. Multithreading. Multithreading is posting the same message in several different threads. If you do not receive a reply to your post, it may be that people do not have an opinion or are simply not online. Be patient. Unauthorized Advertising. Any unauthorized advertisements will be deleted and the offending member may be banned. Please note that linking to your company website is permitted in your signature as a plain text link. No discussion of politics or religion anywhere on these forums including the Off Topic boards - there are many other websites where you may discuss these topics. Please avoid very bad language. This is not an adult only forum so treat it as being family friendly. Please respect others’ opinions. Do not state that they are wrong and dismiss them in a derogatory manner. Please try and offer constructive counter-arguments when joining a topic containing a debate. If in doubt, don’t post. Please don't tell other people to go and search if they ask a question that has been asked before. If you like, inform a member of staff or a moderator via the reporting feature and we will do our best to merge it into a relevant topic, or you could suggest in a polite manner so as not to offend that they Google the forums via this link - just remember to be friendly as a link on its own can be mistaken for frustration or impatience. Please do not make demands of the developers of this project or of those who manage the forums. It is disrespectful to the people who give so much of their free time to this community Please contact us if you have an issue with another member or even a staff member - the relevant points of contact are at the bottom of this post Please respect the privacy of others. If a member chooses to use a pseudonym rather than their real name, that is their privilege. Please respect their wishes and do not out them even if their real name is common knowledge. Keep to one identity. Do not create alternate avatars and just stick to the one. If there are technical reasons why you need a new one (can’t rescue the old one, perhaps) be open about it. If you are angry about something, step back, take a breather and try to post a reasonable reply. If you feel that someone is being wholly unreasonable or stubborn, please contact a member of staff. Please try and use Common Sense. No set of rules can cover everything. If you think about what you are posting before posting, you shouldn’t run into any trouble. Remember, this is a forum about a software project, not world peace. It is doubtful ANY argument is important enough to be angry about. Please note that these rules may be updated from time to time. If you continue to use these forums it is assumed that you agree to them. Rules for using the Personal Message system The boards have a simple and unrestricted personal messenger - please use this responsibly. In addition to the above rules regarding posting: Please do not use the personal messenger to threaten anyone, tell them off or send a message that is likely to upset or offend. Please respect every member’s privacy and only PM someone if you feel they will be happy to receive a message from you. If you receive any messages that you feel are inappropriate, please contact a member of staff rather than taking matters into your own hands. Please do not copy and paste private messages into the public forums without the consent of the sendee. Actions we might take At the sole discretion of the forum staff and/or administrators, you may be given a warning if you break the rules. If the infraction is deemed severe enough, you will be banned. If you repeatedly break the rules or are belligerent in your response to staff/admin messages about an infraction then you will also be banned. If we do contact you it will be via the personal messenger system on the forums or, in the event of a ban, we will contact you via your registration email. We will not conduct conversations in public nor will we reply to any public conversations about a particular case. Points of contact If you have an issue that requires staff attention, in the first instance you should report the content using the “Report” link at the bottom-right corner of the relevant post. If you wish to, please contact a particular member of staff directly about an issue. If your issue is about a particular member of staff, please contact Pete and/or ryan via Personal Message. Please don't be put off by these rules. They are in place to help make sure that the site keeps its nice and friendly atmosphere. We're not here to rule with an iron fist - we’re here to discuss ideas and help one another, but we will act when people disregard the rules or ruin the atmosphere.
    1 point
  48. Posting Guidelines In addition to the rules, it is recommended that you read the following guidelines to get the most out of your interactions with this community. Interpreting other members’ posts Our community is a global community and as such posts and intentions can be misunderstood. If you encounter a reply that seems “short” and contains links to other topics that may answer your question, this may be due to the large number of members who use the forums on their mobile devices and want to help but don’t have time for a more complete reply or for whom English is not their first language. Please try and give people the benefit of the doubt when posting. Please do not dismiss their views out of hand (constructive replies are welcome). The forum language is English. We really appreciate the effort everyone makes from countries around the world to post in English. After careful consideration and experience on other forums, it makes sense to have one common language for discussion here so that ideas can be shared and not missed in language-specific forums - the same applies for debates that might get out of hand as we do not want to miss those either. There are more and more country-specific ProcessWire websites cropping up however so if you find that a group of you are in agreement and wish to set up a language-specific forum of your own then please feel free. Suggesting new modules/features Many of the features of ProcessWire have been born out of suggestions by users or discussions within the community, but that does not mean that every suggestion can be taken on board or that it might even be in tune with the overall strategy for the project. If you have suggestions for new features or modules, please feel free to propose them in a simple, open way in the Wishlist & Roadmap forum, but don’t be upset if no one is interested. Developer’s needs vary greatly. Your suggestion might well be something that is better developed as a third party module; in fact that is often the case. You are free to develop that yourself or work with others on a project, or even post a job to get help in the jobs board. However, whatever your idea or wish for a new feature, please do not make your suggestion sound like a demand, or tell the developers they have “got it all wrong,” or that you know what is best for ProcessWire. That is simply unfair to those who have been working on the project for free for years. Answering topics If you can help your fellow members then that’s great! Giving something back to the community in a constructive manner is always welcome. If someone replies in a topic you started and you think it is the best answer then please click the “Mark Solved” button at the bottom-right of the relevant post. Staff may mark a post as the best answer for you or change the chosen answer at their discretion if there is a better/more comprehensive answer later on in that topic. Some of the most prolific posters in the community do not count themselves at experts, but are very good at pointing new members in the right direction - you don’t have to be an expert in order to help out. Please don’t tell someone off for asking a silly question - there is no such thing! Every question is being asked because the person genuinely does not know the answer and might not know where to look. Raising issues or disagreements Nobody frequenting this forum should feel threatened when voicing their opinion as long as they are doing so constructively. Please be mindful however that everyone is unique and may interpret situations differently which could lead to misunderstandings. If you find that you disagree with someone, they may simply have a different point of view - this does not automatically mean that their view is wrong or your view is right. If multiple people disagree with you, it could be that a point has been raised many times before and/or that your point is not clear. Please seek clarification and remain calm or go talk about something else. If someone appears to be being simply argumentative, repetitive or belligerent in their replies then please do contact a member of staff and refrain from being drawn into the discussion further. To repeat, we are not solving world issues here, nothing is really so important that you HAVE to say something. If in doubt, say nothing and read another topic.
    1 point
  49. Pagination module doesn't work with in memory page arrays. Once you manipulate or merge arrays you operating in memory. Pager does need a single find db query to work. You'd need to create your own pager functions for in memory page arrays using the start and limit selectors.
    1 point
  50. For me CSS is the "fun, easy and quick" part. I don't feel like I am wasting my time there and I feel like I can make much bigger gains by improving on other aspects of my work. There are so few browser quirks today and so many well supported new stuff on CSS that I find it almost relaxing. But I don't use reset.css or ie specific stylesheets either and I have pretty much dropped using browser prefixes... I don't organize my CSS much and I enjoy "clever chaos" on that stuff. Developer tools give me exact line number for the selector and that's it. I'm kind of oldschooler here Of course if I would be doing more experiments and design on css or maintain large (= really huge) sites etc then I think it might be much more valuable for me. I am pretty sure that in some personal project I will try some css pre-processor, and if I find it huge improvement (like 5 times cleaner and faster than pure css) then I might start thinking how to make it part our workflow at Avoine. To be honest, I don't see that happening anywhere near though.
    1 point
×
×
  • Create New...