Jump to content

Leaderboard

Popular Content

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

  1. A couple of months ago we launched our very first PW site, which was just a very small site concerning a conference taking place in 2020. Last week we launched our second site, and it was a much bigger project - https://jobs.antarctica.gov.au/. Our jobs (both in Antarctica and within Australia) were previously a part of our main site at http://www.antarctica.gov.au (which is yet to be redesigned and moved into PW), so we were tasked with creating a brand new site in time for the recruitment season opening in early December. While the timeframe was tight (we only had about a month to build it), it was great to be able to work within PW, and then to introduce our editors to it. They love it in comparison to our old CMS (as do we!).
    15 points
  2. You can also switch PW versions instantly with Tracy. By default it works with versions which are archived by Ryan's PW Upgrades module, but there should be nothing stopping you from recreating those archived version manually by creating .wire-x.x.x folders with the contents of that version's wire folder.
    11 points
  3. I'm on win7 and use different PW and different PHP versions in parallel, by switching symlinks. I create individual site folders for each project, regardless if it is a client site or a module. Then I copy shell scripts of the desired PW versions into the webroot folder of the project, and by executing one, it creates me a wire folder, symlinked to the desired PW version. This way, I can switch between different PW versions with one or two clicks. To test with different PHP versions is possible with executing shellscripts of my allday editor NoteTabPro. It shutdown the running apache service, symlinks the apache main directory with one that suports the desired PHP version and starts the service again.
    7 points
  4. The notion of core in MODX might be different from the one in ProcessWire (maybe?). Btw, I don't know if you've seen this post on MODX to ProcessWire welcome brief? It might be of interest ?. One of the philosophies of ProcessWire, one that makes it very extensible is the fact that everything, all its building blocks is a module. Yes, even the admin (backend) is a collection of modules. Modules are just PHP classes. You have your classes (i.e. modules, or the site's custom classes) and these live here: /site/modules/. ProcessWire has its own core classes: the ones designated as modules live here: /wire/modules/. The are other classes, in fact, the main classes of ProcessWire, aka the core, and these live here: /wire/core/. In order for ProcessWire to know about and register your classes, they have to live where ProcessWire expects them to, i.e. /site/modules/. Now, this does not mean that all your classes have to be modules. No; you can have custom classes (i.e. my_class.php) living in /site/modules/my_module/my_class.php or /site/templates/includes/my_class.php (@note: includes here is just arbitrary) which you access from within your registered classes (modules) or from within your template files. Any attempt to access such classes directly will be blocked by ProcessWire for security reasons. This just means you can have helper classes or other libraries you need for your modules which ProcessWire does not need to be aware about (in respect to registering them). The foregoing means that... ..is not necessary in ProcessWire. your /site/ is already outside the core. It survives upgrades and ProcessWire never touches it. It just communicates with it (bidirectional communication). All ProcessWire core variables (e.g. $wire, $config, $fields, $page, $pages, etc) are available everywhere for your use, both in the backend and the frontend. I hasten to add that ProcessWire will not automatically install your modules for you. If it finds a new module, it will just let you know that it has found a new module. If it finds duplicates of the module, i.e. either duplicated under /site/modules/ or under both /site/modules/ and /wire/modules/ , it will alert you to the fact and will ask you to choose which one you are going to use. This means that you can duplicate a core module found in /wire/modules/ under /site/modules/, edit it to suit your requirements and ProcessWire will happily continue serving the copy under /site/modules/ and yes, it will survive upgrades. This is not always a good idea though, as the mother module could get some upgrades which you would be missing on and/or require. So, in ProcessWire, we develop our modules under /site/modules/. Most people who develop modules use a versioning system, invariably git, and host their modules on GitHub, BitBucket, GitLab, etc. Secondly, many people make use of git's branches and work in the dev branch. All development and testing is done under that branch. When ready for production, they merge into master branch. For modules submitted to the ProcessWire modules directory, if the project (code) is hosted in GitHub, ProcessWire (the site) reads the master branch of the project to access the README and the download link. In the past, I have used symlinks to link my module to different ProcessWire versions. For a quick and dirty check, I have occasionally had two wires, e.g. wire and wire27 which I rename to suit my needs RE ProcessWire version. Many of us here develop using the latest ProcessWire dev. I cant' speak for everyone, but I think many then use (if they need to) a ProcessWire 2.7 just for final tests. I doubt many of go back and forth between versions (i.e. between 2.7 and 3). No ?. As long as you name your module classes as per ProcessWire requirements work with what suits your needs. The above is just the basics. We have people here who work in teams and have slightly different approaches, but the basics are the same.
    6 points
  5. Have a look at the Connect Page Fields module. This will let you simultaneously add conferences to speakers when you add speakers to conferences. You can also get pages that reference a page via the API with $page->references() since PW 3.0.107.
    5 points
  6. RockFinder v1.1.0 now supports filters. This makes it possible to use custom access control (eg showing only certain rows on a RockGrid): https://github.com/BernhardBaumrock/RockFinder/commit/3e4daae0f283280672ab606a1eef1b16497f19fe https://github.com/BernhardBaumrock/RockFinder/blob/3e4daae0f283280672ab606a1eef1b16497f19fe/readme.md#filters--access-control Filters & Access Control You can filter the resulting rows by custom callbacks: // show only rows that have an id > 3 $finder = new RockFinder('id>0, limit=5', ['title', 'status']); $finder->filter(function($row) { return $row->id > 3; }); You can also use these filters for showing only editable pages by the current user. Be careful! This will load pages into memory and you will lose the performance benefits of RockFinder / direct SQL queries. $finder->filter(function($row) { $page = $this->wire->pages->get($row->id); return $page->editable(); }); One thing to mention is that you can apply these filters BEFORE or AFTER closures have been applied. If you apply them BEFORE executing the closures it might be a little more performant (because closures will not be executed for rows that have been removed by the filter), but you will not have access to columns that are populated via closures (like page path).
    3 points
  7. Graphql is a query language you most often use for frontend/backend interaction or even public apis (kinda an alternative to rest). You wouldn't want to give random users direct access to sql though.
    3 points
  8. You can render the comments list and comment form for another page by calling render() and renderForm() on the value of the comments field of that other page. For example: // Get the page $p = $pages(1234); // Render comments list echo $p->comments->render(); // Render comment form echo $p->comments->renderForm(); If you have the "Redirect after comment post?" option checked then the user will be redirected to the page being commented on after the form is submitted. You probably don't want that so you could adjust the value of the hidden page_id field in the comment form. Unfortunately there's not much that's hookable in the FieldtypeComments module so you'd have to do this by editing CommentForm.php (first copy the FieldtypeComments module to /site/modules/) or use Javascript to change the field value. Alternatively you could disable the built-in redirect option and handle redirection after form submission via your own code.
    2 points
  9. The TracyDebugger method seems to be the easiest one! Thank you for the hint!
    2 points
  10. @maxf5 - fixing it – is an issue with AOS, release 0.5.3 does fix it. And I've also further refined the login screens: Well, I had designed colourful login screens, but did not really like them. If you still want to look at these and maybe give some feedback, you are welcome:
    2 points
  11. Yes. They say it's the next big thing since...eh, the last next big thing ?.... https://medium.freecodecamp.org/a-beginners-guide-to-graphql-60e43b0a41f5 https://blog.apollographql.com/graphql-vs-rest-5d425123e34b https://graphql.org/ https://www.prisma.io/blog/top-5-reasons-to-use-graphql-b60cfa683511/ https://medium.com/open-graphql/graphql-1-140fab436942 ...and some reasons why you may want to avoid using it... https://www.robinwieruch.de/why-graphql-advantages-disadvantages-alternatives/ https://blog.logrocket.com/5-reasons-you-shouldnt-be-using-graphql-61c7846e7ed3
    2 points
  12. I was exactly thinking about that some days ago but I still can't find the time to do tests.
    2 points
  13. Sure, I'm not talking about giving public users access to SQL but executing the query directly via SQL (and not via some php code like regular $pages->find() operations do). Don't know how GraphQL works in this regard. That's what I was interested in. Because it would also be possible to use RockFinder as some kind of service endpoint quite easily: I guess I need to try GraphQL and hope to find some time for that soon...
    2 points
  14. And you can use RockFinder as the probably most efficient way.
    2 points
  15. No problem! BTW, I have updated the module so it is now tagged as requiring php 5.4 so hopefully no-one else comes across this error.
    2 points
  16. Admin Theme Boss A light and clear theme based on Uikit 3 Features Five unique color options Beautifully redesigned login screens Modern typography using Roboto Condensed Extended breadcrumb with edit links Extends AdminThemeUikit, so you can continue using all current and future AdminThemeUikit features Option to activate theme for all users Compatibility with AdminOnStreoids and other third party modules Updated and Releases There is a shiny new release page where you can subscribe to updates for new releases of AdminThemeBoss. Color Variants: ProcessWire Blue Dark Black Vibrant Blue Happy Pink Smooth Green *new with 0.6.1* Requirements Requires a current ProcessWire version with AdminThemeUikit installed and activated. Installation Make sure AdminThemeUikit is activated Go to “Modules > Site > Add New“ Paste the Module Class Name “AdminThemeBoss“ into the field “Add Module From Directory“ Click “Download And Install“ On the overview, click “Download And Install“ again… On the following screen, click “Install Now“ Manual Installation Make sure the above requirements are met Download the theme files from GitHub or the ProcessWire Modules Repository. Copy all of the files for this module into /site/modules/AdminThemeBoss/ Go to “Modules > Refresh” in your admin Click “Install“ on the “AdminThemeBoss“ Module
    1 point
  17. Yes! It's just for testing right now.
    1 point
  18. Dear Mats, I'm trying to get your Leaflet Map Module with PJAX to work. I'm using the MoXo https://github.com/MoOx/pjax library but seem to have some troubles with it: I managed to configure PJAX that the inline JavaScript is executed after every page fetch, but I get Error: Map container is already initialized. Any ideas how to approach this? EDIT: I decided to use my own code with the standard Leaflet library and getting the marker with data attributes: .map(data-lat=$map->lat data-lng=$map->lng data-zoom=$map->zoom data-address=$map->address) initializing the map with import L from "leaflet"; document.addEventListener("DOMContentLoaded", function(event) { let container = document.querySelector(".map"); let mymap = L.map(container).setView([container.dataset.lat, container.dataset.lng], container.dataset.zoom); L.tileLayer('https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token={accessToken}', { maxZoom: 18, id: 'mapbox.outdoors'}).addTo(mymap); let marker = L.marker([container.dataset.lat, container.dataset.lng]) }).addTo(mymap); }); and triggering DOMContentLoaded in pjax: document.addEventListener("pjax:success", function(event){ window.document.dispatchEvent(new Event("DOMContentLoaded", { bubbles: true, cancelable: true })); });
    1 point
  19. Hi, look at join-monster (Stem) or DataLoader (Facebook) to solve the N+1 query problem.
    1 point
  20. Thanks for all your suggestions! I thought it would be possible with just one query. Connect Page Fields seems like a good choice here (because I have no idea, how I would use RockFinder with the GraphQL module ? ) Thanks!
    1 point
  21. With a hook in site/ready.php like this one, // hook for pageimages to return a webp url $wire->addHookProperty('Pageimage::urlWebp', function($event) { $image = $event->object; $path_parts = pathinfo($image->filename); $webpFilename = $path_parts['dirname'] . '/' . $path_parts['filename'] . '.webp'; if(!is_readable($webpFilename)) { $event->return = '#'; // what should be returned for none existing webp variations ? return; } $path_parts = pathinfo($image->url); $webpUrl = $path_parts['dirname'] . '/' . $path_parts['filename'] . '.webp'; $event->return = $webpUrl; }); you can use it for testing purposes right now.
    1 point
  22. @kongondo wow, I didn’t expect a full tutorial in answer to my question! Great! This community is one of the best I’ve ever seen!
    1 point
  23. AFAIK the only way to ask PW to get you conferences that has particular speakers in it, is to pass which speakers exactly you want. The selector looks like "template=conferences, speaker=1234|1235|1236..." So, you need get the speakers before you can query the conferences. My only solution is to query all your speakers first. Then make another query of all conferences that has those speakers in it. Query them all at once. And then, in the client when you are listing conferences for each speaker, just filter through them. I know, it's not a great solution, but I can't think of another way. I haven't used ProccessWire in a while, so there might be some better way.
    1 point
  24. That's totally fine. We could simply not support different formats besides webp for now. I was really just talking about the configuration, so if there is time in the future to have a more extensive featureset supported we don't need to change the configuration, but can just add the features / remove warnings.
    1 point
  25. Should Google really be the ruler of the web? Great effort and results, anyway! ?
    1 point
  26. Hi @bernhard! Gutenberg in Wordpress is a dual misconception: Wordpress is known as a blog platform. Yes, you can extend it massively and use it for many different projects but in the end it's mostly about operating with text. It's usually enriched with images and embeds but it's still an article, news, etc. So many authors for so many years just copied and pasted their texts, added few media and with 2-3 clicks published it. Now, doing this simple task with Gutenberg is insanely uneffective: instead one simple menu in editor there are several (hidden) menus everywhere (in every block). And EVERYTHING is a block now - a title, a paragraph, an image, a quote and so on (imagine the amount of additional code it generates!). You have to do absurdly much more things to get the same result and you have to spend much more time to do the simplest task. So maybe Gutenberg is for designers rather? If it's true and if this was the idea (to simplify building content) - there are so many so much better WP site builders and themes (to do so) FOR YEARS! Anybody who wants a one-page site or portfolio just picks up a theme and few plugins and voila. The core blogging mechanism stays safe and ready when necessary. I can understand that Matt, Automattic and the dev-deciders want to turn with WP elsewhere and change the character/purpose of the platform. Their choice (though the style they're doing that is embarrassing). But cutting out all those (millions?) of websites using WP for TEXT PUBLISHING and trying to convince the whole world that Gutenberg is better tool to write an article than TinyMCE or CKEditor is as funny as idiotic. From practical point of view, Gutenberg is incompatible with so many plugins and themes (used stably for years!) that it broke hundreds (thousands?) of websites. Blank sites, errors, bugs everywhere AND in many cases people have no idea where is a problem and what to fix. At my site (mentioned above) I have 50 plugins. Half of them doesn't work or generates errors with Gutenberg. Just take a look at the reviews of Gutenberg (and their dates!) to catch the disaster happening there. I know perfectly from my own experience how such a "click click drag-and-drop magic" approach can be tempting. Probably even using PW at some point (it's still ahead of me!). But it's the whole different way and phillosophy of creating (fast) content. There are all those Wix, Weebly, Spacesqare and Mobirise builders for that. WordPress as it was thought in the beginning shoudn't go that way (that 30% of web share will fall quickly).
    1 point
  27. I found the root cause. I disabled in my CKEditor the anchor plugin. If you take a look into the InputfieldCKEditor.module file you can see there is a check if the anchor plugin is disabled the HTML Purifier option "Attr.EnableID" is also disabled. self::$purifier->set('Attr.EnableID', stripos($this->toolbar, 'anchor') !== false); // for anchor plugin use of id and name attributes Is there a possibility to override that configuration, or must it be changed directly in the InputfieldCKEditor.module file?
    1 point
  28. Hi all, first post here but in case anyone else is experiencing this issue, I'd suggest checking if you are trying to use plain old http: instead of shiny yummy https: While taking my first test site out for its first spin in the wild I noticed this message, then immediately after visiting this post realized I hadn't yet enforced https on the site. As soon as I used https instead, the popups disappeared, and as soon as I switched back to http there they were again. Naturally can't say for sure what anyone else is experiencing, but it surely worked for me.
    1 point
  29. You have several options in the backend: 1.) Page based under Page > Settings Enable or disable every non default language. Trying to access an inactive page will result in an 404 2.) Template based under Template > Advanced (bottom) 3.) Field based under Edit Field > Details
    1 point
  30. 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.
    1 point
  31. Ah, ok. Seems that I have to clarify a bit: with the age of 10, he started with a desktop pc i5 and 16gb ram. From that on, he is more and more interested in retro machines. I'm not totally sure, but I think currently he owns 4-5 (old) Laptops of different decades, an old IMac, 5 mobiles, 3 tablets and 1 C64. The C64 is the most beloved for him, and he works on different hardware parts. Also he has built different audio adapters for DOS Laptops. Unfortunately the Sound Chip of the C64 seems to be broken. Don't ask me! - he told me something that not all 8 channels are working but only 2, and that it is not possible to detect the concrete issue of it with his limited equipment. So, he is more interested in modifying the hardware then in sitting in front of a screen. From time to time I pray, that the C64 is the stop in his retro interest, not that I someday has to look out for a Z4. ?
    1 point
  32. Hi there, in need for a light knowledge base software and not happy with solutions such as MediaWiki, Dokuwiki or Confluence I decided to try to build such a tool based on ProcessWire. At the moment this profile is lacking of features, but doing well in the context it is created for - a somewhat protected simple knowledge base for internal use. It has some basic features but I'm aware that there's still way to go. So if anyone is interested, please find the code attached here or on GitHub: https://github.com/marcus-herrmann/ProcessWire-KnowledgeBase-SiteProfile I exported the data from a PW 2.4 installation, but not have tested it yet against older versions. Installation Before running the installer of ProcessWire copy/replace /site-default/install/ /site-default/templates/ /site-default/modules/ with the folders from this zip. Constraints It's not possible to export user roles with ProcessWire's Site Export Module this profiles templates are checking just whether they are accessed by an anonymous or logged in user. Features Tagging of wiki-articles Set articles to globally sticky ( = for all users) Personal bookmarking of articles for logged in users When using markdown to author wiki-articles, code highlighting via highlightjs Included modules Fredi MarkupSimpleNavigation Hopefully this profile is useful for you in any way. Best, marcus Edit: Forgot GitHub link... ProcessWire-KnowledgeBase-SiteProfile-master.zip
    1 point
×
×
  • Create New...