-
Posts
4,088 -
Joined
-
Last visited
-
Days Won
88
Everything posted by horst
-
Hi, the use case is that I have a Profields Textareas inputfield with 3 subfields that I call A, B, C in the example. The user should have to fill in A & B, but not C. C is optional and only used in under 10% of all entries. Is it possible to define a requirement for selected subfields of inputfields without a hook? Or need I to use a hook for that? If yes, is there one other or better then Page::SaveReady? Any hint is appreciated. ?
-
So definitely it cannot be available in $config, because $"config is parsed before the engine gets started". Way before init is running and much way before ready! And most of the functionality only is available after (the engine is) ready! ?
-
Now it does. ? Here you go: https://github.com/horst-n/PageImageManipulator
-
Another candidate can be https://feathericons.com/ But when inspecting the svg code of the arrow-up in a circle from all three icon sets it comes out that they use very different number of chars: // Heroicons: 239 chars <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor"> <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 11l3-3m0 0l3 3m-3-3v8m0-13a9 9 0 110 18 9 9 0 010-18z" /> </svg> // Feather icons: 365 chars <svg xmlns="http://www.w3.org/2000/svg" class="feather feather-arrow-up-circle" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"> <circle cx="12" cy="12" r="10"></circle> <polyline points="16 12 12 8 8 12"></polyline> <line x1="12" y1="16" x2="12" y2="8"></line> </svg> // Tabler icons: 453 chars <svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-arrow-up-circle" width="44" height="44" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"> <path stroke="none" d="M0 0h24v24H0z" fill="none"/> <circle cx="12" cy="12" r="9" /> <line x1="12" y1="8" x2="8" y2="12" /> <line x1="12" y1="8" x2="12" y2="16" /> <line x1="16" y1="12" x2="12" y2="8" /> </svg> So in regard of file size and data compression the winner is Heroicons. The number of icons in Tabler is nearly 1000, Feather has 280 and Heroicons 220. And when it comes to design, ... well, thats purely personal opinion. ?
-
module PrivacyWire - Cookie Management & async external asset loading
horst replied to joshua's topic in Modules/Plugins
EDIT: found the problem! | orig. post -------------------------------------------------------------> I have a need to manually use the textformatters of VideoEmbed and PrivacyWire. As far as I understand it, it should be possible to do it with VieoEmbed first and PrivacyWire second. But it seems not to match with the video I tried. My code is: // A) $videoMarkup = "<p>{$blogitem->blog_video_url}</p>"; // B) $mod = wire('modules')->get('TextformatterVideoEmbed'); $mod->format($videoMarkup); // C) $mod = wire('modules')->get('TextformatterPrivacyWire'); $mod->format($videoMarkup); Debug outputs are: // A) array(1) { ["$videoMarkup"] string(49) " <p>https://youtu.be/XXXXXXXXXX</p> " } // B) array(2) { ["Textormatter"] object(ProcessWire\TextformatterVideoEmbed)#458 (1) { ["data"] array(7) { ["maxWidth"] int(640) ["maxHeight"] int(480) ["responsive"] int(1) ["rewind2start"] int(1) ["clearCache"] string(0) "" ["uninstall"] string(0) "" ["submit_save_module"] string(8) "Absenden" } } ["$videoMarkup"] string(492) " <div class='TextformatterVideoEmbed' style='position:relative;padding:30px 0 56.25% 0;height:0;overflow:hidden;'><iframe style='position:absolute;top:0;left:0;width:100%;height:100%;' width="640" height="360" src="https://www.youtube.com/embed/XXXXXXXXXX?feature=oembed" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe></div> " } // C) array(2) { ["Textormatter"] object(ProcessWire\TextformatterPrivacyWire)#491 (1) { ["data"] array(5) { ["open_tag"] string(2) "[[" ["close_tag"] string(2) "]]" ["video_category"] string(14) "external_media" ["uninstall"] string(0) "" ["submit_save_module"] string(8) "Absenden" } } ["$videoMarkup"] string(492) " <div class='TextformatterVideoEmbed' style='position:relative;padding:30px 0 56.25% 0;height:0;overflow:hidden;'><iframe style='position:absolute;top:0;left:0;width:100%;height:100%;' width="640" height="360" src="https://www.youtube.com/embed/XXXXXXXXXX?feature=oembed" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe></div> " } Is it wrong how I used it, or why isn't it working as expected, or where can I look into to find the reason? <------------------------------------------------------------ orig. post | EDIT: To answer my own question: "Yes I used it wrong!" ? // C) $mod = wire('modules')->get('TextformatterPrivacyWire'); $mod->format($videoMarkup); This was wrong. The TextformatterPrivacyWire module only supports the method ->formatValue(), not ->format(). The following line works and now the result is as expected: $mod->formatValue(new Page(), new Field(), $videoMarkup); So, just wondering why it not uses the format() method, because there seems no need for a page and a field? -
In the parent page you have to set the sorting to manually drag. DO NOT set any hard sort order there. Then you can use the add new childs first method from AOS. This results into the following behave: Everytime you add a new child to that parent page, it is added on top of the list, as first child under the parent. From there on, you can drag and sort this and all other pages manually as you like.
-
This is not a direct answer on the current problem, but shows a different method for using a custom var in different scopes: Instead of using a superglobal var it may also be possible to use ProcessWires Functions API with a custom var name. // initialize a custom var, maybe in your site/_init.php region('hannaCounter', 0); // later in your templates or modules or where ever, count up the counter region('hannaCounter', region('hannaCounter') + 1); // and where ever you need it, get the current (or final) counter value echo region('hannaCounter');
-
Are you using AOS? (AdminOnSteroids module) It enables to configure a lot in regard of CKE.
-
In template files I use the page-id to get the page or, where I have set a specific template name, I use this to get the page, and then uses the $p->url. There are different ways and concepts people uses. I prefer to give own template names to specific pages, limited to one page only, so that I securely can get them from everywhere, regardless what name a editor gives them, or if a site owner deletes a page and creates a new one (what changes the page id). In the templates settings I use the property for mapping a different template (render) file. So, for an unlimited number of basic-pages, 1 imprint page and 1 contact page I use 3 template names and one template file: template file is: site/templates/basic-page.php template names are: basic-page, can be used for (unlimited) new pages imprint, can be used only for one page and is mapped to basic-page (template file) contact, can be used only for one page and is mapped to basic-page (template file) But as already said, that's only my preferred way. ?
- 1 reply
-
- 2
-
-
Native Array of Objects to WireArray and WireData Objects
horst replied to Brian Scramlin's topic in API & Templates
Whats about creating an empty WireArray and then do the foreach loop on the $meevo_response_array? $meevo_response_array = json_decode( $meevo_response ); $reviews = new WireArray(); foreach($meevo_response_array as $meevo_response_item) { $tmp = new WireArray(); $tmp->import($meevo_response_item); $reviews->add($tmp); } https://processwire.com/api/ref/wire-array/add/ -
Parent page with children not showing Trash action.
horst replied to elabx's topic in General Support
No, looks fine. Exactly how I do it too most of the time. ? So, there must be something other interfere. Weird. -
Parent page with children not showing Trash action.
horst replied to elabx's topic in General Support
Do you have set any access settings or family settings between the parent and child page templates? -
PW does not process any real existing folder. You don't have to do anything for making it ignore them. That's the default behavior.
-
Hey, I found two vinyl albums of the group Tuxedomoon from the early eighties. If someone knows them and like to get them, please drop me a note. (for the shipping cost) 1) TUXEDOMOON - "Half Mute / Scream With a View", (1980) 2) TUXEDOMOON - "A thousand lives by pictures", (1983) 25 years back, I moved from Vinyls to CDs. Over the years I gave away all vinyls, only kept a number of around 50 pieces that I initially wanted to digitize. But I do not hear this music any more and never missed it. Also there were some more or less rare vinyls I really digitized, maybe 10 albums, but for all others it definetly is to much work. ?
-
- 2
-
-
What is about starting at early state without that feature? Just with the possibility or limitation to use it for new (empty) projects? Who has said this: "Release early and often"? Don't remember. And yes, I know, there are not only pros with this strategy. ?
-
? ? ? ???? ?? ????????? ?♂️?♂️??♂️?♂️?♂️?♂️
-
+1 ?
-
imagecolorsforindex(): Argument #2 ($color) is out of range
horst replied to adrian's topic in General Support
Hi @adrian, this is very old legacy code from before 2013 when I joined PW, - and it is from a community member named "mrx": https://github.com/processwire/processwire/blob/master/wire/core/ImageSizerEngineGD.php#L863 So, the referenced SO post seems to be the solution already. Maybe you can send me an image that has this error, so that I can test it. Or would you like to write and test the fix yourself? (As you already have done all necessary work.) ? -
You need to create enough rows and columns, and span your contents, I believe. See Jen Simmons here:
-
It works when used via JS AJAX calls in (static) HTML (ProCache)pages.
-
module PrivacyWire - Cookie Management & async external asset loading
horst replied to joshua's topic in Modules/Plugins
As far as I know, you only can store strings in localStorage. So, without having a look into the code, I know it is common usage to stringify objects before writing them into localStorage, and to JSON.parse() them after retrieving from it. Just try something like this: var obj = JSON.parse(window.localStorage.getItem('privacyWire')); -
According to the bureau of the Datenschutzbeauftragte of NRW, germany: If you (self)host Matomo on the same domain or subdomain with anonymized IPs, you can start to use it without opt-in, regardless if cookie-less or a use with cookies. Only thing you must provide and respect is a opt-out option. Don't know if this is different in other Bundesländer of germany, but I have gotten a written answer with the above content from the NRW-bureau. ?
-
Yes, I remember that there were some core updates has to be made between PHP 7.2 - 7.4.This must have been somewhere at PW version 3.0.98 ? or 3.0.128 ?, don't remember exactly, but the PW core 2.7 does not have these changes! Why do you not want to upgrade to PW 3? From PW 2.7 to PW 3 is to 97.5 % just switching the wire folder! And another question in this regard: are you sure that your site profile code is PHP 7.4 ready? ?
-
EXIF data is stripped out with every processing function that uses GD-lib. So, if you just use creating a 100% width "variation" and store it as the "new" original image, all your EXIF data is lost. (GD-lib simply does not keep any image markers by design. Historically it was build to create small images for the web, and everything that may bloat filesize is dropped) PW every time reads the EXIF data from the original image that regularly will be kept untouched.