Leaderboard
Popular Content
Showing content with the highest reputation on 04/04/2018 in all areas
-
This is actually very easy but might be interesting for someone anyhow (and I post it here as a reminder for myself). You can use Postman (https://chrome.google.com/webstore/detail/postman/fhbjgbiflinjbdggehcddcbncdddomop?hl=de) to send requests to your ProcessWire installation and test request answers. The problem is that $config->ajax will always return FALSE. To make the $config->ajax work properly you just need to add this key-value-pair to your requests: key: X-Requested-With value: XMLHttpRequest Happy AJAXing PS: This also works inside the admin, see post 35 points
-
ModuleManager inherits from the Process class and calls its parent's init method here. Process::init in turn invokes Modules::loadModuleFileAssets. This method looks for .js and .css files in the same location and with the same name as the module it is called for and, if found, adds them to $config->scripts / $config->styles. Admin themes all have lines like these in their template code to load the contents of the $config->scripts and $config->styles: <?php foreach($config->styles as $file) echo "\n\t<link type='text/css' href='$file' rel='stylesheet' />"; ?> <?php foreach($config->scripts as $file) echo "\n\t<script type='text/javascript' src='$file'></script>"; ?>5 points
-
Yeah, at firts sight ag-grid looks great but have you seen http://tabulator.info/ lately? Namely the new release: http://tabulator.info/news I have also checked out a lot of these JS table libraries and Tabulator seems to be the only one which is completely open source (MIT) and is being actively developed. I have not used it just yet but I am planning a test drive in the near future.4 points
-
You can even use it inside the backend: Install Postman Interceptor extension Activate the extension in the browser and in the postman app Go to your desired admin page (eg /page/edit/?id=123) The request will show up in the history and you can modify it to your needs I'm doing a die('test') here in the admin, with tracy installed, of course3 points
-
Another way if you would like to load arbitrary JavaScript file in your module is : Define an array with the files defined in it : protected $jsfiles = array( 'js/MyScript.js' ); Then in ready(), write : foreach ($this->jsfiles as $jsfile) { $this->config->scripts->add($this->config->urls->MyModule . $jsfile); } And, the question "Why my JS file are loaded before Jquery ? Should I call my script in init(), ready() or execute() ? @ryan answer :3 points
-
I did a develop and made dis, a procedural galaxy that, well... gets procedurally generated. You can use your mouse to zoom in/out and look around. You can click on stars to get their specific information. It's inspired by the galaxy maps found in games like Elite Dangerous and Eve Online. http://fransvanberendonk.com/procedural-galaxy/ Basicly I've made Templates and Fields for Spectral Classes and Subclasses, and looked up online what a realistic distribution scheme would be for these. This data is grouped under a page that renders then as JSON for the Javascript application to work with. I wrote that app in AngularJS, so I could add more controllers to it later. It also uses BabylonJS to calculate the number and position of stars and display them on screen, and assigns each a Spectral Class and Subclass after some shuffling of the dataset. Using a secondary controller only used in a ProcessModule for the CMS, I can broadcast events that redo the procedure using different variables (see screenshot below). No particular purpose, just thought I'd share a cool side project that rolled out of my exploration of these JS frameworks in conjunction with PW.2 points
-
Everything looks fine to me in v1.8.9, thanks everyone for the help. It was new to me that template level sort order takes only the parent page into account, I thought the child pages' templates are also involved somehow.2 points
-
OK. Since your priority is to get you site up and running, is it possible to, are you able to create an alternative database using your older MySQL version? Assuming you have a backup of the site pre-the upgrade, you would then import it into the new database and point ProcessWire to that. That would give you a breather to sort out your main issue. Just thinking out loud here. You've probably thought of these things already.2 points
-
Thanks for the tip. btw - PHPStorm has a REST client tool built-in (this is more of a reminder / info for other PHPStorm users - it's such a massive IDE that handy features like these can be easily missed)2 points
-
@Roych Can you send me a copy of the site? It would be easier to help by taking a closer look. You can use Duplicator to pack it up easily. I would have time to examine it this weekend. Just PM me if you want to proceed this way.2 points
-
It would be nice if a description field will also be added to the templates. At the moment only a label field is included. In my case I use a custom dashboard on the frontend with links to the different content types. On the frontend the description field could be used as a title attribute for the links. So the editor could see if it is the right content type he is looking for by hovering over the links. On the backend side the description could be displayed under the title of the template. This could be a useful addition to give users a little more information about the template itself. Example for a description: Template for creating an event with start and endpoint and the possibility to enter prices, locations, number of participants and more.2 points
-
Not sure if that was a reply to my comment, but Adrian's idea isn't working when I test it with sort settings applied to the parent page or template. I think it would have to be something like this: $parent = $this->editedPage->parent; if($parent->id) { $sort = $parent->template->sortfield ?: $parent->sortfield; } else { $sort = 'sort'; } $first = $this->editedPage->siblings("sort=$sort, limit=1")->first(); $last = $this->editedPage->siblings("sort=-$sort, limit=1")->first(); Getting a single page could be simplified with findOne(), but not sure if you care about supporting < PW 3.0.3 scratch that2 points
-
The module has been lying around on GitHub for some time now, so I thought I'd give it its own forum topic so I can give it a module list entry. SymmetricEncryptedText Symmetric encryption for text based fields (supports multi language fields). Module page. Link to the GitHub repo. Description This module adds an encryption option to all text fields (and those derived from FieldtypeText). Field contents are encrypted using a symmetric key when a page is saved and decrypted when loaded from the database. The module by default uses sodium (if loaded) in PHP versions >= 7.2, otherwise it falls back to the bundled phpseclib. Multi-Language fields are supported too. WARNING! Setting a field to encrypted and saving values in those fields is a one-way road! Once encrypted, the contents cannot be unencrypted without writing a program to do so. Disabling the encryption option on a field after the fact gets you encrypted "garbage". Usage Download the zipped module through the green button at the top right of the GitHub repo or (once available there) from the official PW module repository Extract in its own directory under site/modules. In the backend, click "Modules" -> "Refresh", then install "Symmetric Encryption for Text Fields". Go to module settings. An appropriately sized, random key will be generated if this is your first use. Copy the supplied entry into site/config.php Add fields or configure already present fields. On the "Details" tab you can enable encryption for the field in question Edit a page with such a field, enter a value there, save and enjoy Existing, unencrypted values are left untouched until a new value is saved. That way, you can do a smooth upgrade to encryption, but you have to save all pre-populated pages to have their values encrypted in the database. Thus it is recommended to avoid adding encryption to already populated fields. Advanced Usage You can hook after SymmetricEncryptedText::loadKey to retrieve your key from somewhere else, e.g. a different server.1 point
-
I'm learning how to write my own module. To learn how to write a module, one of method is to read modules developed by other people. Take Module Manager module which is written by @Soma https://github.com/somatonic/ModulesManager/blob/master/ModulesManager.module While I read thru the source, I could not find a javascript thing load statement to load the ModuleManager.js https://github.com/somatonic/ModulesManager/blob/6ddf1f872b17773cff2426e6f196d4d07c6ee709/ModulesManager.module#L173-L175 I could find only these two lines which is output two javascript variables used by ModuleManager.js. It is not to load the ModuleManager.js for this module. https://github.com/somatonic/ModulesManager/blob/6ddf1f872b17773cff2426e6f196d4d07c6ee709/ModulesManager.module#L173-L175 https://github.com/somatonic/ModulesManager/blob/6ddf1f872b17773cff2426e6f196d4d07c6ee709/ModulesManager.module#L173-L175 Anyone could explain how the module load its own ModuleManager.js file ?1 point
-
1 point
-
aha yes I see that the "active" is not checked for the url of the french versions. I thought this was only for the URL when visiting that link, so I was under the impression the data would still be accessible/visible. thank you for the quick diagnosis much appreciated if anyone else is curious or needs details on setting active by API1 point
-
Are the other languages active? on the settings tab of the page? You should set the status for each language to active during the import. Or after the fact you can do with the AdminActions module's "Page Active Languages Batcher" feature.1 point
-
Hehe. The PW forum is a nice snippets manager and knowledge base for free1 point
-
Thanks for this! A while back (actually, a long time ago), I thought I'd checked them all but it seems there's quite a number of new kids on the block (unless I missed them first time round ). I would have loved a Pivot Tables feature (aggrid has this in the paid version). Sorry to hijack your thread Bernhard...1 point
-
Thanks for your feedback, I really enjoy the discussion. @mit Aggrid is also mit licensed: https://github.com/ag-grid/ag-grid/blob/master/LICENSE.txt And I don't think it's bad to have paid pro features. Quite on the contrary. I think it can ensure a long life of the software and good quality. We know that principle from somewhere, don't we?! ? @xlsx I have looked at this closely already as it is a must for me to transfer data to excel. Aggrid has the ability to export data as CSV with custom separators. It's perfectly fine to use this for excel export IMHO. It even has custom renderers that only fire when data is accessed for export. Only thing missing at CSV compared to xlsx is fancy styling and formulas etc. Personally I don't need this in any of my projects. Ok, simple links come to my mind. That might be nice to have. But we can still use the API to get data and then use any other JavaScript xlsx library to create our files. Or just pay a little fee to enable that feature. Aggrid looks really well crafted. I'm actually quite happy that I forgot my version of datatables at home over Easter so I was forced to take a pause and take a closer look to aggrid ?1 point
-
Not saying it's a reason to switch, but it does support xlsx whereas that appears to require the paid version aggrid.1 point
-
Well, I am not suggesting you should switch to it, the only thing which is clearly better to have is its MIT license. I just thought you might want to reconsider it just once more but I know its not fun switching libraries "just because" Feel free to ignore my notes.1 point
-
thx @szabesz, haven't seen anything about tabulator so far. It looks quite similar to jquery datatables though and I have not seen anything that would not be possible using aggrid on the first sight. Or did I miss anything? I'm quite far with my implementation of agGrid, so I'm quite sure I will not change the grid library (again) very soon1 point
-
next idea....i've run into the forged message while on this webspace i've had no more space with an automatic backup script that use all webspace...so i get a lot of errors...and could only login if i delete the cache....under assets. Stupid and easy solution was to clean the webspace...just i case. regards mr-fan1 point
-
PW core uses $db in many places: wire\core\Database.php line 73 $db = $config->dbName; wire\core\DatabaseMysqli.php line 37 $db = $this->db($method, 'method'); wire\core\ProcessWire.php line 373 $db = $this->wire('db', new DatabaseMysqli($config), true); I don't have any modules using this var... the modules can't load data from fields like textareas, profields, etc1 point
-
Hi @Robin S - I can't seem to reproduce this - the Request Info panel appears to be only adding one call. I am using the HannaCode textformatter and adding: bd($field->name); to the first line of the formatValue() method and with the RequestInfo panel open I get two dumps, and with it closed I get one. Could you share the module you are working on, or perhaps test with Hanna code, and maybe with a different field/template combo to see if there is something more specific required to reproduce? PS - Are you running the latest version of Tracy?1 point
-
This module does not work with ProcessWire 3.0.x. If you try to edit a page "The process returned no content" appears (translated from german). Must have to do with the hooks not returning correctly. Sadly the README on github says, that this module is no longer maintained.1 point
-
The solution: Just need to disable the appending main page from the template. Thanks for your help @psy1 point
-
@Eunico Cornelius Just a thought... on your template have you checked Disable automatic prepend of file: _init.php and/or Disable automatic prepend of file: _main.php?1 point
-
1 point
-
I'd never heard of this grid, so thanks! I just had a quick look and it looks very powerful. Btw, I couldn't find info about the differences between the free and paid versions. Do you know what these are? Thanks.1 point
-
Hi @adrian, I was doing some testing with a textformatter module and was wondering why the formatValue() method was firing so often, even when my template file does not get the field with the textformatter applied. I traced it back to the Request Info panel - when this panel is active the textformatter formatValue() method fires four times (not including any usages of the field in the template file). I see that the panel shows the value of each field in the template in the "Field List & Values" section, but I would have thought this would only account for one firing. Just wondering if something in that panel is getting the field values more often than necessary and could be optimised perhaps?1 point
-
it's really pretty easy, just get a json array of the data and use DataTables to output the data.. the DataTables documentation is good enough to get you going, should you decide to try it out..1 point
-
Thanks @tpr and @Robin S for your work and thoughts on this. I haven't had time to test thoroughly regarding template level sort etc, but I just wanted to note that the initial issue of loading all siblings is definitely now fixed1 point
-
/* --------------------------------------------------- PORTFOLIO FILTERING ---------------------------------------------------- */ $('.portfolio-filter').on('click', 'a', function() { $(this).addClass('current'); var filterValue = $(this).attr('data-filter'); $(this).parents('.portfolio-filter-wrap').next().isotope({ filter: filterValue }); }); this is in your main.js. filterValue is looking for data-attributes, not CSS classes! So: either change the markup and use data-filter="Logo" etc. or change the JS. btw, afaik, you'd be better off using jQuery's $(this).data("filter") instead of attr() (but maybe it just depends on your jQuery version - as long as it works, it works.)1 point
-
Yep, that's with the overhead is right, but only on the first view. If you have many fields and reference fields on one page (template), your searches may become time costy in the DB. At that point you want to use concatenated fields (also available as core module!). So it depends on the amount of your involved fields (=DB-tables) which way to go. EDIT: The core module is called Cache, it is a fieldtype:1 point
-
Hi @Sabrina, I've removed the link in your post. Given that you are a first time poster and there is no indication that you are using ProcessWire, your link could have been subtle advertising. This is not allowed. If I am wrong, please clarify. We'll be happy to help if your site is made using ProcessWire.1 point
-
Adds a class="external" and a rel="nofollow" to every external link by default. Optionally adds a rel="noopener", a rel="noreferrer" and a target="_blank". Note: This module is based on TextformatterMarkExternalLinks and some improvements of @teppo that were never implemented due to module's author inactivity. Download TextformatterOptimizeExternalLinks Requirements ProcessWire 3.x Changelog 1.0.0 (3 April 2018) Initial release1 point
-
Actually, you might not even have to rename it. If you save it in /site/modules/, ProcessWire will tell you that you have two similar modules, one in /wire/modules/ and the other in /site/modules/. It will give you a choice to decide which one to use. You'll choose the one in /site/. I'd go for renaming it though to avoid confusion and also so that the one in /wire/modules/ can still be used for its normal purpose.1 point
-
Extend the list with those characters here: /module/edit?name=InputfieldPageName1 point
-
Sorry, my answer above was probably not very helpful. I am actually not sure if I understand your question or reasoning. You refer to two different options How do the two options render in your browser? <link rel="stylesheet" type="text/css" href="/site/templates/assets/uikit/css/uikit.min.css" /> - does not work? <link rel="stylesheet" type="text/css" href="/site/templates/assets/css/uikit.min.css" /> - works? So probably if the following does not work http://mysite.com/site/templates/assets/uikit/css/uikit.min.css Does the following link then work? http://mysite.com/site/templates/assets/css/uikit.min.css Just wondering if the uikit.min.css is rather located in the folder /site/templates/assets/css/ and the folder /site/templates/assets/uikit does not actually exist? According to my understanding of PW, the default settings in the .htaccess file only direct requests to php and other system files to PW root index.php whereas files like .css or .js are handled by the web server directly. Maybe someone more knowledgeable can answer this question.1 point
-
Sure, thanks for the help. I've managed to get the first children by using $parent->find('...., limit=1')->first(), so that it doesn't load all pages. For the last child I plan to use $parent->find('..., start=$numSiblings-1, limit=1')->first() which should not load all pages (haven't had the chance to try yet). I think these will be fine but if you know a simpler approach, please tell.1 point
-
I was reading the HTML5 Boilerplate .htaccess file (like you do), when I came to the bit about filename-based cache busting. TL;DR Resources used by a web page that will rarely change (js, css, images) should be given an 'expires' date well into the future to take advantage of browser (and possibly proxy) caching. However, when they do change, you need to tell the browser to load the new version instead of the cached version. Using query strings (eg styles.css?v=2) is not the best way. The html5bp htaccess references a blog post by Steve Souders on this topic. The 1st comment to this post references a way to include automatic versioning for these types of resources, based on the file date. (That last link pretty much summarises the whole deal, if you haven't time to read the other links.) The reasons why I mention this are It's an interesting subject. It seems to me to be something that could be implemented in PW for relatively little initial effort, but have significant benefits going forwards. Now my technical ability is limited as far as implementing this goes, but that's why I mention it here. I don't know if this should be a core feature request, or a module, or what, but I offer it for discussion. What do you think?1 point
-
With a bit of hooking it is possible to both dynamically control the selectable pages for a PageAutocomplete inputfield, and dynamically set the parent/template of new pages created from the inputfield. I have only played around with this and haven't used it in production, so use it at your own risk. Dynamic selectable pages for PageAutocomplete The idea is that in the field settings you define a broad selector that includes all of the pages you might want to select. It could be something really broad such as "has_parent!=2". Then you modify the selector in a hook according to the page being edited. In /site/ready.php... $wire->addHookAfter('Field::getInputfield', function(HookEvent $event) { $field = $event->object; $inputfield = $event->return; // Only for this one Page Reference field if($field->name !== 'test_page_field') return; // Only for ProcessPageEdit if($this->process != 'ProcessPageEdit') return; $page = $this->process->getPage(); // Get findPagesSelector (or findPagesSelect if you used that) $selector = $inputfield->findPagesSelector; /* Now append to or overwrite $selector however you like, depending on $page maybe. You can even define some $allowed PageArray like with the "Custom PHP code" option that is possible with other Page inputfields, and then use it in the selector as "id=$allowed". But note that there is a 500 character limit enforced on selectors. */ // Set the modified selector back to the property you got it from $inputfield->findPagesSelector = $selector; }); Dynamic parent and/or template for pages created from the inputfield The idea is that in the field settings you do not define a parent or template for allowed pages, but then set these properties in a couple of hooks according to the page being edited. In /site/ready.php... $wire->addHookBefore('InputfieldPage::renderAddable', null, 'dynamicParentandTemplate'); $wire->addHookBefore('InputfieldPage::processInputAddPages', null, 'dynamicParentandTemplate'); function dynamicParentandTemplate(HookEvent $event) { $inputfield = $event->object; // Only for this one Page Reference field if($inputfield->hasField->name !== 'test_page_field') return; // Only for ProcessPageEdit if(wire()->process != 'ProcessPageEdit') return; $page = wire()->process->getPage(); // Now set $parent_id and $template_id dynamically depending on $page $parent_id = 1234; // demo value $template_id = 56; // demo value $inputfield->parent_id = $parent_id; $inputfield->template_id = $template_id; } Have fun!1 point
-
I'm sorry, but I have never used hooks until now. When creating pages directly with the API, I made it a habit to simply add the necessary language actions in the same script. Basically, you then use $page->save() twice. 1st step: add page, define parent, template, fill field values etc. save #1. 2nd step: with the new page id you get, add the lang. actions (status etc.). save #2.1 point
-
First, some background to lit a light. There are some functions in PHP that may produce unexpected results in special situations. This functions are used by PW core files and in user contributed modules. Some users may have problems with file upload (pdf, zip, image, whatever) if filename has non-ascii character at the first place. For example, if user upload a file named "år.jpg" (year in Swedish language), it is expected that PW would transliterate (transform) the filename to "ar.jpg", but because of the bug in basename() PHP function, the filename would become just "r.jpg". Nevertheless the file would upload successfully. But if the filename is "привет.jpg" (Hi in Russian language) the upload would fail. There are two ways how to handle this: Write and use custom functions instead of builtin functions Let end user fix that with proper locale Option 1. is used in some CMS/CMF (like Drupal), PW (Ryan) opted for option 2. After successful login PW perform a test and warning is issued in case of test failure. It is now your responsibility to set proper system locale. The locale is a model and definition of a native-language environment. A locale defines its code sets, date and time formatting conventions, string conversions, monetary conventions, decimal formatting conventions, and collation (sort) order. Those "problematic" builtin PHP functions are locale aware, that means they work as expected, if locale is configured appropriately. Locale can be set by the underlying operating system or in PHP. Because on shared hosting you don't usually have root access to the OS, the only option to set the locale is by using the builtin setlocale() PHP function. But, before you can use/set the locale, it must first be installed on the OS. On most unix systems at least some basic locales are already there, they are just not used. To check what locale are you currently using and what locales are available for you to use, create the file testlocale.php at the root of your website with the following content: <?php echo "<pre>Current locale:\n" var_dump(setlocale(LC_ALL, '0')); echo "\n\nAvailable locales:\n"; echo exec('locale -a'); Then point your browser to http://yourwebsite/testlocale.php If your current locale is "C" (and you are on unix), then you will probably get warning after login to the PW admin. What you want to do is change the locale to something that has "UTF-8" or "utf8" in the name of the available locales. In your case you would be looking for something like "sv_SE.UTF-8" or "sv_SE.utf8". Now, there is a chance that Swedish locale is not installed. You can ask your hosting provider to install it for you or use some other UTF-8 locale. On most unix systems I have seen, at least "en_US.UTF-8" or "en_US.utf8" is installed. If even that English locale is not available, then look for "C.UTF-8" or "C.utf8". And this is what you have to use as parameter in the setlocale() call: setlocale(LC_ALL, "sv_SE.utf8"); You could actually "stack up" multiple locales and one will eventually work: setlocale(LC_ALL, "sv_SE.utf8", "sv_SE.UTF-8", "en_US.UTF-8", "en_US.utf8", "C.UTF-8", "C.utf8"); Now, regarding where to put that setlocale() call. If you are not using PW multi language capabilities (you don't have Languge Support module installed), then you place setlocale to /site/config.php. That's it. If Language Support module is installed (PW checks for that), you have two options: Translate the string "C" in LanguageSupport.module for each installed language Put setlocale() call in /site/init.php My preferred method is option 1 and this is what PW (Ryan) recommends. See https://processwire.com/api/multi-language-support/code-i18n/ for more info on translating files. Option 1 allows you to set different locale for each of the installed language, while option 2 allows setting of one locale for all languages. PW will also provide links for the files that needs to be translated in the warning message. Ryan just pushed an update that makes it use the locale setting on the frontend when using LanguageSupportPageNames module (until now just language was changed, but not locale). Also setLocale() and getLocale() methods are added to the $languages API var.1 point
-
Hi mrkhan, Ok I was digging this for a while and now have it working It didn't work for me also in the beginning because I was testing it for the body field but overlooked the file config-body.js Please first read \site\modules\InputfieldCKEditor\README.txt So, if you want to add/edit your <i class="fa fa-check-circle-o"></i> in your ckeditor body field then you have to configure the file config-body.js To make this work: open in your editor \site\modules\InputfieldCKEditor\config-body.js and make sure at the bottom it looks like this: CKEDITOR.editorConfig = function( config ) { // Define changes to default configuration here. For example: // config.uiColor = '#AADC6E'; config.enterMode = 2; config.allowedContent = 'i[*]{*}(*)'; }; The line config.enterMode = 2; prevents your <i> tag from being wrapped in a <p> tag wich is default behaviour of ckeditor. The line config.allowedContent = 'i[*]{*}(*)'; allows the <i> tag with wild cards for attributes, styles and classes. I tested this with processwire version 2.6.1 with a body field and all is working. Disclaimer: Tags and classes should stay in css outside ckeditor but when dealing with a client who is already used to edit with a few html tags, adding only a few of them would be ok. I don't see any security issues here. Installing the Hanna code module makes all this obsolete and is recommended by many people here. But for only allowing a single html tag I think the powerful hanna code module is a bit overkill here.1 point
-
I like the idea. I have been looking for proper way to version control PW sites recently, and have not ended with a clear decision for myself. Of course "it depends on a project". But we can come up with a tutorial helping make the choices. What to version in git I never tried initialising a git repo in templates folder, as Ryan suggested here. Custom modules and now site/ready.php should go to version control, as well as config.php. For me the choiсe is either to version the whole installation or only the /site folder. As I usually modify the .htaccess I am leaning to the former. The next thing is what to ignore. Some think you should ignore /wire, some think it is worth having it in the repo. If we could (I mean If I knew how to) install the needed version of PW core as a dependency via composer or include it in a similar way automatically after deployment / git checkout, it would be better to leave /wire off. But for simplicity it could be better not to exclude it as it is quite small. That definately should be excluded is some part of site/assets. If the site is a big one, excluding site/assets/files is a must. But for a small near to static it is probably worthless. You should probably ignore these almost every time not to mess with constantly changing data: site/assets/cache site/assets/sessions site/assets/logs I found no reason not to include all modules to the VCS. Deployment Speaking about deployment, I do not like the idea to deploy every time I commit (which seems to be the case if using git-hooks, if I am getting it right). There are other ways for deployment with git, but I an intrigued by doing it with something like this or this (both are capistrano-like deployment tools in php). Anyway, I do not seem to find a way to easily deploy database changes. Maybe in the case of semi-static sites it is possible to dump a database and restore in with git-hooks (or to include a sql dump from sites/assets/backup/database to the revision and manually restore it), but it probably will never work with subscription sites and rich-content sites managed by clients. The only way to keep track of changes made to the database via PW GUI (admin) I came up with is keeping a journal. I made a folder where I include subfolders related to git commits with JSON export files for fields, templates and forms, which should be imported. Pages are just described in .txt as I know of no way to export them to something like JSON. It would be awesome to have something like the things discussed here available not to do it manually. Hope it is somehow useful. I would be delighted to hear how others do it, as I am certainly only an amateur in all this stuff.1 point
-
In case you want it a little more simpler $pages->setOutputFormatting(false); $pag = $pages->find("template=basic-page"); foreach($pag as $p) { foreach($languages as $lang) { if($lang->isDefault()) continue; $p->set("status$lang", 1); $p->save(); } }1 point