Leaderboard
Popular Content
Showing content with the highest reputation on 03/22/2019 in all areas
-
If you're not harnessing the backend from ProcessWire I'd personally tend to not use ProcessWire. While it's entirely possible to do so (maybe also search for prev. discussions on the topic) there are some parts, which in my opinion discourage that kind of usage: Lack of proper testing capabilities. There are topics on how to do TDD with processwire, but the options on managing db state or handling requests in tests are not there. If you need to manage a lot of diverse data the autoloading of every template/field on each request can become a bottleneck. Working around it by reusing more fields/templates can work, but isn't great either. The selector engine for pages is great for light to medium complex stuff, but complex selections and especially aggregations need custom SQL or third party solutions like RockFinder. Also if you're not careful it's tempting to fall into n+1 query problems with fields / relationships being lazy loaded by default. Transactions are hardly used by the core, so if you want/need to prevent partial updates from happening you need to ensure that on your own by wrapping stuff into transactions. Not to say ProcessWire isn't otherwise a nice system, but those are the things I'd urge anyone to evaluate before using ProcessWire in a web application project.7 points
-
Hi @spiroue and welcome, will this be a public website or will all your clients have a login? If yes, you might consider developing a lot in the backend: https://processwire.com/blog/posts/building-custom-admin-pages-with-process-modules/ Easy with the core field: https://modules.processwire.com/modules/inputfield-page-autocomplete/ (just install it with one click in the backend) You can do all kinds of custom logic quite easily (depending on your skills) via hooks: https://processwire.com/docs/modules/hooks/ PS: Ther's also @kongondo's great tutorial:4 points
-
Welcome to the Forum @spiroue. Only one point to start: If you want to process the phone number from the URL, think about URL Segments. Then you only have a single real page named phone-number which processes the following part of the URL ('12345678' in your example). With that number you may do anything like searching for that number somewhere else. That enables you to simply have a table of phone numbers per store, no need to have one page per number.3 points
-
3 points
-
A recent GitHub request got me thinking about ways to get an overview of which fields are using which Textformatter modules. Here are a couple of approaches... 1. For all Textformatter modules that are in use, show the fields they are applied to Execute the following code in the Tracy Debugger console: // Loop over fields and get their Textformatters $textformatters = array(); foreach($fields as $field) { if(empty($field->textformatters)) continue; foreach($field->textformatters as $textformatter) { $textformatters[$textformatter][] = $field->name; } } d($textformatters); Any Textformatter modules that are not included in the dump output are not applied to any fields. 2. In the config screen for a Textformatter module, show the fields where the module is applied Add the following to /site/ready.php $wire->addHookBefore('ProcessModule::executeEdit', function(HookEvent $event) { // Get the module name $module_name = $this->wire('input')->get->name('name'); // Return if it's not a Textformatter module if(strpos($module_name, 'Textformatter') !== 0) return; // Add field to module edit form $event->wire()->addHookBefore('InputfieldForm(id=ModuleEditForm)::render', function(HookEvent $event) use ($module_name) { $value = ''; // Find any fields using this Textformatter and build markup value foreach($this->wire('fields') as $field) { if(empty($field->textformatters)) continue; foreach($field->textformatters as $textformatter) { if($textformatter === $module_name) { $value .= "<a href='{$this->wire('config')->urls->admin}setup/field/edit?id={$field->id}#fieldtypeConfig' target='_blank'>$field->name</a><br>"; } } } if(!$value) $value = 'No fields are using this Textformatter module'; // Add markup field to form $form = $event->object; $f = $this->wire('modules')->InputfieldMarkup; $f->label = 'Fields using this Textformatter module'; $f->value = $value; $form->insertAfter($f, $form->children->get('id=ModuleInfo')); }); });2 points
-
Thanks @horst ! Checking that this week-end - thanks for the sample too ! ?2 points
-
2 points
-
@Sergio I had the same issue. Been meaning to file a report with Valet but haven't had time yet. https://github.com/adrianbj/TracyDebugger/issues/322 points
-
2 points
-
2 points
-
@alexmercenary This bug has been fixed with version 0.5.0, see https://github.com/wanze/SeoMaestro/blob/master/CHANGELOG.md#050---2019-02-172 points
-
No problem here finding matches for a Page Reference field containing pages whose title starts with numbers. If the search value only contains numbers then the value will be interpreted as a page ID. In any case it's good to be specific about what you are wanting to match against to avoid any confusion. So if you want to match against the title use tags.title as $filter in your example.2 points
-
For me Tracy is showing a page load time of 163ms for the Home page on the front-end with the core blank profile. It would of course depend on how much you have going on in your site (template, modules, ready.php, etc) but your load time does sound slow. I'm running 5.7.19. I believe it's a matter of making sure your Apache and MySQL versions are compatible. Here are mine in case it helps:2 points
-
@flydev I just found this (https://www.phpclasses.org/package/10950-PHP-Compress-files-and-create-archives-in-Zip-format.html), maybe it is of interest for you? zipfly-2018-12-21.zip2 points
-
Hi all, Introducing a new GDPR Cookie Management Banner module. https://github.com/adrianbj/CookieManagementBanner https://modules.processwire.com/modules/cookie-management-banner/ This module was sponsored by VentureWeb in Squamish, BC, Canada. I converted a Drupal module written by Oliver Walker from VentureWeb into what you see here. The Drupal module requires jQuery so at the moment, this module also requires jQuery. I will probably remove this sometime soon. This module certainly has similarities to MarkupCookieConsent but provides the user with the following features: The user can accept all cookies or they can choose to not accept tracking/marketing cookies. Module config options allow you to: define all text and button labels (multi-language support) manually increment the cookie policy version which forces the user to review their consent again select whether users can manage their cookies, or just accept all option to limit display of banner to users only in European Union (by IP address) position selection (top or bottom overlay, or content pushed down from the top) It comes with basic default styling which is easily overwritten by site CSS The module sets various values to the dataLayer array which works together with Google Tag Manager - please read through the code in /assets/js/CookieManagementBanner.js to get a better idea of how this works and what is made available for GTM. You can wrap your tracking/marketing cookie code in a check for the localstorage key of: pwcmbAllowCookies if(localStorage.getItem('pwcmbAllowCookies') == 'y') You can also provide a link on your site (probably in the footer) like this that will allow the user to show the banner even after they have saved their preferences / accepted. <a href="#cookies" class="js-pwcmb-notice-toggle">Manage Your Cookies</a> Would love to hear feedback from anyone who gives this a go.1 point
-
"framework" and "web application projects" are very very loose terms... If you could describe a bit better what you are trying to build, I'm sure people could chime in with more "to-the-point" suggestions, or concrete real-life examples from their own experience. There are various ways how to extend / customize the whole backend. Custom dashboard, custom modules etc. @bernhard has an excellent, epic tutorial how to create your own module to handle potentially... well, just about anything you'd want. So, I guess if you want to get constructive feedback here, you should elaborate on what you're trying to achieve. And what exactly do you miss in PW that you have in Laravel or Silverstripe.1 point
-
1 point
-
1 point
-
Just in case it's helpful, this is what I do for Tracy - anything that is defined in the $config->tracy() array overwrites the settings stored in the DB. https://github.com/adrianbj/TracyDebugger/blob/3f1fb2cf0016b8b27cc1019f47e58bce8e2cbd3d/TracyDebugger.module.php#L322-L3251 point
-
Hi, Unless I'm misunderstanding something here, what you want is actually a Page field. In your template files you can output the URL of the selected page: <?php if ($page->page_field_name): ?> <a href="<?php echo $page->page_field_name->url; ?>"><?php echo $page->page_field_name->title ?></a> <?php endif; ?> Does that sound about right?1 point
-
Correction for future reference: indeed, with only numbers. I thought it was about being interpreted as page ID, but a type conversion thing. I have no ideia how I missed subfield selectors... -_- Thank you!1 point
-
My laragon is... fast. Faster than DreamHost shared hosting, slower than webgo shared hosting but I'm fine. My realpath_cache_size is somewhere at 128MB but higher than 64MB isn't a benefit at all. At least not on my setup. My previous setup (Lenovo X1 Carbon, i7, 8GB RAM, SSD) was faster than my current setup (Surface Pro 2018. i5, 8GB RAM, SSD) but after some tweaks (SSD driver update, reducing autostart apps) there is almost no difference anymore. At least while developing. MySQL is running fine in version 5.7.19 - but it's a version I got from the forums and not from the official download page. Don't know if there is a real difference anymore. What's your current setup? P.S.: The need for sleep is only a lack of coffee. ?1 point
-
1 point
-
Thanks @jmartsch! It seems that a regex in FilterBox allows only specific characters to use for filtering. I don't remember why I did this but I think it's too restrictive. Could you try replacing the line at 552 with this? var i, aStr = str.match(/[^\s]+|"[^"]+"/g); I think I'll need to revisit this sometime but in my quick tests it works better then the previous.1 point
-
1 point
-
Thanks @Macrura Taking a peek under the hood: These look like UIkit3 themes: https://themeforest.net/item/lovely-corporate-creative-multipurpose-html-template/19515847?s_rank=11 http://themedemo.indonez.com/?theme=Fina http://torbara.com/demo/?theme=HTML-GB Looks like UIkit2: http://demo.42theme.com/?theme=Acamar.HTML Looks like this one is custom css based: https://themeforest.net/item/omio-html-portfolio-template/22846488?s_rank=11 point
-
I figured this out, after running into this issue myself and digging into the FieldtypeTable class...definitely not intuitive though. Ideally a title or label property or method would just be exposed here. $field = $fields->get('table_field'); // Field $columnName = 'column'; // Column name in table $optionValue = 'my_option'; // Option value $optionTitle = $field->type->getSelectColumnOptions($field, $columnName)[$optionValue]; // Returns array of value => label echo $optionTitle;1 point
-
1 point
-
1 point
-
Nobody's talking about bringing content builder stuff to the core. I guess only Ryan could)) But the request for content building is high. Content is king. And RepeaterMatrix + Hanna codes are not as user friendly as Gutenberg seem to be. SPA editing is way more pleasant than opening and saving things one after another and adding images only after 1st save. PageTable Extended showed a way true block editing could be done in PW. Frontend editing is another step that could revolutionize content editing, but I never read about any good implementation. RepeaterMatrix is cool and could be even better if it would be PageTableMatrix with a similar Inputfield))) I think we can and should find a way to solve this need in true ProcessWire way. And we have to look at competition. Gutenberg might be hard and messy for developers, but it is desirable for end users. Let's make good for both using our strong points. P.S. js page api was on the roadmap. Might be a good fit here once it's done.1 point
-
Without going into too much detail regarding the previous discussion here, I've just heard of https://gutenbergcloud.org/ for the first time, and I've got to say that it seems promising. The basic idea is to provide a common service for installing all sorts of blocks – and only the blocks you actually need. (Currently the situation is roughly that some blocks are shipped as one-block plugins, while others ship as massive collections of blocks, neither of which are really optimal.) Also took a quick dive into Gutenberg for Drupal (which Gutenberg Cloud promotes), and they've done a smashing job there ? I'm definitely interested in looking into setting up a Gutenberg Fieldtype, or perhaps a Process module – or something similar. Though once again my desk is kind of full, so who knows. -- Although I did say that I wouldn't go into the earlier discussion, just a quick comment on that: As a tool Gutenberg has it's flaws, and it's definitely not a tool that would/could/should somehow replace what ProcessWire does. I don't think that anyone has been suggesting that here either. Gutenberg is a block builder, and admittedly one still in a relatively early state – but even at this stage it looks promising. There really aren't any serious contenders, particularly fully free and open source. Right now there's also a lot of momentum behind the project – not to mention financial backing from Automattic – which means that as a tool it will undoubtedly improve over time, and current issues will eventually get ironed out. Whether going with Gutenberg is a good thing for WordPress or not is a debate I don't want to get into. Personally I don't know anyone seriously developing sites with WordPress and not using either one of the existing block / page builder solutions, or some sort of ACF based approach. WordPress alone is not the point – the plugins are. Since block editors are probably the most popular way of building WordPress sites, in my opinion having one built into the core is a logical next step. But that's just my opinion. And again, it has little to do with ProcessWire ?1 point
-
Recently Bitrix (a popular commercial CMS here in Russia, known worldwide for its Bitrix24 CRM/PM/... solution) introduced similar functionality they called Site Constructor. This thing allows to build pages or parts of the pages from pre-defined blocks which can be static or dynamic. Site developer can style, modify or add their own blocks. They recommend this for landing pages for now, but are aiming to move all content management to those blocks. So there is some trend. I actually do use (almost) the same approach in PW. Most of my pages have content-page template with content_blocks Repeater Matrix field holding most of the content in repeater items. What is missing in my solution is: the easy ability to restrict the order, allowed types of those items (though possible with this module); the ability to easily move/duplicate content blocks from project to project (still think Repeater Matrix should be PageTable Matrix); the ability to easily preview the page built (like with this solution) in admin / edit it inline on the frontend. I see this way of building content very flexible, but still somehow unfinished. We have all the parts in PW to build a full-blown page bulder that will not allow too much for ones that do not need it, but will make it easy to build something really complex and interesting without programming. But those parts are not yet combined in a polished solution. I would certainly like to have it in PW (as a PageTable-like PageBuilder FieldType/Inputfield combo, probably).1 point
-
It's coming along quite nicely. I do not have a firm release/completion date yet, although working towards it as fast as possible. As soon as I can I will answer all your questions about Designme. Hopefully by the end of this week I will be able to show you guys some more features that I didn't include in the preview video. ?1 point