-
Posts
4,088 -
Joined
-
Last visited
-
Days Won
88
Everything posted by horst
-
[solved] Dynamically change the CKE BG-color in PageEditor?
horst replied to horst's topic in General Support
Ok, the culprit was that CKE needs some time on startup to dynamically create the iframes. Therefore all those tries running on document load failed. As a workaround I use setTimeout() with a delay of 1000 ms to start finding the iframes. Will look into CKE API, if there is something that can be queried that indicates ready loaded CKE and use this instead of my workaround. But for today I'm finished with work. ? -
[solved] Dynamically change the CKE BG-color in PageEditor?
horst replied to horst's topic in General Support
Ah, this seems to be better place to look: https://docs.ckeditor.com/ckeditor4/latest/api/CKEDITOR_dom_document.html#method-getBody EDIT: No, it only gets the dom elements from the edit page what is the parent page of the page in cke iframe. ? -
[solved] Dynamically change the CKE BG-color in PageEditor?
horst replied to horst's topic in General Support
Many thanks. I have tried a lot from SO links in the last past 2 hours. But all of them result in 'undefined' objects. In pW PageEditor, the CKE textarea is within an iframe, maybe that is the reason? -
Hi, how can I access the CKE background elemet via JS? I need to add / remove css classes to change the bg-color. Any hints are greatly appreciated.
-
@tpr, I have two questions, but don't bear with me, If I just have overseen the answers. ? 1) is there a shortkey (like ctrl+s) for "Save and Add New" available, or is it possible to add this as new feature? 2) Is there a way, (also a none public one*), to get the configuration exported out of one installation and imported into another one? * means, I'm also fine with it, to copy/paste parts from/to sql-dumps.
-
PageEditor, Children-Tab, possible to load children directly on open?
horst replied to horst's topic in General Support
Many thanks @Robin S and @adrian, finally I managed to find time and come back to this. Interestingly, I already was on the right track with my own first try ?: // JS in Markup to toggle the Tab-Url $markUp = wire('modules')->get('InputfieldMarkup'); ob_start(); ?> <script> function hnConfigureEditorChildrenTab() { document.location.replace('#ProcessPageEditChildren', '') + '#ProcessPageEditChildren'; //var dropDown = $('.pw-button-dropdown').children(); //console.log(dropDown); //dropDown.children().each().attr('style', 'display:none!important;'); } document.body.onload = hnConfigureEditorChildrenTab(); </script> <?php $markUp->value = ob_get_clean(); $form->append($markUp); The first JS line triggers a click on the tab too, by rewriting the location href with a newly added anchor. ? But it wasn't bullet proof. 20% the time, it doesn't work. So, many thanks for your solutions and the hint with the name-field! ------ Another issue I have in the wider context is, that I want to hide the save buttons on that template, because it only has informational character. // remove save button $saveButton = $form->children->get('id=submit_save'); $form->remove($saveButton); This results in removing the top-right placed button completly, but with some left over from the bottom-left placed button: ==> I'm not sure why it behvaes like this. Maybe it has to do with that there are two items with the same ID (submit_save) in the DOM? EDIT: I now solved it by injecting some styles, as targetting this by JS dindn't fully work. Maybe because AOS also targets the dropdowns when selected there "show on_hover instead on_click"? <style> #submit_save, #pw-dropdown-toggle-submit_save, #wrap_submit_save, #pw-dropdown-toggle-submit_save_copy, .pw-button-dropdown-wrap { display: none !important; } </style> Now my pages look as they should ? -
ProcessWire ApiGen (dynamic + up to date + all branches)
horst replied to kongondo's topic in API & Templates
Only dev branch. +1 -
PageEditor, Children-Tab, possible to load children directly on open?
horst replied to horst's topic in General Support
Many thanks, will look at it tomorrow and report back. -
PageEditor, Children-Tab, possible to load children directly on open?
horst replied to horst's topic in General Support
Thanks dragan. Will look there. This I have allready sloved with the help of forum tips: -
How can I change the Children-Tab in PageEditor to directly load the children, and not via Ajax, after clicking the tab label? I have a special need, where I have to remove all other tabs, only leaving the Children Tab visible. Normally, you have Content Tab displayed first, when opening a page in PageEditor. Then, when clicking the Children Tab, the children tree loads via Ajax. I need to change the behavior from within a hook in ready.php. Any hints are much appreciated. ?
-
ProcessWire ApiGen (dynamic + up to date + all branches)
horst replied to kongondo's topic in API & Templates
@netcarver, for me, the latest dev-branch is working, but all other are 404. http://kongondo.github.io/ProcessWireAPIGen/pw3dev/index.html EDIT: Uhm? Why I'm answereing this? - Believe me, before my answer, I couldn't see Adrians and your further posts. Something like a "One Hour Time Delay" with my internet connection? ? ? -
That would be perfect! ??
-
Hi @Alessio Dal Bianco, I saw that the LangPack last was updated in October 2016 in the modules section. Do you also have a newer one, supporting PW 3.0.+ ?
-
I'm too.
-
@ridgedale It is not that problematic if you use one of the modules that support maintenance mode. I would suggest to install a maintenance or page-protection module into all of your sites. And a module for easy cache flushing? (https://github.com/somatonic/ClearCacheAdmin) Then FTP-Upload the new wire folder to something like "wire.new". Backup all your site databases! Login into every site and enable maintenance mode. FTP-Rename wire to wire.old and wire.new to wire. Repeat for every site: a) reload page, b) use the ClearCacheAdmin and c) additionally clear the "modules-cache". See that every thing is running fine and disable maintenance mode. ?
-
@bernhard Using "droplets" seems to be very ugly and may lead into loosing control and render your PS unusable. If you really want to use PS on the serverside, you should use one of the PS scripting interfaces, depending on your platform: apple-script or VB-script, or you go with *.JSX. Oh wait, now after thinking of it a minute more, I think it isn't doable at all, as you ever only can run ONE instance of PS, not multiple. How do you want to handle multiple parallel requests? Waiting Queue? Also, if you opt for server side, I think this can be done with imagick or other CLI image libraries much faster.
-
wireshell - an extendable ProcessWire command line interface
horst replied to marcus's topic in API & Templates
Thanks for the clarification, now I know that I haven't overseen something. ? But wouldn't it be better to have an alias for the lates-dev version, something like: $ wireshell upgrade --latestdev Otherwise I have to look up every time, (sometimes multiple times a week), for the latest dev sha-key and copy paste it into my CLI. For example: As you can see, only one hour later than your post, the sha key to the latest dev has changed to: 637f81579e121af8ab4c4a12e21227b36ae0cd8a -
wireshell - an extendable ProcessWire command line interface
horst replied to marcus's topic in API & Templates
@justb3a or @marcus, maybe a dump question, but when I want to upgrade an existing wire core installation with the latest dev-version, do I need to pass a sha-key to the command? -
How is your multisite organized: One wire folder and multiple site folders? Or multiple wire and multiple site folders? Does every site has its own DB, or do they share one DB? What do you want to update, the sites or the wire folder(s)?
-
Bug or expected behaviour? Template & page same name?
horst replied to simonsays's topic in General Support
The one and only field in PW that is (really) required for every single item is a "name". The name must be unique! This is intended. ? -
Surely you are right. My explanation lacks correctness, as I implied a string conversion, derived from the example pwaddict has given. Thanks for chimimg in and corecct this. ?
-
it depends on the context. If OutputFormatting is off, $page->template returns the object, if OutputFormatting is on, it returns only the name.
-
? Not tested and not 100% sure, but you can remove one function: $files = glob("../dir/*.*"); $files = array_combine($files, array_map("filemtime", $files)); $latest_file = array_pop($files);
-
You don't need the URL, you also can use the filename, as the images are all in your webspace filesystem. $imagedir = $config->paths->templates . "images/"; To grab the latest imagefile, you have to read and compare file timestamps, like last modified. Check PHP functions for that and directory iteration: https://secure.php.net/manual/en/function.filemtime.php https://secure.php.net/manual/en/function.dir.php
-
$file->url returns only path but not filename??
horst replied to Gideon So's topic in API & Templates
single or multiple filefield? try $file->first()->url