Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 06/13/2019 in all areas

  1. www.kentvitrini.com - It is a City Portal of Corlu (Turkey) , our hometown. After using TYPO3 CMS for more than 10 years for our projects, this is our first PW project. With PW less effort, less stress but much more fun. I am impressed. For Mobile Chrome Users : The site is a PWA (Progressive Web App), so it can be downloaded to the homescreen of the phone for future visits. As it is in turkish let me describe it: It has 3 main data groups - "Haberler" are News - "Firma Rehberi" is a Company Directory - "Etkinlik" are Events As there will be more and more information on the site a Live Search will help the visitors to find everything they need. For trying type "corlu" as search word, after 3 letters the search will be loading results. The Top Menu is "Mega Menu" enabled. Looks pretty good on hover On top (under the main menu) there is mix of all content. It looks like a billboard. Below are "Featured Companies" in random order, so the order of the companies changes with every load of the page. Below (Left) News Below (Left) nearest Events. And below (Sidebar) A summery of all content, Weather, pharmacy on duty. We will add Classified ads and "Who is Who" sections in near future.
    7 points
  2. Repeater Images Adds options to modify Repeater fields to make them convenient for "page-per-image" usage. Using a page-per-image approach allows for additional fields to be associated with each image, to record things such as photographer, date, license, links, etc. When Repeater Images is enabled for a Repeater field the module changes the appearance of the Repeater inputfield to be similar (but not identical) to an Images field. The collapsed view shows a thumbnail for each Repeater item, and items can be expanded for field editing. Screencast Installation Install the Repeater Images module. Setup Create an image field to use in the Repeater field. Recommended settings for the image field are "Maximum files allowed" set to 1 and "Formatted value" set to "Single item (null if empty)". Create a Repeater field. Add the image field to the Repeater. If you want additional fields in the Repeater create and add these also. Repeater Images configuration Tick the "Activate Repeater Images for this Repeater field" checkbox. In the "Image field within Repeater" dropdown select the single image field. You must save the Repeater field settings to see any newly added Image fields in the dropdown. Adjust the image thumbnail height if you want (unlike the core Images field there is no slider to change thumbnail height within Page Edit). Note: the depth option for Repeater fields is not compatible with the Repeater Images module. Image uploads feature There is a checkbox to activate image uploads. This feature allows users to quickly and easily add images to the Repeater Images field by uploading them to an adjacent "upload" field. To use this feature you must add the image field selected in the Repeater Images config to the template of the page containing the Repeater Images field - immediately above or below the Repeater Images field would be a good position. It's recommended to set the label for this field in template context to "Upload images" or similar, and set the visibility of the field to "Closed" so that it takes up less room when it's not being used. Note that when you drag images to a closed Images field it will automatically open. You don't need to worry about the "Maximum files allowed" setting because the Repeater Images module overrides this for the upload field. New Repeater items will be created from the images uploaded to the upload field when the page is saved. The user can add descriptions and tags to the images while they are still in the upload field and these will be retained in the Repeater items. Images are automatically deleted from the upload field when the page is saved. Tips The "Use accordion mode?" option in the Repeater field settings is useful for keeping the inputfield compact, with only one image item open for editing at a time. The "Repeater item labels" setting determines what is shown in the thumbnail overlay on hover. Example for an image field named "image": {image.basename} ({image.width}x{image.height}) https://github.com/Toutouwai/RepeaterImages https://modules.processwire.com/modules/repeater-images/
    7 points
  3. Just a small addition to this. I just added a new site profile to my Github page. It's a mix of the official blank and the multi-language site profile. The reason I made and published it is simple. This kind of setup/profile is almost always my starting point for a new project. So it saves me a lot of time for the inital setup. I kept (almost) all example files, removed demo content, added a few core modules and stripped almost everything in the output/template files. No UIKIT. No real output strategy. No hassle. Just BLANK in multilanguage flavour. It's not much, but it's honest work. ? PWB Multi Blank
    4 points
  4. Hi franciccio, Did you develop that site locally and now moved it online ? First check your config.php file inside the site folder. Look for this line: $config->httpHosts = array('....... '); It should look like this: $config->httpHosts = array('permaculturaorganica.info', 'www.permaculturaorganica.info');
    3 points
  5. Hi @gbball, that's similar questions I asked when I shared my first project here in the forum, which was also a webapp with lots of mixed javascript + php involved. And I also stored lots of JavaScript in textarea fields: The project is dead, but you might still find some interesting code snippets in it - even though I would do everything completely different now ? Back to your questions: 1) What is JSON? https://en.wikipedia.org/wiki/JSON Modules are always the way to go when you want/need to reuse or share your code at some time. It's easier to just start writing code in the templates, but it's a lot more flexible, powerful and robust when you start writing modules and to understand OOP concepts of PHP. Which road you want to take depends on you, on the project, on the deadlines... If you want to start quick, just go ahead, get something done, have fun, hit some walls, learn, improve ? To my code example: Just take this in your home.php file to get the idea. <?php $js = (object)[ 'page' => [ 'id' => $page->id, 'path' => $page->path, 'name' => $page->name, 'title' => $page->title, ], 'foo' => 'bar', ]; ?> <script> mySettings = <?= json_encode($js) ?>; console.log(mySettings); </script> That way you can communicate between PHP and JS without mixing both languages in one file too much. Of course you assign the PHP $js settings to mySettings JS variable once, but then you can just access those variables from within JS. You could then include a regular JS file that shows your animations... checking for specific variables and values and then changing its look or features based on the value of those variables.
    3 points
  6. Very nice. For context, this is like custom fields for images by using repeaters. This request for custom fields for images natively is one that is open, and slated for core one day: https://github.com/processwire/processwire-requests/issues/21 https://processwire.com/about/roadmap/
    3 points
  7. I just wrote that before posting it here. It didn‘t exist a few hours ago ?
    2 points
  8. Tracy Debugger for ProcessWire The ultimate “swiss army knife” debugging and development tool for the ProcessWire CMF/CMS Integrates and extends Nette's Tracy debugging tool and adds 35+ custom tools designed for effective ProcessWire debugging and lightning fast development The most comprehensive set of instructions and examples is available at: https://adrianbj.github.io/TracyDebugger Modules Directory: http://modules.processwire.com/modules/tracy-debugger/ Github: https://github.com/adrianbj/TracyDebugger A big thanks to @tpr for introducing me to Tracy and for the idea for this module and for significant feedback, testing, and feature suggestions.
    1 point
  9. Never knew about that module. Good share. Outside of having the manually coded implementation, an integrated approach would be great for those who aren't strong back end developers and wouldn't be comfortable digging into hooks. There is value in the behavior. One of the big draws of PW is it's raw power combined with ease of use which puts this kind of feature within the hands of developers like you and I but beyond many others. I couldn't find this module being listed anywhere that could be found. Is it something that you put together? If it's used by someone then having proper attribution is something that would be a good practice to keep going (myself included). Thanks again for the share.
    1 point
  10. So, I saved your code at /site/modules/CustomAdminPage.module, installed the module, and opened /processwire/customadminketan/table/ on my site.. and it works just fine ? Are you sure that if you install the code above as a module, it definitely doesn't work for you? In that case it looks like we might need some additional info. First of all, which version of ProcessWire are you using, and what kind of a setup do you have (Apache or something else, Windows or Linux, are you developing locally or an a server, etc.) Does everything else in the admin seem to work as expected?
    1 point
  11. Sounds great. The less opinionated, the better ? To answer your original question: SPA profile (Vue, React, Angular or whatever is "cool" this season) Headless profile (perhaps using GraphQL or a simple REST for the frontend to quickly grab content and assemble whatever you wish) PWA profile (service workers, Cache API, a frontend setup showing how you can build pages that can be used even when offline - "app shell" philosophy) "pure awesomeness" starter profile that has the coolest modules already pre-installed, like Tracy, BCE, AOS etc. (the actual choice is of course highly debatable). This would - in a nutshell - show the combined power of what's in the core already - and then some.
    1 point
  12. You have three forms on one page, so provide a hidden element with a unique name (as @horst suggests), then test for the form name when submitted and process accordingly. The page with your forms... <form> <input type="hidden" name="form1" value="form1" /> ... // Your form data collection fields </form> ... <form> <input type="hidden" name="form2" value="form2" /> ... // Your form data collection fields </form> ... <form> <input type="hidden" name="form3" value="form3" /> ... // Your form data collection fields </form> Then within your page, test for each... <?php if( $input->post->form1 == "form1" ) { // process your data and send your message for option 1 } elseif ( $input->post->form2 == "form2" ) { // process your data and send your message for option 2 } elseif ( $input->post->form3 == "form3" ) { // process your data and send your message for option 3 } // render your page as normal
    1 point
  13. I'm not really sure, why this would need to be bundled with FormBuilder. The attached module is a totally self contained module, which downloads the list from the given github url. It automatically tries to update once a day and uses the etag/if-none-match headers to determine if the list itself changed, to prevent sending of the list if there wasn't a change. The list and the etag are stored using WireCache in the db. There's public api to fetch the list and check if a domain is in the list. To use it in FormBuilder hooks should be the answer. EmailSchreck.module
    1 point
  14. @huseyin Welcome to ProcessWire and many thanks for sharing this project with us. Its impressive and well done. ? Paylaştığın için teşekkür ederim
    1 point
  15. Thanks Robin, I never tought about hours and minutes! lol Btw, it works! So thanks for help me out!
    1 point
  16. That could be one reason or maybe their backend isn't that powerful and scalable by now as they might need it to be. Or... building reputation, some clients, enough press and BUZZ that Google or Microsoft take a closer look and maybe even buy them. Wouldn't be the first time. In terms of affiliate business... yes... that could be a great opportunity. Similar to GorillaROI. And they offer a quite small service but it seems to work out pretty well for both sides.
    1 point
  17. Sorry, rookie mistake on my part :-). I had them both with identical titles. Corrected in 007. Hmm. That's very strange. By 'overwrite editor modal', do you mean the one where you can overwrite a field's 'original' label, description, notes, etc for a specific template? Are you able give me more details please? Which field values did you try to edit? Did the error crop up after saving or as soon as you opened the modal? ProcessWire version Thanks.
    1 point
  18. Maybe you have some other setting that's interfering - something in /site/modules/InputfieldCKEditor/config.js? It's working for me...
    1 point
  19. I really don't want to nit-pick, but sending the domain of "jon@jondonson.com" would still create a privacy issue. *sigh* Yes, I know, it is pedantic but GDPR legislation is harsh now.
    1 point
  20. Yes, loop over $tags and call $page->tags->add() for each like in the snippet you posted. Of course, you can just call $sanitizer->text for every $tag inside the loop in your third code snippet and go without the array_map. array_map is just a function that calls the passed function for every entry in the array given to it and returns a new array with the results.
    1 point
  21. For others need this solution using css, no need to use admin custom file module, just make custom admin css file inside template folder, add path to that css to admin.php inside template folder. Original reference :
    1 point
  22. Thx @gottberg, glad we could find a sulution even though we couldn't find the reason for the issue ?
    1 point
  23. I don't think this is good design. You can do it, but there are better ways. Do your different scenes have different scripts or just different variables but using the same script? If the latter, what you can do is store the unique properties of the scenes in the text field. A common approach is to use JSON with key:value pairs. You would then pass those to your script. There are two approaches to pass the data to your script; using $config->js() or echo'ing the JS variable in your template file. Please see these threads for more details: If you scenes have completely different scripts, you can either handle that in your JS code, if this scene then this, if that scene then that. Alternatively, you can have one template for all scenes that includes different other files based on the scene.
    1 point
  24. I looked into this and one of the limitations that their website does not say is that this API is not available to anyone purchasing access from the U.S. This basically is a dealbreaker for a lot of people and the implementation would mean it's limited to a very small number of people. Modules essentially would only be useful to someone that can purchase using billing addresses in the EU. I briefly considered some sort of credit card fraud... but passed haha. I was really interested in DeepL and went to sign up for the API to get access to it and only found out that I couldn't buy access to it when I went to enter my CC information. Very disappointing that they did not say this anywhere on their website (I checked). I spoke with them this week so the information is up to date on this finding. I sent an email to their staff and they said they are working on making it available outside of the EU but that it isn't due to "tax reasons". They didn't give any sort of timeline so until some point in the future this would only be available to users there. Big bummer.
    1 point
  25. Just want to add for anyone reading this post, that while in the admin this cannot be done, it is doable via code. By putting something like this into init.php,: $templates->get('home')->filename = $config->paths->templates . 'views/home/home.php'; it is possible to store a template file wherever you want. Read more about this in this topic: https://processwire.com/talk/topic/2676-configuring-template-path/
    1 point
  26. Welcome to the forums @e0f ? When you use a datetime string (e.g. 2019-06-08) in a $pages->find() selector, the string gets converted to a timestamp behind the scenes via strtotime(). And if you only supply a date without any hours/minutes/seconds to strtotime() then 00:00:00 (midnight) is assumed. This means that in your selector you are actually searching for pages created between 2019-06-08 00:00:00 and 2019-06-10 00:00:00, so you will not find any events created after 00:00:00 on 10 June. So you can fix this by including a time in the second datetime string: $result = $pages->find("template=test, id>1, sort=myFieldName, sort=-created, status=unpublished, created>='2019-06-08', created<='2019-06-10 23:59:59'"); Also, you don't need parentheses around this portion of the selector.
    1 point
  27. I got curious and debugged into this because I ran into a similar issue with prev() method while rendering a repeater matrix field, and had to include the 'check_access=0' selector to actually find a prev() page while a guest user visited the page, though I'm not being able to to this with index() too, like: $page->index('check_access=0'); Maybe you can try it and see if it works for you?
    1 point
  28. Why do you not include type hidden fields into your forms where you add identifiers? $validFormIdentifier = ['aaaaaaaa', 'bbbbbbb', 'ccccccc']; $myIdentifiedForm = $sanitizer->text($input->post->hiddenidentifier); if(!in_array($myIdentifiedForm, $validFormIdentifier)) { // invalid formsubmission, do not process further }
    1 point
  29. Thanks for the feedback everyone, I just made some updates to the app! You may have to fully clear the cache to see the changes immediately, as with the service worker the caching is pretty aggressive. @bernhard I have tweaked the functionality of the back button. The app now keeps track of the page history independently of the browser history API and only displays the back button if there are at least to items in the history stack. So you shouldn't see the back button on the first page visit, regardless of which route you're on. @tpr @bernhard For now, I have just disabled scroll wheel zoom for most of the embedded maps; this way, the map won't interfere with the normal page scrolling. The map can still be zoomed with the buttons to the left, and scrool zooming activates after clicking inside the map. Pinch zooming on touch devices should also work as normal. The only exception is the map page (architekturfuehrer.koeln/karte) which can always be zoomed with the scroll wheel; but that page should always fill the entire viewport with nothing to scroll below that, so it shouldn't be an issue there.
    1 point
  30. I ran into issues with a slow server using this method, where wireHttp would already resolve a result while RestApi was still running. So with help from my co-worker @harmvandeven we came up with a more stable version, with some more redundancy: <?php /* api.php, a simple PW template to fill the gap between the RestApi and ProCache modules v2 @author: @eelkenet, with help from @harmvandeven & @ryan 1. Create a template called 'api' and set it up using the following settings: - Allow URL segments - Allow guests to view the page - Set the Content-Type to application/json - Make sure to NOT Prepend or Append any files 2. Add a page using this template and allow ProCache to run its magic */ $timeout = 600; $maxAttempts = 10; // Pre-check for unwanted symbols if (strpos($input->urlSegmentStr(), '.') !== false) { throw new Wire404Exception(); } // Build request URL $endpoint = $modules->get("RestApi")->endpoint; $url = $input->scheme() . "://" . $config->httpHost . "/" . $endpoint ."/" . $input->urlSegmentStr(); $http = new WireHttp(); // Set a high timeout, to deal with a slow server $http->setTimeout($timeout); // Get the HTTP status of the page, to make sure it exists in the first place $status = $http->status($url); // If the page exists, or possibly redirects to valid content if ($status >= 200 && $status < 400) { $result = false; $attempt = 0; // If the result isn't a string, something went wrong while(gettype($result) !== "string" && $attempt++ < $maxAttempts) { $result = $http->get($url); if ($attempt > 1) wire()->log->message("Loading content at $url, attempt $attempt: " . gettype($result)); } // Double check if the data is a string.. if (gettype($result) === "string"){ // .. And check if it can be decoded, if so: return the data and thus cache it if (json_decode($result) !== NULL) return $result; // If it cannot be decoded: throw exception (don't cache it) throw new WireException("Found the data at $url, but it could not be decoded. Please check your API output!"); } // Throw exception if data could not be loaded in time (don't cache it) throw new WireException("Found the data at $url, but could not load it in time, after $attempt attempts. Result has type: " . gettype($result)); } // Throw generic exception if the requested page was not found or there was another error throw new WireException("Failed to load the content at: $url, with HTTP status: " . $status);
    1 point
  31. Yes. Same here. Also on mobile it is a little annoying. Google does it like this: Ctrl+Scroll for Desktop: 2-finger-scroll for mobile:
    1 point
  32. It will be free, open-source, like other starter tools out there.
    1 point
  33. For the last couple months, I've been working on a module that does exactly this. It's not a site profile, it's not a theme. I don't know what term would accurately describe it, but its a ProcessWire module that's an opinionated, update-able starting point, oriented towards developers, and brings in a bunch of boilerplate like: an installer that will create fields, templates, pages, hannacodes; it runs through a thorough check before doing anything that may result in an error (module installation errors are aggravating; i'm testing it very thoroughly) the installer will rename your 'templates' dir to something temporary, and then copy a starting 'templates' folder that's prepped for the module (you should only do this on dev) if you try to add it to an existing site with a bunch of data, it will work as long as there are not collisions in some fields and templates; if there are, the module won't install and tell you what you need to change around to allow it to install establishes some new $config variables ('env', 'disableTemplateCache', a few others) built with UIkit 3 in mind, but not hardcoded to it a menu builder based on Repeaters with its own Process Module has its own seo+og+twitter+sitemap metadata fields and uses Profields FieldGroup since that is the best module for handling such a grouping has it's own templates inside the module which can be used, or overridden in /site/templates/; this includes blog sitemap.xml maintenance search in addition to template files being able to be overridden, partial files can be overridden too! some module configuration fields (site_name, maintenance, etc.) the module has documentation and other statistics built into it for easy reference takes full advantage of setting() and markup regions; applies attributes like UIkit 'uk-grid' and other data attributes without "touching" the html; keeps the module flexible and easily allows you to rip out UIkit and swap it for another CSS framework (Bootstrap 4); you'll never need to touch edit the _main.php file because of how regions has been set up has it's on RepeaterMatrix fields with boilerplate matrix-types (headline, text, slideshow, etc. etc.); if the user makes new custom matrix types and a later version of my module brings in a new matrix-type, it will update the RepeaterMatrix field and merge it correctly (tricky to do!); the matrix types use many of the same base fields, thereby allowing you to switch from one matrix type to another without data being destroyed (this was only possible as of 2 weeks ago with the new matrix update) to avoid creating a bunch of 1-off fields for the matrix field for block configuration, it uses the new and quite amazing Mystique fieldtype in a unique way (this was tricky to do); this module is critical to establishing a page-builder that is clean (this was only possible as of April 2019 since the module is brand new) brings in PW's debugger to the frontend (brings in jQuery UI); can be disabled all field and template names don't use any prefixes; this would allow you to dump the module one day in the future if you don't like it, without having a bunch of field and template names that sound too specific to the module Laravel Mix based asset compiler pre-configured with UIkit works with FormBuilder and other modules I often use; works and may require certain Pro modules; eliminates the need for any modules that do blogging, menu building, sitemap, maintenance or seo since this module does it using native ProcessWire login/logout/account/register templates it may include a 'collection' generator for common things like events, products, people, properties, along with some templates for those. don't like the templates my module provides? then just create your own template file in /site/templates/the-template-file.php which will override /site/modules/my-module-name/templates/the-template-file.php Right now I just started building a few sites with it (spent the last 2 months developing it) which will hammer it out further. I will release it late summer, early fall.
    1 point
  34. RepeaterMatrix is going to be the best choice for any type of page builder in ProcessWire (at least at this time). The recent updates to the module improve its flexibility further, such as being able to change the matrix-type of an item that's already been added to a page (this is similar to Gutenberg functionality of being able to change block-types... nice). After using RepeaterMatrix and its equivalents in other CMSes over the years (such as WordPress ACF Flexible Content field), my suggestion is you're better off NOT providing fully customizable layout functionality within your builder (that is, avoid the capability of allowing users to add things like containers, rows, columns). I've personally found that even other CMSes that do this well and are built around that concept are just too clunky. It's the nature of the beast. The better approach in my opinion is to provide a good set (5-10) of matrix-types/blocks that can instead achieve this. Once again, the recent feature addition whereby matrix types can be changed is going to help here since switching a matrix-type retains its content as long as the matrix-type you are switching to uses the same fields.
    1 point
  35. We recently finished the relaunch auf camac.de, a client from the software industry, focused on controlling and business integration solutions. Concept, design and implementation by schwarzdesign. The site is focussed on longer content pages with text and image combination, with technical information for potential customers. It also offers multiple options for Call-to-Action elements to maximize conversions. Finally, the site is heavily optimized with caching and minification at every stop to be instantly readable even on slow connections. Features No hard-coded sections in any template: Almost all content types use the same repeater matrix field with several section types. This way, the entire site and all parts of the layout can be moved around and combined in any way imaginable. Custom Call-to-Action options: Two different contact forms, custom external links or a general CTA text. Automatically generated page navigation and human-readable anchors (as seen here) Every page fully loaded and interactive in ~1 second, even on poor mobile connections Automatically generated SEO meta tags, with overwrite fields available on every page Modules used ProFields FormBuilder Tracy Debugger Sitemap Duplicator ALIF - Admin Links In Frontend WireMailSMTP Content and conversions Every visitor is a potential customer - this is why we made sure there are ample opportunities to generate leads. At the end of every page, there are multiple options for the CTA section: A contact form with a customizable message (built with FormBuilder) A download form that allows visitors to download PDFs (e.g. the full article) in exchange for their name and E-Mail address. Other text + image combinations with custom links or buttons. The download form was custom coded, as it allows the editor to upload a file specific to the current page and make it available behind a small form. After successfully submitting the form, an e-mail is sent to the site owner, and the file is directly streamed to the client as a download. Technical insights This is one of the first pages where I used Twig for templating, and it's been a great developing experience. With Twig, you get content escaping and much better seperation between logic and view / display. I also spent some time working out a solid structure for the twig templates, with useful defaults, reusable blocks for page and section template (you can read more about the approach in my recent tutorial on integrating Twig with ProcessWire, part 1 and part 2). I also started using Parcel as a lightweight alternative for Webpack, when all I need is to compile a couple of small scripts (for the navigation, the lightbox, a dismissable cookie notice et c). What's great about parcel is that you get bundling of your own code and external libraries out of the box, as well as ES6+ transpilation and minification for production usage. Still, it required no configuration but a couple of command line options. This way, you get one bundled, minified JavaScript file, the same way we produce a minified CSS file with SCSS, but without the additional overhead of configuring Webpack. Screenshots
    1 point
  36. Welcome to the forums @mjut You need to use $config->scripts->add() for JS and $config->styles->add() for CSS .These need to be added before the controller.php $config->scripts->add($config->urls->templates . "scripts/admin.js"); $config->styles->add($config->urls->templates . "styles/admin.css"); // this comes last require($config->paths->adminTemplates . 'controller.php');
    1 point
×
×
  • Create New...