Leaderboard
Popular Content
Showing content with the highest reputation on 07/17/2022 in all areas
-
I like repeaters for structuring data. For building a layout, not so much. I've seen the demo's on this forum of people using repeaters in creative ways to build a layout, but it never looks very intuitive to me. I've grown to dislike this approach so I've been looking at other content management systems for inspiration. Bolt CMS uses Article Editor, which is a nice (paid) javascript solution that's basically an advanced wysiwyg editor with support for grids and other nice features. I decided to integrate this into Processwire as an inputfield. Here's a demo: I created a few plugins for Article Editor that take care of uploaded images, inserting links and Hanna code support for adding dynamic bits to the editor. And the field also works in repeaters. You can pass your CSS to the editor so that the editor preview should look identical to the real page. I am using Bootstrap. A bonus of building a page this way is that the whole layout is stored in a single field so there should be fewer requests to the database compared to repeaters. Please note that since Article Editor is not free, you need a license to use it. I've been working on this module on and off for a while. There are refinements to be made, like perhaps loading the Hanna code previews dynamically (they are currently inserted into the editor after saving the page). Not sure if it would be good enough to release publicly but I thought I'd share it anyway because I'd like to hear if you think this is a nice approach :)4 points
-
As @Ivan Gretsky said, the core of CKEditor 5 has changed and implementing it in PW will require significant changes, so maybe we should consider other options like https://imperavi.com/article. It is also used in Bolt CMS (not a promotion).3 points
-
Nice to know, thx! Does the iframe height fit as well? Both tools are very similar. When doing my research I had the feeling that plausible is a little more mature and has some more features (like password protecting the share screen). Maybe the module will get some updates in the future that use the API (for example showing the page view count in the page tree like PageHitCounter does). That would need different implementations for plausible and umami, so it's good to think about maybe supporting both upfront.2 points
-
As far as I know CKEditor 5 is quite a different beast and transition to it would require some massive changes. But it surely could bring a lot to the table. Maybe even some basic content builder functionality.2 points
-
Just to be clear: CKEditor 5 is licensed under GPL, unless I'm mistaken. LGPL would likely be less of an issue (if not a non-issue), since it's relatively permissive (no strong copyleft, dynamic linking with proprietary code allowed, etc.) Anywho — very interesting to hear that there's a (likely) roadmap to 5 in the future ?2 points
-
You just need a plain equals sign. $pages->find("template=adebate, deb_inter=$page->id"); And usually I just use $page alone because the string value of a Page object is its ID. $pages->find("template=adebate, deb_inter=$page");2 points
-
Integrate plausible analytics or umami into your ProcessWire backend https://processwire.com/modules/rock-analytics/ https://github.com/baumrock/RockAnalytics Quickstart: Install the module Setup plausible analytics (either self hosted or paid cloud) Copy the tracking code into your site's markup Copy the share URL to your module's config Donations ??? About plausible analytics Plausible is a "simple and privacy-friendly Google Analytics alternative". It is open source and you can either self host it or buy one of their hosted services. A live demo of their dashboard and its features can be found here: https://plausible.io/plausible.io Tracking Snippet When you add a website to your plausible dashboard it will show you a tracking code that you can paste into your site that you want to track. This is what I use to make sure that we only track users on the live site (not on local development) and only logged in users: if(!$user->isLoggedin()) { $src = "https://plausible.verdino.com/js/plausible.js"; echo "<script defer data-domain='{$config->httpHost}' src='$src'></script>"; } Providing a dynamic domain is handy because during development you can add a second website to your dashboard and see if everything works without messing up data of your live site account. Example: We want to track the site "example.com", so we add this site to our plausible dashboard. Then we add the snippet with the dynamic domain attribute. On local development we have the host "example.com.ddev.site" so all visits will not show up in the plausible dashboard for example.com; Now we add another website to plausible with the domain "example.com.ddev.site" and voila - we will see our dev-websites' visitors in realtime. Backend Menu Item By default RockAnalytics will create a menu item at the top level of your backend menu, but you can move that page to any place you like. For example you could move the analytics page under the "setup" page at the top of the screenshot. You can also rename the page if you don't like the label "Analytics".1 point
-
This week on the dev branch are several updates to the comments system including support for custom fields on comments (which we're calling comment meta data). I'm currently working on a site that uses a reviews system powered by BazaarVoice. It's pretty nice but it's also very expensive (I think at least $500/month in this case). The system powers their reviews which include not just a rating and review text, but also a bunch of other criteria that the user can provide. See an example here — click the "Reviews" tab and what you see there now is currently coming from BazaarVoice. But in a couple of weeks you should see the same thing powered by ProcessWire. Think of this like a comments system with custom fields. That's not something that ProcessWire has supported before, but now this week it does. Though I know most don't need this, so have kept it pretty simple, focusing just on adding API methods to make it possible to get and set custom field values for any comment. These include: $comment->getMeta('name'); $comment->setMeta('name', $value); $comment->removeMeta('name'); The name and $value can be whatever you decide. There's also a bonus $comment->meta() method which combines the methods, letting you get or set, kind of like the meta() method on Page objects. If you want to use comment meta data like this, it's exclusively an API feature. So if you are looking to collect custom fields from users, you'll want to implement your own comment form rather than the default. In our case, we'll be using FormBuilder to implement the comment form that includes the review and custom fields. But you could just as easily use a homegrown form. When it comes to outputting that custom data, you'll want to handle it more like you would outputting a repeater, iterating through the $page->comments and then using $comment->getMeta('name'); for each of the custom properties you want to output. Worth noting is that output formatting doesn't come into play here, so if some text in the meta data needs to be entity encoded for output (for example) then that's your responsibility. How about later editing of the meta data? Should you need it, the ProcessCommentsManager module (Setup > Comments) has been upgraded to support editing of comment meta data. Next to each comment is now a "Meta" link, and if you click it, you'll get a modal window on top of the comment enabling you to edit the meta data as JSON. That might seem a little unconventional, but I'm trying to keep it simple and flexible. Most will probably use this to view meta data rather than edit it, but the ability is there when/if needed. I didn't think it would be worth spending the significant time building a full-blown page-editor like environment for editing comment meta data, but also felt like I needed something like this for occasional editing needs. The InputfieldCommentsAdmin module was also updated to have meta data links for each comment. But the reality is if you have ProcessCommentsManager installed, chances are you aren't editing comments in the page editor anyway. So a new option has been added in the comments field configuration (Input tab) enabling you to disable comments in the page editor and instead link to the editor in the comments manager. When enabled, your Comments field in the page editor would instead look like this: This is worthwhile because the comments manager is just a better place to view/edit comments in the admin since it is paginated, supports editing of all properties, and lets you sort/filter as you see fit. Whereas a big list of comments in the page editor just slows it down. This week the CKEditor version has been upgraded to 4.19.0 (see release notes). I'm also emailing with the people at CKEditor about getting us a license to use CKEditor 5 with ProcessWire. As you may or may not know, the CKEditor 5 license (LGPL) isn't compatible with ProcessWire's license (MPL2 and MIT), so we are working on a license agreement to make it possible. Since CKEditor 4 will reach EOL in 2023 it's a good time to start planning for CKEditor 5 and I'm excited to work with it. Thanks for reading and have a great weekend!1 point
-
Problem: As the page ID is currently used for the creation of the page folder, does not allow the pages to be imported correctly when they are Exported/Imported in the admin. Example: Having a website in production generating new content constantly, and in my development copy I add some categories, pages and other content that includes images, logos, etc. When I upload the local folders to the server, and export/import that pages, the relationship between them is lost, because the exported IDs are already used in production on other pages and PW generates new IDs. Another consequence is that the contents of the local folders are mixed in the folders of the online pages that share that ID. Solution: Would be to add a new internal parameter to each page based on some kind of uuid, which serves as a unalterable reference for naming and accessing the folder related to that page.1 point
-
Hi @Pixrael i didn't know this module and it could be a solution actually for a lot of projects i work on as this both way relation between pages occurs very often having me write tricky php things that it could solve "natively" even if pw itself already makes things so simpler and faster! thanks a lot for your help have a nice day1 point
-
Just adding another note to myself and anyone else that runs into this problem again. Had a new domain on Dreamhost with the same problem and the agent found two additonal rules to whitelist. He gave me the details in case it happens again: SecRuleRemoveById 921150 SecRuleRemoveById 9202701 point
-
@virtualgadjo check this, it may also be useful in your project: https://processwire.com/modules/connect-page-fields/1 point
-
1 point
-
This module has been superseded by SearchEngineFileIndexer and there will be no further development for it. --- This module is an optional — and experimental — add-on for SearchEngine. It adds support for indexing PDF file contents. While SearchEngine is technically able to index file fields and contained Pagefile(s), it will natively only store the name and description of each file (and hopefully soon custom field values as well). This module hooks into Pagefile indexing and, if said Pagefile looks like a valid PDF document, attempts to extract human-readable text from the file itself. Getting started is straightforward: install and configure SearchEngine, install SearchEngine PDF Indexer, and choose which PDF parser library you'd like to use. The rest should happen automagically behind the scenes. GitHub: https://github.com/teppokoivula/SearchEnginePdfIndexer Composer: composer require teppokoivula/search-engine-pdf-indexer --- Now, as you may or may not know, PDF files are notoriously difficult to process programmatically. For this reason a) we're going to rely on third party libraries to handle parsing them, and b) things can still go wrong, so please consider this module an early beta release. It did work in my early tests, but there's little guarantee that it will work in real life use cases, and as such I'd recommend backing up your site before installing/enabling this module ? Also: while this module can be installed via the admin or by cloning/downloading module from the GitHub repository, please note that you need to run composer install in the module's directory — or preferably install the whole module via Composer. This is mainly because I really don't like bundling dependencies with the module, especially when there's a bunch of them. (... although if you dislike Composer or for whatever reason can't use it, feel free to load either smalot/pdfparser or spatie/pdf-to-text manually. Just make sure that they're available by the time the module's class file is constructed.) -- If you get a chance to use this module, please let me know how it went ?1 point
-
No worries, this is always an interesting topic to discuss, as off-topic as it may be. My answer will be a bit lengthy, so I'll wrap it in a spoiler tag (feels overkill to split this into new topic) ?1 point
-
Thank you for the response @elabx But, check_access=0 does not work. I have tried it already. It still returns an empty array. That's what was more confusing for me! ? (I should have added it in the question. My mistake.) And yes, it is the same with find() and the parent selector. ----- @Jan Romero yes, you are right! I do use the selectors in a key-value pair for more clarity in code ?1 point
-
Hi Andreas, Thank you so much! This was exactly the answer I hoped to hear! Best, Toni1 point
-
hi @dotnetic wow, this is huge and exactly what i was looking for and it return our beloved pw pages array instead of just ids like my query did, one bad habit less! ? you've just proved one thing, now i need to know the blog by heart too... thank you so much for your help have a nice day P.S. as i love reading articles i agree with ? the first link in your signature has changed, it's now https://dotnetic.de/blog/processwire-the-best-cms the current one throws a 404 ?1 point
-
I think you could use just $page->references('template=adebate') to get the debates that reference this speaker. See the blog post ProcessWire 3.0.107 core updates1 point
-
Maybe it's not intuitive but an equals sign matches pages in a Page Reference field regardless of whether it is a "single page" field or a "multiple pages" field with more than one page selected in it. So it must be some other issue, like maybe your page you are trying to find is unpublished or hidden?1 point
-
Yes, but the module is still in deep development. It's kind of never ending, but I have put a lot of consistent time into it over the last month. I'm at mostly the refactoring stage now as I have gotten in most of the features I want. I am stripping out experimental ideas that just didn't feel right, such as the 3rd approach in my video (too overcomplicated). Page builders are... not difficult to develop but easy to overcomplicate. To be clear, my module is not going to be just a page builder (although that is a large part of it). It's essentially my vision of a highly opinionated, modularized starting point that works well with a CSS framework of your choosing (UIkit3, Bootstrap5, Tailwind, CodyFrame or no CSS framework). Whichever CSS framework one uses, a page builder (ie, the 'Blocks' field), would be provided that's built around the chosen CSS framework. UIkit3 would be the most flexible in page building capability (since UIkit is designed for page building scenarios and it's easy to replicate the logic and thought process of how YOOtheme did their builder), but the page builders for others would work well too as they would be inspired by YOOtheme's approach but just adapted for the respective CSS framework. I'm taking great care to make it as easy to use as possible. A goal of this is to make ProcessWire easy to use for those who are just starting to use it and not sure how to structure things. This is where the heavily opinionated decisions I made come in.1 point