Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 12/04/2018 in all areas

  1. Just for the records: There is a simpler solution now: $siblings = $page->siblings(false);
    4 points
  2. Languages are Pages in PW (like almost everything else). A user viewing any page in multilanguage environment has a language property attached (see here). So you can do it like this: <?php if($user->language->name != 'default') { echo 'Hello, multilanguage world!'; } You can use $user->language->id if you want.
    2 points
  3. https://www.spiria.com After several sites made with ProcessWire, Spiria decided it was time to get rid of its cumbersome Drupal site. To be honest, ProcessWire is still difficult to sell to customers, because this CMS/CMF is not as well known as the most popular ones. The migration to ProcessWire therefore served several purposes: Eliminate the frustrations experienced with Drupal (especially with image management and some structural problems). Allow integrators to learn the CMS during quiet periods, when they are not needed on other projects. Promote the CMS by adopting it. The challenges were many, but by no means insolvent, thanks to the great versatility of this programming framework. Indeed, if ProcessWire can be considered as a CMS in its own right, it also offers all the advantages of a CMF (Content Management Framework). Unlike other solutions, the programmer is not forced to follow the proposed model and can integrate his ways of doing things. The blog The site includes a very active blog where visuals abound. It was essential to cache the various dynamic components. For example, in all sections of the blog, there is a list of recent articles, a list of "short technical news", another list from the same author, a classification by category. In short, these lists evolve independently. ProcessWire's cache system, including its ability to classify by namespace, has significantly improved loading speed. Cache file management has been placed in a "saved" hook in the useful "ready.php" file. Data migration Importing the blog data was complex because at the time the site was designed in Drupal, programmers had not been used the easily translatable "entities", so each article resided in two different "nodes" (pages). We would have liked to use the core ProcessWire import module, but it does not yet take into account multilingual fields. However, we have used this code as a basis for building our own import module. This is one of ProcessWire's great qualities, as a CMF, it is easy to use existing code to design your own solutions. Reproduce the layout The current layout of the site has been reproduced exactly as it serves the company's needs very well. ProcessWire has simplified the work in many ways. Apart from the blog, which is very structured, the other sections of the site are more free, especially the case study section ("Our Work"). The use of page reference fields has particularly helped developers. As everything is a page in ProcessWire, you can create a pseudo relational database within the site itself. The administrator user becomes more aware of the data hierarchy and has better control over the data. Programming architecture The separation between controllers and Twig visualization files facilitates the management of the multiple components of the site. We haven't really explored the "regions" of ProcessWire, because we prefer not to mix these aspects of programming. This greatly facilitates the timely arrival of programmers in our department, used to an MVC structure, because they have a better understanding of what does what. The Search Once again, we were able to simplify what had been done in Drupal. There are two types of searches on the site, the blog search and the more general search on page 404 ( https://www.spiria.com/potato). The Drupal site search was driven by an Apache Solr server in Drupal. We decided to rely on the ease of ProcessWire and the Typeahead library (for the blog), because we didn't need the power of Solr (or Elasticsearch) anyway. Work to improve performance still needs to be done in this area. We would have liked to have seen the excellent search tool offered on the administrative side available on the frontend. We have not yet had time to explore the possibility of harnessing this code from the core of ProcessWire. Our wish here is that the CMS designer, Ryan Cramer, sees this as an opportunity to offer an exciting new feature to his CMS! Powerful modules We have the excellent modules ProCache (static caching), ProFields (fields that greatly improve the functionality of existing fields) and ListerPro (data search and processing tool). As the site is installed on a nginx server, we have ruled out ProCache for the moment and we are satisfied with the use of the cache() function alone. The ProFields fields are a blessing just like ListerPro. This last module is very useful to correct, for example, import errors (we had more than 800 blog articles, some of which date back to 2013). We used a functional field to gather translations of terms that would normally have remained hard coded and difficult to access in the translation interface (an aspect to be improved in ProcessWire, in our opinion). By grouping translations in a single page, site administrators can easily change or correct terms. Language management What remains a very small irritant for us is the management of languages, which is fantastic in many ways. The fact that there is a default language is both a blessing and a problem. For example, in 2013, blog articles were not systematically translated. We experienced the same situation with a customer's site. If the article is only in English, no problem, we only have to not check French as an active language. However, if the article is only in French, we are still required to create the page in English and make tricks in the code, thanks in particular to a checkbox such as "Not present in English" to reproduce the behaviour naturally present for English (or any language deemed by default). Perhaps there is a more elegant solution here that we have not yet discovered. It's not much, but some clients don't see why there are two ways to do it here. In conclusion In any case, ProcessWire's great qualities continue to appeal to programmers, integrators, graphic designers, users and even our UI/UX expert. The solidity of the CMS/CMF, its functionalities all translated into objects/variables ($pages, $page, $config, $sanitizer, $input... the list is long) allows us to systematize our workflow, easily recover code and reduce production costs. Although it is dangerous to offer only a CMS solution to our customers (hammer syndrome that only sees nails), it is tempting to consider ProcessWire as the Swiss Army knife par excellence of Web programming. As mentioned above, the CMF is suitable for all situations, has very good security tools and its designer has successfully improved PHP methods to make programming very pleasant and intuitive. For us, migrating the company's website to this platform was the best tribute we could pay to its designer, @ryan.
    1 point
  4. From what I understand, you could create/publish pages regardless of roles/permissions. However, if you were to wrap the page creation in an if statement like : if($user->hasPermission('permission-name', $page)) { // user has this permission, for this $page } then that person with the permission could perform whatever action you created.
    1 point
  5. Of course, that's the one I'm using currently. Nice functionalities but limited in terms of design. And again, it feels old… (i know i know, it's not. But still…) ?
    1 point
  6. Ok thanks for trying. It was a shot into the blue. I will setup a repeater field locally and debug it. (Maybe tomorrow)
    1 point
  7. I'm getting "The process returned no content." with the error:
    1 point
  8. It worked! Thank you @psy I have learn an important lesson about copy paste.
    1 point
  9. We finally discovered the culprit. An IPV6 entry that was still pointing to Pantheon. Everything should be ok by now.
    1 point
  10. Hey @bernhard - I have a slightly revised version that tweaks the returned array to exactly match getallheaders(). I'll implement this is Tracy shortly unless anyone else has any better ideas. $headers = []; foreach($_SERVER as $name => $value) { if($name != 'HTTP_MOD_REWRITE' && (substr($name, 0, 5) == 'HTTP_' || $name == 'CONTENT_LENGTH' || $name == 'CONTENT_TYPE')) { $name = str_replace(' ', '-', ucwords(strtolower(str_replace('_', ' ', str_replace('HTTP_', '', $name))))); if($name == 'Content-Type') $name = 'Content-type'; $headers[$name] = $value; } }
    1 point
  11. Afaik ryan's position on hard constraints in form validation is that they don't work and you should expect things to be off. Like what happens if you change a input field from min. 1 to min. 2 images. Suddenly all your pages are in an invalid state and there's no form validation, which can save you from that.
    1 point
  12. Hi @spackmat, welcome to the forums. Some fields have basic validations that can be configured in the field's settings. In more advanced cases like you mentioned, it would be better to handle those with hooks to add your own validation.
    1 point
  13. Hey @Guy Verville, excellent write-up!! Thank you for that! I've been using ProCache for about 3 years now in Nginx without any issues. So, go ahead! ? PS: I'd like to suggest you post in on Medium, etc. as well to increase reach. If you decide so, I also suggest to add to Ryans role: creator and maintainer of Processwire... instead of just designer, as people may only read "graphic/web designer" when they see that.
    1 point
  14. @lenoir - I think all those old themes should be removed from the modules directory - hopefully with the imminent site rebuild they will be. I think the problem with PW's admin theming approach is that new functionality doesn't make it into 3rd party themes. I have always said that we need a skinning approach, rather than (or perhaps in addition to) theming. That said, the approach that AdminThemeBoss takes is in effect a skin, rather than a separate theme and I think this is great and is perhaps a model for others to follow.
    1 point
  15. While it is not an 'out of the box' solution, it is perfectly possible to for instance to use the RestAPI module to parse any bit of content, such as (items from a) repeater matrix. Just like when you would write your regular template logic, it does require some custom programming on your end though: you will have to go through the matrix' items and decide how they should be presented through your API. Which is exactly the flexibility which makes PW our go-to solution for pretty much any modern (headless) webapp or old-school site! ?
    1 point
  16. Hey, @jrtderonde! If you have some money to spend, maybe you could approach @dadish and hire him to modify his GraphQL for ProcessWire module to handle Repeaters and Repeater Matrix fields? If you decide to make it open source, this would be an amazing contribution to the community. I also tend to use the RepeaterMatrix as a flexible content builder ?. Suggesting this because you talking about agency and long term plans.
    1 point
  17. It works here on PW latest. Did you override the setting in field context? You can check that by adding "$config->advanced = true;" in site/config.php, then opening the user template and clicking on the pass field. There will an additional tab "Overrides" that shows all settings that have been changed in this template context (and allows you to reset them).
    1 point
  18. So, here we are. Sorry the actions are a little hectic in respect of the file size (though its still huge enough to get trouble with the forum upload). tried imgur now:
    1 point
×
×
  • Create New...