Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 02/17/2016 in all areas

  1. www.bcal.co.uk A website redevelopment for a UK based civil and structural engineering practice. The previous site, built with classic asp, was looking old and was not responsive. The client, however, was very happy with it and it took some persuasion to get them to agree to a new site. This new site is one of my first Processwire sites - two more are in development and due to go live very soon. The main focus of the site is the 'Projects' portfolio which displays projects randomly in a carousel and the list can be filtered by sector and/or discipline. Each project can have a slideshow and be tagged to specific sectors and disciplines. The website also includes current vacancies (with online application forms), latest news articles, sector descriptions, discipline descriptions, map and directions, and narrative pages. PW Version: 2.6.7 with uikit - used Formbuilder for application forms. www.bcal.co.uk Any comments, issues, or suggestions welcome. Paul (www.keywave.com)
    7 points
  2. I needed a language switcher so i searched the forum and docs, found very useful stuff, but as im new in processwire (came from joomla) all this is still a bit confusing for me, need time to get use to it i guess. There's probably other people like me get confused in all the power of pw, and need language switcher on the site, so i decided to share what i came up with. Actually its very simple, a lot easier then i thought. There is very nice example in docs using select box (there i found out about $languages array, and its clicked), but you need additional script if you wanna style it, so i came up with something simple: TADAAAAA <?php foreach($languages as $language) : ?> <a href="<?=$page->localUrl($language)?>"><?=$language->title?></a> <?php endforeach;?> Here's another example, but now active language is just a span with active class. (Style used on most websites). <?php foreach($languages as $language) : ?> <?php if($user->language->id == $language->id) :?> <span class="active"><?=$language->title?></span> <?php else : ?> <a href="<?=$page->localUrl($language)?>"><?=$language->title?></a> <?php endif;?> <?php endforeach;?> Here is UIkit dropdown example, same can do with bootstrap, just a bit different markup. <div class="uk-button-dropdown" data-uk-dropdown> <button class="uk-button"><?=$user->language->name?></button> <div class="uk-dropdown uk-dropdown-bottom"> <ul class="uk-nav uk-nav-dropdown"> <?php foreach($languages as $language) : ?> <?php if($user->language->id != $language->id) :?> <li><a href="<?=$page->localUrl($language)?>"><?=$language->title?></a></li> <?php endif;?> <?php endforeach;?> </ul> </div> </div>
    5 points
  3. I have two of my own sites (weekly.pw and streetworkoutpori.fi) running on 3.x and so far everything has been pretty smooth. When I initially updated ProcessWire Weekly from 2.7 to 3.x I had to go through some hoops and a few modules were not working as expected, but most of those were related to early issues in File Compiler. Now that these issues have been fixed, I would say that 3.x is relatively stable. The sites I've built from scratch using 3.x never had any issues. Since 3.x is a development branch, you might want to wait a few days after Ryan's "friday updates" before updating your site, especially if it's already live, though. That way you can make sure that no new issues were introduced
    4 points
  4. I'm migrating a massive project that consists of about 15 business systems (like Martijn's they have no front-end), but the same install also powers a fairly large University level public site. It's just on a dev server for now, but so far we haven't found anything broken. Nothing. Zero. I still can't believe it, but there's a lot that remains to be tested.
    4 points
  5. Hi folks, I quickly tested locally with ProcessWire 3.x and it worked by disabling the file compiler for the external mpdf library. I need to test a bit more, especially the multi language support of the module, before I commit a new version. But if you want to make it work in the meantime, here you go: Add // FileCompiler=0 to the first line after the php opening tag in the file /site/modules/Pages2Pdf/mpdf/mpdf.php Delete the folder /site/assets/cache/FileCompiler/site/modules/Pages2Pdf to make sure the module files are recompiled Now generating and downloading PDFs should work Cheers
    3 points
  6. I am working on 2 Sites going only within the next month. Another big one going online maybe in June. A private site is already online. Until now everything is working quite stable. Look forward, not backwards.
    3 points
  7. More quick suggestions, now about performance. If the project has still budget, you can quickly improve a lot on this area. // IMAGES - Compress images. Just on the homepage, you have 1.5MB of images being downloaded. This is too much! I did a quick compression and the results are: Logo: from 11.3kb to just 1.25kb. One carrousel image: from 178KB to 86kb. Images are attached. // CSS - You can inline the content of these 2 small css files inside the homepage, to avoid http requests, as they are very small: slideshow.css slidenav.css - And inline this one on contact and career pages as well: form-select.min.css - Minify bcal.css // JAVASCRIPTS - Concatenate all these javascript files into one: uikit.js (or at least minify this one) slideshow-fx.min.js slideset.min.js slideshow.min.js lightbox.min.js - Move jquery to the end of the file - Is add this truly necessary on the homepage? By removing you got less js being loaded. And I suggest change the position of the icons below the sidenav on the other pages. People won’t look at the footer the share something. --- UPDATE: I just notice that I compressed the logo too much. I set it to 4 colours. Should've being 8.
    2 points
  8. If 'View/ Edit links on selected pages' is enabled this option should be hidden in case user has no edit permission for the selected page. Now an ugly error message is shown in the modal. Would be nice to not provide the link in this case. Apart from this module is working properly under 3.0.8. Thumbs up and many thanks for the last fixes.
    2 points
  9. A bootstrap 4 alpha version exemple with navbar and dropdown : <nav class="navbar navbar-dark bg-primary bg-faded"> <button class="navbar-toggler hidden-sm-up" type="button" data-toggle="collapse" data-target="#exCollapsingNavbar2"> ☰ </button> <div class="collapse navbar-toggleable-xs" id="exCollapsingNavbar2"> <a class="navbar-brand" href="#">Responsive navbar</a> <ul class="nav navbar-nav"> <li class="nav-item active"> <a class="nav-link" href="#">Home <span class="sr-only">(current)</span></a> </li> <li class="nav-item dropdown"> <a href="#" class="nav-link dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Languages <span class="caret"></span></a> <ul class="dropdown-menu"> <h6 class="dropdown-header">Dropdown header</h6> <?php foreach($languages as $language) { // determine the "local" URL for this language $url = $page->localUrl($language); // output echo "<li><a class='dropdown-item' href='{$url}'>{$language->title}</a></li>"; } ?> </ul> </li> </ul> </div> </nav>
    2 points
  10. Some general/security related info about this topic can be found here: https://processwire.com/docs/security/other-software/ EDIT: I also recommend using a subdomain for the staging site. Not just for security reasons but generally this is the "cleanest way" to separate the two.
    2 points
  11. Right now we are busy with 2 big data projects and both we do in PW3. It's quite stable, but all software has bugs. For us the reason to choose PW3 is to be ready for the future. ImportPagesCSV for example doesn't work but next to that I do not see many issues. On the other hand, both projects have no front-end, so no testing over there . I think when the time allows potential slowdowns due to bugs, it's good to live cutting edge and support ProcessWire with bug reports.
    2 points
  12. I thought I'd start this thread so we could all share our favorite debugging techniques. The idea for this came from this post by Soma: http://processwire.com/talk/topic/4416-delete-user-when-page-is-deleted/?p=43320 and some of the followups with other suggestions. Here's one that I find really useful. It allows you to output content to the browser's console from PHP. It sends content from PHP through javasacript's console.log(); Not as powerful as FirePHP etc, but simple and easy to use. Put this function somewhere that it will be available to all your template files. function debug ($data) { echo "<script>\r\n//<![CDATA[\r\nif(!console){var console={log:function(){}}}"; $output = explode("\n", print_r($data, true)); foreach ($output as $line) { if (trim($line)) { $line = addslashes($line); echo "console.log(\"{$line}\");"; } } echo "\r\n//]]>\r\n</script>"; } Then you can simply put these anywhere in your templates: debug('test'); debug($variable); debug($array); This keeps your page content clear of debug messages and is easier then looking in log files, like if you were to use error_log() What are your favorite techniques?
    1 point
  13. It occurred to me that a good addition to the forums would be some way for PW users to indicate support for a module idea. Similar to the Wishlist subforum but for functionality that belongs in a module rather than in the core. I'm thinking mainly of commercial modules, although if someone wanted to take up a module request and release it freely that would be cool. So users could propose a module idea, then others would vote for it (using likes or some special voting option) so that a vote means "I'd buy that", with the expectation of pricing in the general ballpark of Ryan's pro modules and Apeisa's PadLoper. As a beginner-intermediate developer I'm really enjoying working with PW and learning as I go - the API is so intuitive that I've been able to build my own solutions to things that in another CMS I would have been reliant on someone else's module to achieve. But there are things that I know are beyond my current skills, and for those things I look to third-party modules. My clients are non-profits and small businesses so I'm never likely to have the budget to commission a custom module alone. But there might be other PW users out there with similar needs and maybe that demand would make it worthwhile for an experienced developer to take on a proposal and release it as a commercial module. Currently there isn't a way to measure the demand for modules apart from occasional forum posts like "Is there a module that...?" Any thoughts on this? Here's a module request to start off with: I would be happy to buy a full-featured event calendar module. I've searched the module directory and the forums and Lindquist's module is the most feature-rich I've seen, but it's in an alpha proof-of-concept state and some important functions aren't implemented. Features I would be looking for are: Calendar grid interface in admin, allowing for easy addition and editing of events. (Nice but non-essential) Week and day views in admin, in addition to month view, with drag editing for event date and duration (I'm dreaming of something awesome like the dhtmlxScheduler interface or Fullcalendar interface). Although drag operations would really need an undo to correct accidental edits, so this may be more trouble than it's worth. Events are edited in a modal window, to avoid losing one's place in the calendar. Recurring events, with user-friendly selection of recurrence options. The ability to individually edit or remove an event that is a child of a recurring event (i.e. make an exception for that individual event). (Nice but non-essential) A couple of out-of-the-box minimal rendering options for the frontend (read-only calendar view, list view). This is the kind of module I need frequently. I've been lucky that I haven't had a client request a full event calendar since I've been using PW, but it's only a matter of time. I'm sure there are other PW users who need this and who would, like me, be happy to pay for such a module.
    1 point
  14. @pmichaelis: I don't think that it has to do with the multilingual site, this always works fine for me. And it doesn't matter whether english is the default language. `english` is just a label. Could you please try to rename the field so that it doesn't contain camelCase (capital letters)? For example field_backgroundImages to field_background_images. Have a look at the description: "Any combination of ASCII letters [a-z], numbers [0-9], or underscores (no dashes or spaces)." I don't know whether this is the reason but I would like to give it a try. Edit: Tested it using a camelCaseField without any problems. Using two languages "default" and "english". But my system is case insensitive . Which PW version do you use?
    1 point
  15. To work on PW 3+, you need to change two lines on AmazonS3Cloudfront.module: Line 1 - Add PW namespace: <?php namespace ProcessWire; Line 21 - Add a slash before the class name. This references it on global namespace, not on PW's: use \Aws\S3\S3Client;
    1 point
  16. Here are some resources that may help you https://processwire.com/docs/tutorials/installation-moving-and-troubleshooting/page5 https://processwire.com/docs/tutorials/troubleshooting-guide/ https://processwire.com/talk/topic/3113-how-to-transfer-processwire-from-local-installation-to-online/
    1 point
  17. Many thanks @Sérgio for your suggestions and advice ! Kind Regards Paul
    1 point
  18. This is a classic case for OR-groups. parent=/portfolio/, sort=sort, (project_location_london=camden), (project_location_elsewhere=midlands)
    1 point
  19. That's not true. $page->render() is not new at all, just rendering a single field was added.
    1 point
  20. Forgot to mention to enable gzip, you can save 74,5% on the page weight: http://checkgzipcompression.com/?url=http%3A%2F%2Fwww.bcal.co.uk%2F
    1 point
  21. Sérgio, you're right. I thought you had to use S3 but you can use any server for CloudFront delivery.
    1 point
  22. Oh, yes. I overlooked the "subdomain". That would have been my next idea, and probably the best. Thank you all.
    1 point
  23. As szabesz said, everything will work. Until you do not hardcode your urls but use the API, all good.
    1 point
  24. There isn't currently. But as soon as ProDrafts is a thing this should really change.
    1 point
  25. Thanks Kogondo for your answer and the welcome back. Great that it is a focus point for this year. I sure do understand the limits of these goals and also the great value of the forum for more advanced usage examples. But this render($options) thing seemed so obvious fundamental to me that I wanted to know what was going (or not) on about it in general. Is there a place to file 'doc' issues or is it too early for that? I'd like to turn my 'effort' from investigating 'why hasnt this not being done yet' to something more proactive and positive.. instead of just sort of being grumpy
    1 point
  26. @jtborger, You are not wasting anyone's time. The fact of the matter is that overall, there is still a lot of room to improve ProcessWire's documentation and tutorials across a range of topics spanning both basic and advanced stuff. It is something we are aware of and are keen to improve. Part of the Road Map for 2016 is exactly that...'continued and greater focus on documentation and tutorials'. Of course this does not mean everything will be done and dusted by the end of play 2016 but there should be some positive advances nevertheless. Whilst there are some great examples in the forums regarding various uses of the ProcessWire API, those cannot and should not be considered as a long term solution in lieu of proper documentation. In the meantime though, they are a good place to start if you are searching for particular answers. Welcome back to the forums
    1 point
  27. Hello, Here is a small contribution from me for the PW community I converted the Greek characters to ASCII ones so when a user writes a title in Greek language it will be auto validated. To do this you have to copy and paste the below values on Modules > Core > Page Name. α=a ά=a β=v γ=g δ=d ε=e έ=e ζ=z η=h ή=h θ=th ι=i ί=i κ=k λ=l μ=m ν=n ξ=ks ο=o ό=o π=p ρ=r σ=s ς=s τ=t υ=y ύ=y φ=f χ=x ψ=ps ω=w ώ=w It would be great if Ryan include this on the next PW release.
    1 point
  28. In the past I have struggled a lot with right clicking in MODX. I really didn't know you could right click. Most documentation didn't even tell you could right click, so I really didn't understand where to find the settings they mention. About the left nav. These days most of our projects do not need a front-end at all. Most of those sites are about managing data. We really need the horizontal space. 20+ fields on a row in ListerPro is not something unusual here.
    1 point
  29. I often use jsdelivr as free javascript CDN. They also offer the files for this slider on their CDN at https://www.jsdelivr.com/projects/flickity Only for those who are interested in. Advantage: you can combine multiple js files from this CDN into one - so only one request will be made Best regards
    1 point
  30. As I don't know what post fits better I decided to post updates in mine. Link: https://processwire.com/talk/topic/12194-comments-manager-module-error-usinguninstall/ EDIT/UPDATE: If you just want to delete and not use this module, you can replace a few values in the .module file, uninstall it and revert the replaced stuff. File location: \wire\modules\Process\ProcessCommentsManager\ProcessCommentsManager.module Comment::statusApproved => $this->_('approved'), Comment::statusPending => $this->_('pending'), Comment::statusSpam => $this->_('spam'), Comment::statusDelete => $this->_('delete') To the following: 1 => $this->_('approved'), 0 => $this->_('pending'), -2 => $this->_('spam'), 999 => $this->_('delete') There are 3 more "Comment::statusDelete". Just replace them with 999 and you are good to go. After this, upload the changes. You can now uninstall the module. Afterwards, just revert the changes and upload again. Clarification for the values: The "Comment"-Class is located under: \wire\modules\Fieldtype\FieldtypeComments\Comment.php There are constants declared. Have fun ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- EDIT: Kongondo pointed out our mistake. The problem is that we don't have a field for comments yet. Therefore the error fires. To uninstall: 1. Create a new field from the type "Comments". 2. Uninstall CommentsManager 3. Delete Field created in 1... 4. WIN
    1 point
  31. what i've been trying out today is just doing it in javascript, using this: https://github.com/nwcell/ics.js/ because then whatever events are viewable in the dom can all be put into a one-click add to calendar on the fly I'm showing events list in a datatable) what i'll probably do is put each piece of the info into data attributes, like data-title, data-description, data-dtstart, data-dtend as a test i have this working: ('#download-ics').click(function(e) { var cal = ics(); e.preventDefault(); $("#events tbody tr").each(function(){ var title = $(this).find('h3').text(); var desc = $(this).find('h3').text(); var loc = $(this).find("dd.location").text(); var dtstart = $(this).find("dd.dates ul>li").text(); cal.addEvent(title, desc, loc, dtstart, dtstart); }); javascript:cal.download(); }); you could also have a single click id for the button next to any individual event and then not do the each
    1 point
  32. I did try this and it did not work, because getById returns a PageArray, not a Page object in spite of the get part in the method name. Using something like first() on the returned result seems to give you the cashed (changed) version of the page. But there is a getOne option that managed to do the trick. So I could only get it to work like this: $oldPage = $this->wire('pages')->getById($page->id, array( 'cache' => false, // don't let it write to cache 'getFromCache' => false, // don't let it read from cache 'getOne' => true, // return a Page instead of a PageArray ));
    1 point
  33. I plan to give this all some serious attention next week. I'll get some updates out soon.
    1 point
  34. You're right in that saveReady happens just before Page is saved, but the values of this Page object have already changed. Database contains old values, Page object contains new values, so if you ask the Page for any of it's fields, it'll return the values as they are now (already changed). This is one of the reasons why my Version Control module, for an example, actually stores current values instead of old values. On the next change+save it stores next set of values, and so on. For my use case this didn't make much of a difference, and it was (at the moment) only simple way to do it. That's probably something you could do here too; otherwise you'll have to hook at some point where the values are sure to be unchanged, store them, and later compare them with changed values at saveReady (or find a way to create a copy of current page and return it to database defaults while leaving the ready-to-be-saved Page object intact, though if your uncache trick above isn't doing this, I'm not entirely sure how to do it). Another thing you could check out would be the (relatively new, 2.4+) ___changed() method. This commit contains all the changes related to this feature.
    1 point
  35. I love how this happens. I run into something that I can't figure out, so I check the forum. Guess what? My question was asked and answered on the same day. Thanks guys.
    1 point
  36. Hah, you were lucky I was even here atm
    1 point
  37. $page = $event->object->getPage();
    1 point
  38. 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
×
×
  • Create New...