Leaderboard
Popular Content
Showing content with the highest reputation on 11/04/2017 in all areas
-
Here it is. The relaunch for Captiva. High Quality Power since 1995! CAPTIVA GmbH was founded in 1995 and began selling graphics cards under its own CAPTIVA® label. Meanwhile, their portfolio includes modern Tablet PCs in a large selection with the right accessories, individually configurable PCs with extremely high quality standards and external hard drives. Since 2007, CAPTIVA® has been manufacturing complete PCs in the so-called built-to-order (BTO) process. Captiva builds your new PC exactly according to your requirements and wishes. During the development i felt in love with processwire's magic day for day. I was so glad that i could use processwire for this site instead of typo3 or others which probably would have taken the triple time to develop. Much more products will be added in the next time. Also the english translation will follow and a dealer-login for support, service and downloads. With that i hope to improve the page builder more and more. Some of the highlights of the page is the radius search for the dealers which are offering captiva products. All i had was a simple excel list with names, adresses, phone numbers, emails, websites, etc. I converted this .csv to a .json and built a script which imports all dealers as new page in processwire. The adress field is saved in the map marker module from Ryan. With that i also get the latitude and longitude for the radius search. Some make-life-easiers / extras: + a "page-builder" created with the PageTable field (see video): options to add images, text + images, google map, form, the radius search, gallery, parallax section, product listing (made with page reference), technic details (this will render all technical informations from the product, made with page reference and repeaters on the product), grid width options made with the range slider (for desktop, tablet and mobile), options to set a full width container or boxed, margins, borders and so on + central management of drivers with connected page fields for the single driver page and the product page + connected page field for gamecoupons and products + events and promotions can be managed with start- and enddate, a lazy cron will do the rest + widgets on category and product sites which appear randomly + try the blue model switcher on the start-page, it changes the video in the background, the newest products and the slider on the bottom navigation (on a subpage it redirects to the category) + news listing made with ajax + theme switcher for every site (dark / clean) + prepared for multi-language + much more.. feel free to ask Some insights: Modules used: Admin Custom Files AdminOnSteroids Uikit Clear Cache Admin Connect Page Fields Cronjob Database Backup Email Obfuscation (EMO) Map Marker Range Slider URL (Multi-language) Image Extra Map Markup (Google Maps) Markup Simple Navigation Sitemap Pages2Pdf Database Backups Google Analytics Jumplinks Upgrades Simple Contact Form Video embed for YouTube/Vimeo Tracy Debugger Frontend: Grunt tasks for js / sass compilation / minifaction: grunt-sass, grunt-uglify, grunt-contrib-cssmin bourbon.io mixins for sass (which i love next to self-made mixins) uikit 2 (which bothers me a bit because uikit 3 was in early beta when i started the site) owl carousel 2 awesomplete noUiSlider awesomplete jQuery Lazy picturefill12 points
-
This week's version, ProcessWire 3.0.82, focuses on fixing several things reported from GitHub issue reports (dev branch commit log). So there are quite a lot of commits in this week's version, but none interesting enough to warrant a screenshot or real blog post. There was also one addition, which was support for repeater fields in the Setup > Fields > Export/Import functions. This week also brings several updates to the AdminThemeUikit module, which we may be pulling into the core dev branch as soon as next week. So if you are using AdminThemeUikit, be sure to grab the latest version, in addition to ProcessWire 3.0.82. That's all for this week. Have a great weekend!7 points
-
Hi folks, I published "Simple file downloads with ProcessWire tutorial" today which explains how to make a simple download function with ProcessWire (tested with version 3.0+). Basically this is based on my post here in the forums6 points
-
Bonsoir, Try this : https://processwire.com/blog/posts/processwire-updates-and-new-field-types/. It works fine, I used it for exact same purpose! Don't forget to allow more than 1 file in your field (it's why a version erase the other one)4 points
-
@SamC your $imgOptions is null since it's not in the function's scope. The code works because $options is ignored if null. https://github.com/processwire/processwire/blob/57b297fd1d828961b20ef29782012f75957d6886/wire/core/Pageimage.php#L377 You can check function test() { return $imgOptions; } var_dump(test()); just replace $imgOptions with wire("config")->custImages in your function3 points
-
Totally. One of my main interests is how other people organize the backend to make it as easy as possible for clients. It's the different backends used on production sites that people new to processwire don't ever get to see, only their own one. How a client interacts with the backend is of major importance IMHO. Great video @maxf53 points
-
@mel47's suggestion is a good choice. The other one you might want to consider is: https://processwire.com/api/multi-language-support/multi-language-fields/#language-alternate-field-values3 points
-
Hey! When I was building a little commercial Processwire website for a family member, I started looking into caching with WireCache and somehow had troubles to find a satisfying solution to organize the caches and their expirations. My site had a few parts that updated in a regular manner while other parts should be refreshed whenever the current page - or e.g. for the menu: any page - was saved. I wanted to create a cache of the whole page's html which should expire whenever any of its parts expired. This would be simple if you could set multiple expire values for one cache. Unfortunately, you can only set one. So I started to build a solution to my problem which uses the WireCache and creates a dependency tree for every cache. And since I haven't yet implemented a Processwire module and this little class might be useful for other websites, too, I thought I'd try to make a module out of it. This is it. Github: https://github.com/janKir/CacheNesting Please have a look, and feel free to leave a comment. This is my first module, so any suggestions are welcome. I am not even sure if my approach makes much sense for performance reasons. I'm happy to hear your opinions! Thanks a lot!2 points
-
I hope you have been able to get this working. I will detail how I'm use Google Tag Manager for an upcoming project, just in case you still are having problems. Background I'm working on a new website where we are using an Ecommerce Widget. We normally use Piwik for basic analytics, however this Online Store solution uses Google Analytics to track things (shopping cart, etc). This is where Google Tag Manager becomes a great solution. We ended up using both Piwik and Google Analytics. In Google Tag Manager you create the needed Tags with Firing Triggers. In this situation, we created one for Google Analytics (using Universal Analytics tag) and one for Piwik (using a Custom HTML Tag). The Custom Tag is simple, you enter the Piwik code and save. Now that these tags are created, you take the Google Tag Manager code and add it to your website. Just follow the instructions, as listed. My website configuration has a _head.inc and _main.inc. You can see (above in the 2 files) where the Google Tag Manager code is put. It turns out to be a very clean solution when you need to track many things or have more than one analytical tool that needs to track things. One of the good things about using Google Tag Manager is that you can verify that the 2 Tags are firing, as you need them to. Additionally, you can create more Tags to track a multitude of things on your website. Google provides free training courses on Google Tag Manager, if you are interested: https://analytics.google.com/analytics/academy/ I hope this helps someone out.2 points
-
When ImageSizerEngineIMagick is installed, the settings defined in the module config screen for quality and sharpening apply and any settings for these in $config->imageSizerOptions are overridden. See discussion here: I'm not a fan of this and would prefer to have quality and sharpening defined in $config->imageSizerOptions.2 points
-
There's invisible recaptcha that only shows up in case of suspected bot activity https://developers.google.com/recaptcha/docs/invisible2 points
-
I created a "Pull Request" at my own and extended the module config, so one is able to define a date range and reverse sorting. Thanks @Macrura2 points
-
That would be up to 3rd party services (almost all services support some type of tracking) or developer (by creating trackable links, 1x1px tracking gifs etc)2 points
-
I needed a way for the files to not force download, so that admin users can quickly view a document in their browser; i added this to the hookDownloadFile() method: $options = []; if($this->wire('input')->get('view')) { $options['forceDownload'] = false; } and then added options to the download: $file->download($options); // Access check performed by this method up in the hookRenderItem i added this: $segments['view'] = 1; $link = $this->wire('page')->url . '?' . http_build_query($segments); $markup .= " | <a href='{$link}' target='_blank'><i class='fa fa-eye'></i> " . $this->_('View File') . "</a>"; $markup .= "</div>"; so now the file looks like this: It would be cool to consider adding this functionality, since it can't always be assumed that the files should force download; maybe it needs to be a config option where you choose the behavior or opt in for download and/or view links...2 points
-
ah, good hint I added an option at the top of the list to select – All – countries.2 points
-
You can add your own properties to $config $config->customProperty = "whatever"; $config->prefixName = [1, 2, 3];2 points
-
Add them to $config in site/config.php and you can access them like every other configuration option. Just make sure to use a naming scheme that's unlikely to clash with future standard options. I tend to prefix mine with "cust".2 points
-
The frontend looks nice and clean but what caught my attention was the backend. We see lots and lots of frontend but this one is a nice look behind the scenes. I love it! Would be interesting to see or know more about this and some other backend solutions.2 points
-
It looks like there is a PHP error message breaking the JSON - you need to go into your dev console and click on the image upload ajax call and go to the response tab.2 points
-
If I'm getting this right, you're talking about short open tags? That's not exactly a new thing, but rather something that users have been discouraged to use for a very long time. Though you can still enable short open tags with the short_open_tag php.ini setting, if you've still got code that relies on short opening tags, you should consider updating it to the regular <?php opening tags That being said, in PHP7 they did remove some utterly obsolete tags: the ASP style tags (<% %>) and the script tags (<script language="php"></script>). My guess is that most users probably didn't even know that those existed.2 points
-
Sites Manager 16 September 2018: FOR NOW, PLEASE DO NOT USE THIS MODULE IN A PRODUCTION SITE. A RECENT ProcessWire UPDATE HAS BROKEN THE MODULE. I AM WORKING ON A FIX. ################ Sites Manager is a module for ProcessWire that allows Superusers to easily create/install ProcessWire sites on the same serverspace the module is running in. Only Superusers can use the module. You can create both stand-alone and multi-sites. Single/Stand-alone Sites Stand-alone or single-sites are sites that will run in their own document root/directory with their own wire and site folders, .htaccess, index.php, etc. In other words, a normal ProcessWire site. Multiple Sites Multi-sites are sites that will run off one wire folder (shared amongst two or more sites) each having their own site folder and database. In this regard, it is important to note that Sites Manager is not in itself a multiple sites solution! Rather, it is a utility that helps you create multi-sites to be run using the ProcessWire core multiple sites feature. For more on this core feature, see the official ProcessWire documentation, specifically the solution referred to as Option #1. Option #1 approach requires the site admin to initially install ProcessWire in a temporary directory for each new site. The directory then needs to be renamed as site-xxx, where ‘xxx’ is any name you want to use to differentiate the installation from other sites, before it is moved to the webroot. For instance, site-mysite, site-another, site-whatever. In addition, the /wire/index.config.php file must be copied/moved to the webroot. Each time a site is added, the index.config.php has to be edited to add ‘domain’ => ‘site-directory’ key=>value pairs for the site. This process can become a bit tedious. This module aims to automate the whole multi-site site creation process. The module is based off the official ProcessWire installer. Creating a site is as simple as completing and submitting a single form! You also have the option to type and paste values or reuse a pre-defined install configuration. The module will: Install a ProcessWire site in your named directory, applying chmod values as specified Move the directory to your webroot Update/Create a Superuser account as per the submitted form, including setting the desired admin theme and colour For multi sites, update sites.json (used by index.config.php to get array of installed sites) For multi sites, the only difference in relation to the core multi-sites index.config.php is that this file is slightly different from the one that ships with ProcessWire. Download from GitHub: Sites Manager (Beta Release) Features Install unlimited number of sites in one (multi-sites) or independent (single-site) ProcessWire installs. Install by completing a Form, Typing or pasting in configurations or using pre-created install configurations. Choose an Admin Theme to auto-install along with the site installation. For single-sites installation, download, save and reuse ProcessWire versions of your choice. Install and maintain site profiles for reuse to create other sites. Create install configurations to speed up installation tasks. Client and server-side validation of site creation values. Edit uploaded profiles (e.g., replace profile file). Lock installed sites, configurations and profiles to prevent editing. Bulk delete items such as site profiles, installed site directories and/or databases (confirmation required for latter two). View important site details (admin login, chmod, etc). Links to installed sites home and admin pages. Timezones auto-complete/-suggest. Pre-requisites, Installation & Usage Please see the documentation. Technicalities/Issues Only Superusers can use the module. ProcessWire 2.7 - 3.x compatible Currently using ProcessWire 2.7 installer (install.php) For multi-sites, potential race condition when sites.json is being updated on a new site install vs. index.config.php accessing the json file? Not tested with sub-directory installs (for instance localhost/pw/my-site-here/) Currently not doing the extra/experimental database stuff (database charset and engine) Future Possibilities Install specified modules along with the ProcessWire install Profile previews? Credits @ryan: for the ProcessWire installer @abdus: for the index.config.php reading from JSON idea @swampmusic: for the challenge Video Demo Demo showing how quick module works on a remote server [YMMV!]. Video shows downloading and processing two versions of ProcessWire (~takes 7 seconds) and installing a single/stand-alone ProcessWire 3 site using the new Admin Theme UI Kit (~2 seconds) on a remote server. Screens 1 21 point
-
» A more exhaustive version of this article is also available on Medium in English and German « First, we'd like to thank the very helpful community here for the excellent support. In many cases we found guidance or even finished solutions for our problems. So a big THANK YOU!!! We are pleased to introduce you to the new Ladies Lounge 18 website. The next ICF Women’s Conference will take place in Zurich and several satellite locations across Europe. We embarked on bold new directions for the development of the website — in line with the BRAVE theme. Ladies Lounge 18 — ICF Woman’s Conference website on Processwire ICF Church is a European Church Movement that started 20 years ago in Zurich and since experienced tremendous growth. There are already well over 60 ICF churches across Europe and Asia. ICF is a non-denominational church with a biblical foundation that was born out of the vision to build a dynamic, tangible church that is right at the heartbeat of time. With the growth of the Ladies Lounge from a single-site event to a multi-site event, the demands and challenges to the website have also increased. A simple HTML website no longer cuts it. Simplified frontend Our goal with the development of the new site was it to present the different locations — with different languages and partly different content — under once uniform umbrella — while at the same time minimising the administrative effort. In addition to the new bold look and feel, this year’s website is now simpler and easier and the information is accessible with fewer clicks. Some highlights of the new website Thanks to processwire, all contents are maintained in one place only, even if they are displayed several times on the website 100% customised data model for content creators Content can be edited directly inline with a double-click: Multi-language in the frontend and backend Dynamic Rights: Editors can edit their locations in all available languages and the other content only in their own language Easy login with Google account via OAuth2 Plugin Uikit Frontend with SCSS built using PW internal features (find of files…) Custom Frontend Setup with Layout, Components, Partials and Snippets Only about 3 weeks development time from 0 to 100 (never having published a PW before) Despite multi-location multi-language requirement, the site is easy to use for both visitors and editors: The search for a good CMS is over It’s hard to find a system that combines flexibility and scope with simplicity, both in maintainance and development. The search for such a system is difficult. By and large, the open source world offers you the following options: In most cases, the more powerful a CMS, the more complex the maintenance and development It is usually like that; The functionality of a system also increases the training and operating effort — or the system is easy to use, but is powerless, and must be reporposed for high demands beyond its limits. Quite different Processwire : You do not have to learn a new native language, you don’t have to fight plugin hell and mess around with the loop, you don’t have to torment yourself with system-generated front-end code or even learn an entierly new, old PHP framework . All our basic requirements are met: Custom Content Types Flexible and extensible rights-management Multilanguage Intuitive backend Well curated Plugin Directory Actually working front-end editing Simple templating with 100% frontend freedom In addition, Processwire has an exceptionally friendly and helpful community. As a rule of thumb, questions are answered constructively in a few hours . The development progresses in brisk steps , the code is extremely easy to understand and simple. Processwire has a supremely powerful yet simple API , and for important things there are (not 1000) but certainly one module which at least serves as a good starting point for further development. Last but not least, the documentation is easy to understand, extensive and clever . Our experience shows, that you can find a quick and simple solution with Processwire, even for things like extending the rights-management — most of the time a highly complex task with other systems. This is also reflected positively in the user interface. The otherwise so “simple” Wordpress crumbles when coping with more complex tasks. It sumbles over its apparent simplicity and suddenly becomes complex: Old vs. New — Simple and yet complicated vs. easy and hmmm … easy Our experience with Processwire as first-timers Before we found out about Processwire, we found CraftCMS on our hunt for a better CMS. We were frustrated by the likes of Typo3, WP or Drupal like many here. CraftCMS looked very promising but as we were digging deeper into it, we found it did not met our requirements for some big projects in our pipeline that require many different locations, languages and features. Initially we were sceptical about Processwire because; A. CraftCMS Website (and before UiKit also the admin interface) simply locked much nicer and B. because it is built on top of a Framework It was only later, that we found out, that NOT depending on a Framework is actually a very good thing in Processwire's case. Things tend to get big and cumbersome rather then lean and clean. But now we are convinced, that Processwire is far superior to any of the other CMS right now available in most cases. The good Processwire is the first CMS since time immemorial that is really fun to use (almost) from start to finish— whether API, documentation, community, modules or backend interface. Every few hours you will be pleasantly surprised and a sense of achievement is never far away. The learning curve is very flat and you’ll find your way quickly arround the system. Even modules can be created quickly without much experience. Processwire is not over-engineered and uses no-frills PHP code — and that’s where the power steams from: simplicity = easy to understand = less code = save = easy maintanance = faster development … Even complex modules in Processwire usually only consist of a few hundred lines of code — often much less. And if “hooks” cause wordpress-damaged developers a cold shiver, Hooks in Processwire are a powerful tool to expand the core. The main developer Ryan is a child prodigy — active, eloquent and helpful. Processwire modules are stable even across major releases as the code base is so clean, simple and small. There is a GraphQL Plugin — anyone said Headless-CMS?! Image and file handling is a pleasure: echo "<img src='{$speaker->image->size(400, 600)->url}' alt='{$speaker->fullname}' />"; I could go on all day … The not soooo good Separation of Stucture and Data The definition of the fields and templates is stored in the database, so the separation between content and system is not guaranteed. This complicates clean development with separate live- and development-environments. However, there is a migration module that looks promising — another module, which is expected to write these configurations into the file system, unfortunately nuked our system. I'm sure there will be (and maybe we will invest) some clever solutions for this in the future. Some inspiration could also be drawn here, one of the greatest Plugins for WP: https://deliciousbrains.com/wp-migrate-db-pro/ Access rights The Access-Rights where missing some critical features: Editors needed to be able to edit pages in all languages on their own location, and content on the rest of the page only in their respective language. We solved it by a custom field adding a relation between a page the user and a role that we dynamically add to the user to escalate access rights; /** * Initialize the module. * * ProcessWire calls this when the module is loaded. For 'autoload' modules, this will be called * when ProcessWire's API is ready. As a result, this is a good place to attach hooks. */ public function init() { $this->addHookBefore('ProcessPageEdit::execute', $this, 'addDynPermission'); $this->addHookBefore('ProcessPageAdd::execute', $this, 'addDynPermission'); } public function addDynPermission(HookEvent $event) { $message = false; $page = $event->object->getPage(); $root = $page->rootParent; $user = $this->user; if ($user->template->hasField('dynroles')) { if ($message) { $this->message('User has Dynroles: '.$user->dynroles->each('{name} ')); } // for page add hook… if ($page instanceof NullPage) { // click new and it's get, save it's post… $rootid = wire('input')->get->int('parent_id') ? wire('input')->get->int('parent_id') : wire('input')->post->parent_id; if ($message) { $this->message('Searching Root '.$rootid); } $root = wire('pages')->get($rootid)->rootParent; } elseif ($page->template->hasField('dynroles')) { if ($message) { $this->message('Page "'.$page->name.'" has Dynroles: '.$page->dynroles->each('{name} ')); } foreach ($page->get('dynroles') as $role) { if ($role->id && $user->dynroles->has($role)) { if ($message) { $this->message('Add dynamic role "'.$role->name.'" because of page "'.$page->name.'"'); } $user->addRole($role); } } } if (!($root instanceof NullPage) && $root->template->hasField('dynroles')) { if ($message) { $this->message('Root "'.$root->name.'" has dynamic roles: '.$root->dynroles->each('{name} ')); } foreach ($root->get('dynroles') as $role) { if ($role->id && $user->dynroles->has($role)) { if ($message) { $this->message('Add dynamic role "'.$role->name.'" because of root page "'.$root->name.'"'); } $user->addRole($role); } } } } } With the Droles and Access Groups Modules we were not able to find a solution. I thought it was hard to get absolute URLs out of the system — Ha! What a fool I was. So much for the topic of positive surprise. (Maybe you noticed, the point actually belongs to the top.) But while we’re at it — that I thought it would not work, was due to a somewhat incomplete documentation in a few instances. Although it is far better than many others, it still lacks useful hints at one point or another. As in the example above, however, the friendly community quickly helps here. processwire.com looks a bit old-fashioned and could use some marketing love. You notice the high level to moan with Processwire. There is no free Tesla here. Conclusion Processwire is for anyone who is upset about any Typo3, Wordpress and Drupal lunacy — a fresh breeze of air, clear water, a pure joy. It’s great as a CMF and Headless CMS, and we keep asking ourselves — why is it not more widely known? If you value simple but clean code, flexibility, stability, speed, fast development times and maximum freedom, you should definitely take a look at it. You have to like — or at least not hate PHP — and come to terms with the fact that the system is not over-engineerd to excess. If that’s okay with you, everything is possible — with GraphQL you can even build a completely decoupled frontend. We are convinced of the simplicity of Processwire and will implement future sites from now on using it as a foundation. Links & resources we found helpful API documentation and selectors API cheatsheet pretty handy, not quite complete for version 3.0 Captain Hook Overview of Hooks Weekly.PW newsletter a week, exciting Wireshell command line interface for Processwire Nice article about Processwire Plugins & Techniques that we used Custom Frontend Setup with Uikit 3 and SCSS, and Markup Regions Uikit Backend Theme ( github ) Oauth2 login modules In-house development Login with E-Mail Pro Fields for repeater matrix fields (infos, price tables, daily routines) Wire upgrade to update plugins and the core Wire Mail Mandrill to send mails FunctionalFields for translatable front-end texts that are not part of a content type (headings, button labels, etc.) Runtime markup for dynamic backend fields (combination of first and last name) Tracy debugger for fast debugging Textformatter OEmbed to convert Vimeo and Youtube links into embed codes HideUneditablePages thanks to @adrian1 point
-
/** * check & hide specific checkbox field if page being edited has no children */ if ($page->process == 'ProcessPageEdit' && $input->id) { $field = $fields->get('createevents'); $_page = $pages->get($input->id); if ($_page->template->fields->hasField('createevents')) { if ($page->hasChildren() == false) { $field->set('flags',160); $field->setRoles('edit',array()); // works for non superuser only $_page->setAndSave('createevents', true); } } }1 point
-
This is because of variable scope in PHP. Every function has its own internal scope. So this doesn't work: $vegetable = "Beetroot"; function vegetableOpinion() { // $vegetable is undefined in this function's scope return "$vegetable is delicious!"; } echo vegetableOpinion(); But you can pass in $vegetable as an argument to the function so it is available within the function's scope: function vegetableOpinion($vegetable) { return "$vegetable is delicious!"; } // Could be defined in _init.php if you like $vegetable = "Beetroot"; // Pass in $vegetable as an argument to the function echo vegetableOpinion($vegetable);1 point
-
1 point
-
Use $e->object->hasPage property // Inputfield.php * @property null|bool|Fieldtype $hasFieldtype The Fieldtype using this Inputfield, or boolean false when known not to have a Fieldtype, or null when not known. #pw-group-other * @property null|Field $hasField The Field object associated with this Inputfield, or null when not applicable or not known. #pw-group-other * @property null|Page $hasPage The Page object associated with this Inputfield, or null when not applicable or not known. #pw-group-other1 point
-
FYI, one site I rewrote recently the honeypot fails entirely. I wouldn't like to add a captcha so added sblam, whuch works fine so far: https://sblam.com/en.html1 point
-
Hi there, A colleague of mine is trying to get our site running on his local Ubuntu LAMP Setup (Ubuntu 17.10, Apache 2.4.27, PW 3.0.62, PHP 7.1.11) When he types in the Homepage URL, he's getting code outputted instead of being executed. Does any one know why? Update : Just Figured it out. Apparently, it's a new PHP7 security feature that disables from code executing if the code module starts with <? instead of <php I'm using MAMP locally so I'm guessing MAMP is somehow circumventing this but LAMP isn't. I'm posting this so people can save themselves hours pulling their hair out.1 point
-
No, I believe @BitPoet means you should add it as your custom/personal property to $config. Please don't overwrite the imageSizerOptions! // Global image options, different from default imageSizerOptions (!) $config->mySpecialImageOptions = array("upscaling" => true, 'cropping' => "center", "quality" => 90); If you overwrite the ImageSizerOptions with an array that does not include all key->value pairs, somewhere a kitten will die!! Or you do it with array_merge: $config->imageSizerOptions = array_merge($config->imageSizerOptions, array("upscaling" => true, 'cropping' => "center", "quality" => 90)); Then you always increment every key->value you don't want specifically change, (even future unknown ones, thinking on PW-Version-Upgrades!!)1 point
-
@ROLAND_JUNO mine is like this. Using the new gtag. Just paste it in as the first item in the <head> section for your site like so: <?php namespace ProcessWire; ?> <!DOCTYPE html> <html lang='en'> <head> <!-- Global site tag (gtag.js) - Google Analytics --> <script async src="https://www.googletagmanager.com/gtag/js?id=UA-NUMBER"></script> <script> window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'UA-NUMBER'); </script> <!-- then the rest of your meta tage/page title/whatever --> <meta http-equiv='content-type' content='text/html; charset=utf-8' /> <meta name='viewport' content='width=device-width, initial-scale=1' /> </head> You find your specific code (and UA-NUMBER) on the google analytics website.1 point
-
With the diagnostics module(s) there is also one for (missing) server image feature detection.1 point
-
Ah, that reads a lot more doable then For a dozen tables, I'd probably create the templates and their fields by hand as it is a one-time thing. Perhaps you can name the templates like the old tables for easier coding later. Then create a page field on the main template for every linked table and limit it to the according support table template. Your import routine can focus on creating pages with the correct template and filling in the data. The old id can just go into a dedicated field in the support template, and once all your support table pages have been created, you can use simple selectors like $pages->get("template=oldtablename, keyfield=TRN") to get the correct page to link to when you import the main page/table. Depending on whether you need to display the link codes, you can hide or even drop the field in the support templates. I'm assuming most support tables will be relatively simple and a template with a title and one extra field for the db id code should be sufficient.1 point
-
Literally thousands of tables or just thousands of rows/records?1 point
-
Saving a sort order to a Repeater field is trickier than you might expect. This is because the sort order of items in a Repeater field is determined by their sort position under their parent page in Admin > Repeaters > [repeater field] > [container page]. So the "sort" value of each Repeater page in other words. When you do... $page->repeater_field->sort('some_property') ...you are only changing the order of items in the PageArray. This order is never saved to the "sort" value of the individual repeater items. Here is one way you can save the sort order: // Here you order the PageArray how you want it $r_items = $page->repeater_field->sort('some_property'); // BUT, the original keys (indexes) are preserved // So you need to get just the values with new keys // This step could be merged into the line above // Alternatively you could just use a counter variable in the foreach loop $r_items = $r_items->getValues(); foreach($r_items as $index => $r) { // Update the sort value of the repeater page // See: https://processwire.com/api/ref/pages/sort/ $pages->sort($r, $index); } Also, you might be interested in the Page Move and Resort module by @kixe. It has a method... $pages->resortChildren($page, $selectorValue) bool/ null resort children under specified parent based on selector value (sort=$selectorValue) ...which you could use on the parent page of the Repeater items.1 point
-
Many of the images are taking a long time to load, for example,1021701976_1-1.1140x760.png takes 12.64 seconds. You can add setlocale(LC_ALL,'en_US.UTF-8'); to your /site/config.php to remove that error. Use whatever locale is appropriate for you. [edit] You can use the browser dev tools > network tab to determine loading issue. It will help eliminate that issue should others exist.1 point
-
1 point
-
1 point