Leaderboard
Popular Content
Showing content with the highest reputation on 05/15/2024 in all areas
-
I wish I could write a longer reply but I'm going to be unavailable for a solid week, however check out what I wrote here (wrote it last week) which includes a lot of bullet points that you may find useful: https://github.com/jlahijani/awesome-processwire?tab=readme-ov-file#why-processwire Also welcome to the forum. You'll be in good company!5 points
-
I don't have a link, but some bullet points of things I like about it. Clear separation between data and presentation layers (but doesn't force you into a SPA or operate as a headless CMS although you can do that with it if you want). Excellent permissions management system at both template and individual field level. Simple object model - everything is a 'page' with 'fields' - (similar to Drupal's nodes, but without the baggage). Great admin UI for no code creation of pretty much any kind of structured data. Actively developed third party migrations module (RockMigrations) that lets you mix and match visual and code based development of object definitions. Excellent third-party debugging tool, TracyDebugger Easy to learn API (I managed to understand the basics of it within half an hour - Drupal and WordPress by comparison, I was still scratching my head after quite a few hours.) Secure Fast Things people might not like about ProcessWire: You're unlikely to be able to build a website with one-click install. There are some site profiles that may suit some scenarios, but the whole point of ProcessWire is that it doesn't second guess you and force its opinions on you. ProcessWire's only area where it is somewhat opinionated is how it stores and structures data at the SQL level. Currently it only supports mySQL/MariaDB, and normally each field has its own table in the database, although ProFields modules Table, and Combo allow more traditional database table structures. It's also relatively easy to build custom fieldtype modules with their own database schemas. Version/source control: If you don't use a third party module like RockMigrations, syncing data changes between development and production with a team of developers might be complicated. (Actual output templates are no problem)4 points
-
3 points
-
Hi @All, I made the page with only admin access so I can check in frontend visually (a chart) and links - what pages are most linked from blog pages and where I forgot to use this opportunity. This is important for SEO and removes manual labor. If you have any suggestions, feel free to shoot. Simple explanation: I got template=post and want to see stats with inner links to the homepage and service pages. Thanks @poljpocketfor helping me out! <?php namespace ProcessWire; // Calculate Internal Link Counts and Linked Pages $pages = wire('pages'); // Get all relevant pages directly in one query $relevantPages = $pages->find("template=post|service|home"); $blogPosts = $relevantPages->find("template=post"); $mainPages = $relevantPages->find("template=home|service"); // Function to check if a post DOES NOT link to ANY PUBLISHED service OR home page /** @var PageArray $mainPagesLinks */ $mainPagesLinks = $wire->wire(new PageArray()); foreach ($mainPages as $mainPage) { // this will remove duplicates by default $mainPagesLinks->append($mainPage->links("template=post")); } // Calculate Internal Link Counts and Linked Pages $linkCounts = []; $linkedPages = []; foreach ($relevantPages as $page) { $linkCounts[$page->id] = 0; $linkedPages[$page->id] = []; if ($page) { $items = $page->links(); if ($items->count()) { foreach ($items as $item) { if ($item->template != 'admin') { $linkCounts[$page->id]++; $linkedPages[$page->id][] = $item; } } } } } arsort($linkCounts); // Prepare data for the circle chart $chartLabels = []; $chartValues = []; foreach ($linkCounts as $pageId => $count) { if ($count > 0) { $page = $pages->get($pageId); $chartLabels[] = $page->title; $chartValues[] = $count; } } ?> <div class="container py-5 mb-5 links"> <div class="row py-5"> <div class="col-12 col-md-4 offset-md-4 pb-5"> <canvas id="linkCountChart" width="200" height="200"></canvas> </div> <div class="col-12 col-md-8 offset-md-2"> <div class="accordion" id="internalLinksAccordion"> <?php foreach ($linkCounts as $pageId => $count): ?> <?php if ($count > 0): ?> <?php $page = $pages->get($pageId); ?> <div class="accordion-item"> <h2 class="accordion-header" id="heading<?= $page->id ?>"> <button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#collapse<?= $page->id ?>" aria-expanded="false" aria-controls="collapse<?= $page->id ?>"> <?= $page->title ?> (<?= $count ?>) </button> </h2> <div id="collapse<?= $page->id ?>" class="accordion-collapse collapse" aria-labelledby="heading<?= $page->id ?>" data-bs-parent="#internalLinksAccordion"> <div class="accordion-body"> <?php if (!empty($linkedPages[$page->id])): ?> <ul> <?php foreach ($linkedPages[$page->id] as $linkedPage): ?> <?php if ($linkedPage->template != 'service'): ?> <li><a href="<?= $linkedPage->url ?>"><?= $linkedPage->title ?></a></li> <?php endif; ?> <?php endforeach; ?> </ul> <?php else: ?> <p>No internal links found for this page.</p> <?php endif; ?> </div> </div> </div> <?php endif; ?> <?php endforeach; ?> </div> <h3 class="pt-5">Posts without Links to Service and Home Pages</h3> <table class="table"> <thead> <tr> <th>Post Title</th> <th>Edit Link</th> </tr> </thead> <tbody> <?php // echo results foreach ($blogPosts as $post) { if (!$mainPagesLinks->has($post)) { echo "<tr>"; echo "<td><a href=\"{$post->url}\">{$post->title}</a></td>"; echo "<td><a href=\"{$post->editUrl}\">Edit</a></td>"; echo "</tr>"; } } ?> </tbody> </table> </div> </div> </div> <script src="https://cdn.jsdelivr.net/npm/chart.js"></script> <script> document.addEventListener('DOMContentLoaded', function () { // Chart data is now defined within the JavaScript scope const chartData = { labels: <?= json_encode($chartLabels); ?>, datasets: [{ data: <?= json_encode($chartValues); ?>, backgroundColor: [ 'rgba(255, 99, 132, 0.8)', 'rgba(54, 162, 235, 0.8)', 'rgba(255, 206, 86, 0.8)', // Add more colors as needed ], }] }; const ctx = document.getElementById('linkCountChart').getContext('2d'); const linkCountChart = new Chart(ctx, { type: 'doughnut', data: chartData, options: { plugins: { legend: { display: true, position: 'bottom', }, } } }); }); </script>2 points
-
Just want to acknowledge that almost all of the tweaks I've contributed were originally authored by Roland (tpr) as part of AdminOnSteroids - I've just converted the main features I use over to RockAdminTweaks format.2 points
-
2 points
-
Then your function is the wrong way around. You are looking for outgoing links but the function gives you incoming links. Try (untested): <?php namespace ProcessWire; // Get all relevant pages directly in one query $relevantPages = $pages->find("template=post|service|home"); $blogPosts = $relevantPages->find("template=post"); $mainPages = $relevantPages->find("template=home|service"); /** @var PageArray $mainPagesLinks */ $mainPagesLinks = $wire->wire(new PageArray()); foreach ($mainPages as $mainPage) { // this will remove duplicates by default $mainPagesLinks->append($mainPage->links("template=post")); } // echo results foreach ($blogPosts as $post) { if (!$mainPagesLinks->has($post)) { echo "<tr>"; echo "<td><a href=\"{$post->url}\">{$post->title}</a></td>"; echo "<td><a href=\"{$post->editUrl}\">Edit</a></td>"; echo "</tr>"; } }2 points
-
You should make sure that the links you are looking for actually apply to the restrictions of the links() function in $page. The docs state that this, quote: Does this shed some light? Also, and most important: I think you are using it the wrong way around. The function docs headline is "Return pages linking to this one (in Textarea/HTML fields)". Now, you want pages with no outgoing links to some other pages whereas as I understand it, the links() function gives you incoming links from other pages. So to achieve your goal, you should make a set of pages by calling the links() function on your $relevantPages and check if your post page is in the set.2 points
-
Padloper 009 I am pleased to announce the release of Padloper 009! It has been a minute! I apologise for the delay. Padloper 009 introduces a number of new features, bug fixes (especially in Multilingual sites) and improves overall code efficiency. Credits Before I get into the details, I would like to say massive thanks for all who have contributed to this release in various ways. You have contacted me via the forums, via PM and via email to report bugs, test Padloper and suggest and sponsor new features. In particular, I would like to thank (in no specific order) @Spinbox, @alexm, @joe_g, @ank, @csaggo.com, @Jan Fromm, @Pete, @Sonia Margollé and @kalimati. Whilst I will not name those who contacted me privately, please accept my gratitude for your help. Apologies if I forgot to give anyone a mention! Massive thanks to @ryan for ProcessWire. Padloper 009 is the most battle-tested Padloper yet! It has been tested and developed on high volume sites, sites that require lots of customisations and multilingual sites whose default language is not English. This robust development has helped fix bugs that I would not have been aware of otherwise as well as new ideas and features to improve the API, workflow and GUI of Padloper. Many of the suggested features have made it into this version. A few others are planned for the future. There is a lot to talk about in this version. Below I’ll just give a summary of the changes and where necessary, create separate topics to discuss some of the new features. Although Padloper 009 has undergone thorough testing, there might, inevitably, be some bugs. If you find one, please let me know in the forums under a separate topic. Thanks! Changes Features Home Customisable dashboard. You can render your own dashboard by creating a template partial named ‘padloper-process-render-shop-home.php’ and placing it at ’/site/templates/padloper/backend/padloper-process-render-shop-home.php’. Please see this thread for more details. Orders Customisable single order view. You can render your own dashboard by creating a template partial named ‘padloper-process-render-orders.php’ and placing it at ’/site/templates/padloper/backend/padloper-process-render-orders.php’. Please see this thread for more details. Order status actions: Can be applied manually for order, payment and shipping status. Quick filters e.g. ‘open’, ‘cancelled’, ‘abandoned’, etc. Products Configurable pricing fields. Sales and Normal Price (e..g WooCommerce) vs Price and Compare Price (e.g. Shopify). Please see this topic for more details. Categories can optionally be named ‘Collections’. Configurable via ‘/admin/shop/configure-padloper/’. Bulk clone existing products. Allow duplicate titles for products. Discounts (new) 4 discount types: Orders, products, free shipping and BOGO (Buy One/Get One - unfinished; see below). Can be applied manually or automatically at checkout. Please see this thread for more details. Add/remove via ‘/admin/shop/configure-padloper/’. Part sponsored by Nifty Solutions. Thanks @Pete! Customers and Customer Groups (new) Customer creation and management. Please see this thread for more details. Customer Groups. This feature will be expanded in the future. Please see the above thread for more info. Add/remove via ‘/admin/shop/configure-padloper/’. General Settings Redone interface Add ‘from email’ settings.. Add bank details settings.. Add order ‘least and most’ sales thresholds for orders’ quick filters. Settings for ‘low stock’ and ‘price fields’ for products. Add tab ‘user interface’ with settings for shop navigation (can have side menu and/or dropdown navigation) and search features (can use quick filters and/or advanced filter). Other Backend Quick filters on various dashboards. Custom Dashboards for Home and Orders. More to be added in future. Frontend Custom shop root page. This allows you to move product-related pages and legal pages to live under a frontend-accessible page. Configurable via /admin/shop/configure-padloper/. Please see this topic for more details. For instance, /myshop/products/, /collections/, /products/, etc. This means you can directly access products on the frontend using their real paths/urls instead of using URL segments. This setting can be changed anytime via configuring Padloper at /admin/shop/configure-padloper/. Custom URL segments for checkout out. E.g. instead of /checkout/success/, /checkout/confirmation/, etc., you can have custom, multilingual segments, e.g. /checkout/order-success/, /checkout/tilaus-menestys/, etc. Miscellaneous Various UI improvements. Dashboards tables sorted by title by default. Breaking Changes Template partials for the frontend have been moved from /site/templates/padloper/ to /site/templates/padloper/frontend/. Deprecated ‘Search Feature’ on the home dashboard has been removed. Use ProcessWire in-built search instead. Padloper hooks into it to group padloper related results. PadloperProcessOrder::orderSaved now becomes PadloperProcessOrder::orderSavedHook.The new approach is to have all hooks in one please for easier maintenance and usage. Bug Fixes Please see the bug fixes topic. How to Get It Padloper 009 is available at https://processwireshop.pw/products/padloper/. For those renewing subscriptions, you will have to wait a bit, apologies. I am finalising work on renewal codes. I am hoping this will be ready by tomorrow. Any issues with the (revamped ?) site please let me know ?. Upgrading This is a major upgrade. Lots of code has been moved around. Best way to upgrade files is to empty the contents of the root Padloper folder and upload the contents of the new version there. There are no data model changes affecting existing features but as always, back up your site(s) first! Next Steps In addition to fixing any bugs that show in 009, these are the plans for the next 3-6 months, possibly more, in order of priority. No new features will be introduced until these are completed. Documentation Documentation will cover all topics including installation, backend and frontend use and the API. ‘How to guides’ will consist of short videos with corresponding textual content on a dedicated Padloper site. Discounts Finish work on the Buy One Get One (BOGO) Discount and automatic discounts. Gift Cards Finish work on Gift Cards. Road Map I will talk about this when the ‘next steps’ tasks have been completed. Thanks!1 point
-
This is my first module. It is primitive, like my neighbor who loves to fire up his new Makita breaker hammer after 21:30h. Please, feel free to do whatever you want. I don't promise I will add better functionality but maybe... If you do, please ping and send me back. Thanks! It loads every page on the backend. It calculates the text width in two fields you choose on the configuration page.. If there are any updates, I will post them here. Happy ProcessWiring! PS: These measurements are specifically for desktop and Google's SERP (Search Engine Results Page). UPDATE on 15 May 2024: Google started to calculate (truncate) the meta title for 20px Arial yesterday. The Module has been updated. Here is the link to download/install the latest version: https://processwire.com/modules/seo-text-width/ EDIT: The version 0.0.5. Added two dropdown fields on the configuration page of the module. PROVE IMAGE: You can check the meta title, which was measured with 18px Arial and it was less than 512 pixels.1 point
-
Hello everyone! I'm new to the forum and currently exploring a solution for our agency. I've had some limited experience with ProcessWire before and found it quite impressive. However, neither my colleagues nor my boss are familiar with it. I'm considering putting together a brief PowerPoint presentation for the team. Could anyone here point me to any marketing materials that could assist me in persuading my team to consider ProcessWire? Thanks in advance!1 point
-
Thanks for mentioning this. It's a great module and I've been using it myself for a long time, but @tpr has moved on (last AOS commit was 4 years ago and last login was 08/2023), so I've been trying to build something that allows for a real community effort where everyone can easily contribute. We'll see how it works ?1 point
-
Thx to @netcarver this is now also included in RockAdminTweaks - a module intended to be a collection of all those little admin tweaks and helpers, easy to enable/disable and easy to develop, see this example (also from @netcarver). Compared to AOS, which is/was a great module, RockAdminTweaks has all tweaks separated into folders and dedicated files, so both developing new tweaks as well as maintaining existing ones should be a lot easier than with AOS (we even have a GUI for adding new tweaks...). This is what we have so far: And here the prev/next links on page edit (with nice uikit tooltips that appear instantly rather than after a delay): Contributions welcome1 point
-
Not an exact answer, but this excellent post might give you some direction on how you can approach this conversation with your boss and collueagues in terms of business.1 point
-
Thanks to all who have reported bugs so far. These are: Side menu icon not showing: I don't have a fix for this yet but a work around. Please go to /your-processwire-admin/shop/general-settings/. Have a look at the settings under User Interface, select your option then save. If you select any with the 'dropdown menu', you will need a couple of module refresh + logout + login. Error: calling get() on null errors in relation to discounts: This will happen in case you don't have discounts feature installed. The errors are now fixed. If you downloaded Padloper before yesterday, please download again, thanks. Version stays at 009. CSS issues: White on white text as mentioned above. These are not related to Padloper but my site. I am working on a fix. Confirmation emails not arriving after you complete your order: These are not related to Padloper but my shop. I am working on a fix on my server, etc. Language page names not getting changed when their titles change: When you edit any Padloper page and change the title (including variants), the names of the pages should also change. I am investigating. Thanks.1 point
-
Working like a charm. Thanks @poljpocket!!!! PS: I will post my code now on the other thread so everyone can grab1 point
-
1 point
-
Ah, sorry, I missed a hint in your screenshot. The module won't do anything applied to the file descriptions. You need to add the Textformatter to the textarea field that uses the images.1 point
-
Hi @Leftfield, I'm not sure what the reason could be, so I've added logging to the dev branch of the module. You can download it here. With debug mode on, it logs to "imgdatauri".1 point
-
The "summary", just in case this was overlooked, isn't (entirely) an in-built feature for the module. It needs to be told what field in your template(s) will be used for the search result summary when rendered. From the documentation on the Modules page, under the "Options" heading, check the render_args property of the module's config, and look for the below: // Summary of each result (in the search results list) is the value of this field. 'result_summary_field' => 'summary', In the config, the "result_summary_field" points to the field used in your instance of ProcessWire this module is being used in that will be used to render the search result template's summary. So if in your templates you either don't have a summary field, or the field you use to define a summary is named differently, you'd need to use whatever value you have for your template(s). If maybe you used something like "short_description" as a page summary field, go with that. If you don't have a summary, you could use a "body" or "content" field, and in the render template use some form of string truncation, such as sanitizer()->truncate($your_summary_field, 80). If you're using JSON, slightly further down is a different section for that: // These settings define the fields used when search results are rendered as JSON. 'results_json_fields' => [ 'title' => 'title', 'desc' => 'summary', 'url' => 'url', ], Does that help at all?1 point
-
Hello @Andy I have fixed this bug now - please update to the latest version 2.1.69. Best regards Jürgen1 point
-
Hi @Andy Thanks for reporting this issue. I will take a look as soon as possible. Jürgen1 point
-
Yeah, the subresource key is a hash of the file contents so that will break at some point on @latest. Alternatively, I don't want to introduce external resource versioning since it would mean the module has to be updated to keep up with HTMX. Biggest deal for me is that, as an online privacy advocate, I can't recommend something that I wouldn't use myself. Agreed! Great way to add SPA features without fundamentally changing ProcessWire rendering. I'd argue that it's the way that interactive UI should be built to begin with.1 point
-
@bernhard The Pastefilter may be good for this specific case, since you are wanting to filter pasted content. But also have a look at the valid_elements and/or invalid_elements options, which give you control over what tags and attributes are supported in the input.1 point
-
1 point
-
I have added a new field type to the FieldtypeColor package. It is still in beta, but is already working quite well. The module is an extension of the Core FieldtypeOptions module and offers colors as predefined selectable options via 4 different input field types (Select, SelectMultiple, Checkboxes and Radios). Please try it out and if you like it, recommend it in the modules directory ? 2 Screenshots1 point
-
1 point
-
That's exactly right, filtering the entire page tree at once, not just 1 level of children in a branch.1 point