Leaderboard
Popular Content
Showing content with the highest reputation on 12/20/2021 in all areas
-
The core could maintain a list of checksums for its own site profiles, which would restore security to prev. state even with downloads involved. For third party profiles there could be a warning about the tradeoffs involved.3 points
-
@DrQuincy what is this page doing that takes a lot of time? If there is a loop operation that iterates over a lot of items, and you are able to implement an optional get param with the last processed item identifier, there is a good chance that this is all you need to do to make this work. For this to work you would check if a start-identifier was given with the URL, if not start with the first item, otherwise with the #n item from the $input->get->myidentifiername. When starting the script, store a timestamp and in each loop operation compare it with the current timestamp. Maybe when it reached the point greater or equal 100 seconds, do a redirect call to the same page, but with the current (last) processed loop item identifier: ... if(time() >= $starttimestamp + 100) { $session->redirect($page->url . '?itemidentifiername=' . $lastProcessedItemID); } ... Or, much easier, have you tested if the 120 second time limit can be reset from within a script? (calling set_time_limit(120) from within a loop can make it run endless on some server configurations)3 points
-
There was a poll in 2017: https://weekly.pw/polls/#which-site-profiles-should-be-bundled-with-processwire Personally I only use the blank site profile. But for beginners one starter site profile would be necessary. I don't think there is a need for multiple site profiles, but that is just my opinion. Other CMS offer two separate downloads (one blank and one starter download). This could also be an option.3 points
-
This week ProcessWire has gone on a diet. I've been working on reducing the size of the core by moving all (except site-blank) installation profiles out of the core and into their own repositories. This cuts the size of the core in half, going from 15.5 MB down to 7.5 MB, which is quite a slim down! This means the site-regular, site-default, site-beginner, site-languages, and site-classic now live in their own dedicated repos on ProcessWire’s GitHub. The site-blank one remains, but I've updated it a bit to make the template files more useful for beginners while still keeping it a blank profile. I may do a little more with it and rename it to be site-basic or something, and then have an even more trimmed down site-blank in its own repo as well. I'm not yet sure about that, so will do a little more with it next week also. I also went through each of these site profiles and cleaned up a few things, corrected old and outdated links, and updated a lot of text in readme files and such. I think a lot of the more experienced users would also prefer not having extra profiles included in the core as well. This update came at the request of the community a few months back (I think it was Robin S. that requested it, but not positive). It's not like any of the current site profiles have a lot of bling or marketing value, as they really are more just technical examples and starting points. So I think it's kind of a win/win to trim down the core in this way. Though maybe one day we'll have a site profile that looks good and has good marketing value. But until then I think we gain more by keeping the core size nice and trim. The downside is that there's a little more for new users to figure out (downloading a profile), so in the next week or so I'm planning to update the installer to hopefully lessen that issue and maybe even build in the ability for the installer to download and install site profiles from the modules directory. That comes with its own security considerations, so I'm not yet sure we'll go that far just yet, but it's one of a few options I'm looking at. Thanks for reading and have a great weekend!2 points
-
Sure, you can access it via WireHttp, but then your 120s limit will apply because it will be seen as a regular web request... $http = new WireHttp(); $http->get("https://your.site/your/url");2 points
-
You can bootstrap PW and create your own command line scripts that have full access to the PW API: https://processwire.com/docs/front-end/include/2 points
-
Hi @modifiedcontent It's better to stick to this feature https://processwire.com/blog/posts/processwire-core-updates-2.5.14/#multiple-templates-or-parents-for-users1 point
-
HELLO! I always struggle adding additional functionality, buttons and other settings to the CKeditor and I guess other people might have the same issue at times. For those who are CKeditor aces would you share your settings in this post to help others with what I guess should be a simple task to extend the default settings. Extra color select and text formating toolbar Format, Styles Bold, Italic, Underline, -, RemoveFormat TextColor, BGColor JustifyLeft , JustifyCenter, JustifyRight, JustifyBlock NumberedList, BulletedList, -, Blockquote PWLink, Unlink, Anchor PWImage, Table, HorizontalRule, SpecialChar PasteText, PasteFromWord Scayt, -, Sourcedialog extra allowed content small[*] section font[style] span[style]{!color} code[*] custom config options colorButton_colors: ec4626,ffde43,00aaeb,004a87,7b9320,ffffff extra plugins colorButton1 point
-
Only if you tell it to: https://curl.se/docs/manpage.html#-L You’ll also have to increase the maximum number: https://curl.se/docs/manpage.html#--max-redirs1 point
-
Thanks for your suggestion! In this case it's for something that runs on cron in the night and syncs a website property listing with third-party listing software. It takes a long time to run as it needs to copy images over HTTP and then resize some of them so when the website is accessed during the day it's a lot faster. Thanks for your suggestion though. I must admit I have never thought of doing it that way — it's a neat solution. If you run curl and then redirect via a session as you have done, does curl honour the redirect? I can't say I've never tried that but from when I have used curl in the command line I'm sure it just returns redirect headers, location, etc. I just thought maybe there was a way with the API and get a page's rendered HTML as opposed to as an object to force ProcessWire to run the task as it would if you visited it via a browser. I don't know, I thought maybe there'd be something like $pages->get('/path/to/page/')->render() that returns the page HTML. If so, from my command line script I could simply map the arguments to $_GET and also pass a path.1 point
-
1 point
-
Hello, @DrQuincy! I've noticed that you've used var_dump() for dumping variables. You can use TracyDebugger instead. It will allow you to work much faster: .1 point
-
Hi. Sorry about the short reply, but does the Permission “profil-edit” not do what you need out of the box?1 point
-
Found a solution based on @Fokke's solution from 2015. Adding the following in admin.php, before the line `require($config->paths->adminTemplates . 'controller.php');` gets me the behavior I needed; Settings only shows up for the SuperUser: function hideSettingsTab(HookEvent $event) { // Get the page being edited $page = $event->object->getPage(); if ( !wire('user')->isSuperuser() ) { $page->template->set('noSettings', 1); } } $wire->addHookBefore('ProcessPageEdit::buildForm', null, 'hideSettingsTab'); This solution is easy to adapt for whatever your needs are.1 point
-
Can't really explain why* this is such a great addition and change (at least for me) but that's just perfect! * I could but noone would believe me that there are areas in Germany with super slow internet connections. I'm super curious what happened to the new site-blank profile as it's almost always my starting point. Maybe we can even offer localized versions for Germany, Austria, Switzerland (page name settings like ä=ae, ö=oe, ü=ue, language packs pre-installed, and such). Let me ask this straight away... do you have something in mind, like the Kubrick demo setup for WordPress back in 2005? But for ProcessWire? A blog, with categories, pages, simple forms, tags, whatever. Maybe we as community could work together to build something like that. As well as in terms of design and even in basic content and best practice examples. Super minimal without any modules. Everything with just PW-Core functionality. I'd be on board for this adventure. What about offering multiple ZIPs as download options right away. Therefore maybe less hassle during installation - due to slow internet connections for example. On-demand download during a installation might be (at least for me sometimes in my hometown here) quite difficult and another source for "errors" the forum has to explain and clarify. starter.zip blank.zip core.zip and so on... All of the above are just thoughts... driven by great additions from @ryan.1 point
-
Version 1.1.0 is here. - added template edit link - added link for editing field in template context - using modals - style update: changed link icons, field name, tooltips, ...1 point
-
When I create a FieldtypeCombo using RockMigrations I get the following error when I try to add the combo to a page: PagesEditor: Error saving field "Options" — SQLSTATE[42S22]: Column not found: 1054 Unknown column 'i1' in 'field list' Here is the code I use to create the field: $this->rm()->createField('wrapper_options', 'FieldtypeCombo', [ 'tags' => self::TAG, 'label' => 'Options', 'flags' => '0', 'i1_label' => 'Tag Type', 'i1_name' => 'tag_type', 'i1_type' => 'Select', 'qty' => '4', 'hideWrap' => '0', 'collapsed' => '0', 'useColNames' => '0', 'modSchema' => '0', 'useDataCol' => '0', 'i1_options' => '+div section', 'i1_ok' => '1', 'i1_collapsed' => '0', 'i1_columnWidth' => '25', 'order' => '1,2,3,4', 'i2_label' => 'Background', 'i2_name' => 'background', 'i2_type' => 'Select', 'i2_options' => '+None Color Gradient Image', 'i2_ok' => '1', 'i2_collapsed' => '0', 'i2_columnWidth' => '25', 'i3_label' => 'Width', 'i3_name' => 'width', 'i3_type' => 'Select', 'i3_options' => '+Full Width Max Width', 'i3_ok' => '1', 'i3_collapsed' => '0', 'i3_columnWidth' => '25', 'i4_label' => 'Spacing', 'i4_name' => 'spacing', 'i4_type' => 'Select', 'i4_options' => '+Padding Margin', 'i4_ok' => '1', 'i4_collapsed' => '0', 'i4_columnWidth' => '25', ]); If I edit the field using the PW admin dashboard, and then save it, the problem goes away. I.e. the field is created properly in the database. Am I missing something when creating the field using RockMigrations? Thank you1 point
-
I fixed the problem by creating the field with the ComboField class. E.g. $f = new ComboField(); $f->type = $this->modules->get("FieldtypeCombo"); $f->name = 'heading_options'; $f->label = 'Options'; $f->addable = 1; $f->tags = self::TAG; $f->i1_label = 'Class'; $f->i1_name = 'class'; $f->i1_type = 'Select'; $f->i1_ok = '1'; $f->i1_collapsed = '0'; $f->i1_columnWidth = '50'; $f->i1_options = '+heading-copy=Copy heading-secondary--a=Secondary A heading-secondary--b=Secondary B'; $f->save(); $this->rm()->getField('heading_options')->save();1 point
-
Hi all, Not sure what is happening on my localhost website, but I cant seem to load the css / js files. The files are grabbed via $config->urls->templates?> and are relative url's. But for whatever reason instead of loading http://localhost/etc... Chrome is loading them on https://localhost (http vs https). The page itself is loaded via http://localhost so all setting in htaccess should be fine. What I do already: - Empty cach and hard reload. - Sifted through the htaccess -Added localhost to config->http - Went to chrome://net-internals/#hsts and delete localhost Any options you could think of that would solve this issue? Many thanks!1 point
-
SOLVED: I had a rough .htaccess file in my site folder that forced a https redirect...1 point
-
Thanks @Sebi - things are working for me properly now on PHP8. No rush on this, but I would like to raise @kongondo's suggestion of using PW's new URL path hooks (https://processwire.com/blog/posts/pw-3.0.173/#introducing-url-path-hooks) instead of the PageNotFound hook. I am not sure how much work it would be to change to this approach, but when I noticed the PHP8 issues in this module, I actually ended up creating my API via URL path hooks and it was really easy to implement with very little code. Obviously your module is going to be awesome for handling multiple APIs, multiple api keys, revoking access, etc, etc, so I will probably switch to it now, but it would be nice to not rely on that PageNotFound hook, because a lot of modules are using that and as well as feeling hacky, I feel like there are bound to be conflicts at some point with different modules and the order in which they are executed.1 point
-
I took @bcartier's code from this post and made a configurable module from it. EDIT: to make it work, you need to follow 2 steps (thanks to @PWaddict for pointing it out): Add a page name to the default language on the Home page On Languages Support - Page Names module at "Default language homepage URL is same as root URL?" select "No - Root URL performs a redirect to: /name/" You can find the module attached. I can confirm that the redirection to a non-default language works on PW 3.0.172 DefaultFrontendLanguage.zip1 point
-
@ryan - sorry to keep hassling, but I am wondering about your thoughts on my idea for a referencesRaw() type method. You gave my suggestion a like, so I hope it's on your roadmap. It will be invaluable to me now that we have support for getting the URL with "raw" finds. As an aside, would it actually make more sense to add a "references" selector to find() / findRaw(), eg: $pages-findRaw('references=1234')1 point
-
@ryan - what do you think about having a referencesRaw() page method. If you're outputting a long list of pages referenced to another page, often all you need are the title and url field values. As an example, I am outputting a list of publications for a staff member. I believe this would really speed things up. Thanks for considering.1 point
-
Can you compare my settings to yours, because in my case it works well. I have my JS custom file located in the folder "ckeditor". Path to the JS-file entered in the input: mystyles:/site/templates/ckeditor/mystyles.js and in the mystyles.js I have fe UIKit styles like these: CKEDITOR.stylesSet.add( 'mystyles', [ { name: 'Inline Code', element: 'code' }, { name: 'Inline Quotation', element: 'q' }, { name: 'Bild links', element: 'img', attributes: { 'class': 'align_left' } }, { name: 'Bild rechts', element: 'img', attributes: { 'class': 'align_right' } }, { name: 'Bild zentriert', element: 'img', attributes: { 'class': 'align_center' } }, { name: 'Small', element: 'small' }, { name: 'Text durchstreichen', element: 'del' }, { name: 'Inserted Text', element: 'ins' }, { name: 'Cited Work', element: 'cite' }, { name: 'Highlight', element: 'mark' }, { name: 'Einfügen', element: 'ins' }, { name: 'Sample', element: 'samp' }, /* Uikit headlines */ { name: 'unterstrichen', element: 'h3', attributes: { 'class': 'uk-heading-divider' } }, { name: 'Linie in der Mitte', element: 'h', attributes: { 'class': 'uk-heading-line' } }, { name: 'Kugel am Anfang', element: 'h', attributes: { 'class': 'uk-heading-bullet' } }, /* Uikit paragraphs */ { name: 'Kleine Schrift', element: 'p', attributes: { 'class': 'uk-text-small' } }, { name: 'Große Schrift', element: 'p', attributes: { 'class': 'uk-text-large' } }, { name: 'Nur Kleinbuchstaben', element: 'p', attributes: { 'class': 'uk-text-lowercase' } }, { name: 'Nur Großbuchstaben', element: 'p', attributes: { 'class': 'uk-text-uppercase' } }, { name: 'Erster Buchstabe groß', element: 'p', attributes: { 'class': 'uk-text-capitalize' } }, { name: 'Farbe: gedämpft', element: 'p', attributes: { 'class': 'uk-text-muted' } }, { name: 'Farbe: Primär', element: 'p', attributes: { 'class': 'uk-text-primary' } }, { name: 'Farbe: Erfolg', element: 'p', attributes: { 'class': 'uk-text-success' } }, { name: 'Farbe: Warnung', element: 'p', attributes: { 'class': 'uk-text-warning' } }, { name: 'Farbe: Gefahr', element: 'p', attributes: { 'class': 'uk-text-danger' } }, /* ul classes */ { name: 'Liste mit Kugel', element: 'ul', attributes: { 'class': 'uk-list uk-list-bullet'}}, { name: 'Liste mit Linie', element: 'ul', attributes: { 'class': 'uk-list uk-list-divide'}} ] ); Here is a screen shot of the custom styles dropdown: So in my case I didnt find it difficult to add styles1 point
-
Hey @flydev would love someone to add this as im very much confused about how to edit the CKeditor well, I usaully hack it abit till it works1 point