-
Posts
31 -
Joined
-
Last visited
Recent Profile Visitors
The recent visitors block is disabled and is not being shown to other users.
Bike's Achievements
Jr. Member (3/6)
0
Reputation
-
Hi, I am using this code to check if a repeater item, which has a couple of field, has one field with the same value multiple times. It works for textfields or checkboxes but not for the dropdown which I need: // Meldung bei doppelten Größen $wire->addHookBefore('Pages::save', function (HookEvent $event) { $page = $event->arguments(0); // Ersetze 'your_repeater_field' durch den Namen deines Repeaters $repeaterFieldName = 'groessen'; // Ersetze 'dropdown_field' durch den Namen deines Dropdown-Feldes im Repeater $dropdownFieldName = 'groesse'; // Prüfen, ob die Seite das Repeater-Feld hat if (!$page->template->hasField($repeaterFieldName)) return; // Werte aus dem Repeater sammeln $selectedValues = []; foreach ($page->$repeaterFieldName as $item) { $selectedValue = $item->dropdownFieldName; if (in_array($selectedValue, $selectedValues)) { // Fehler hinzufügen und Speichern verhindern $this->wire('session')->warning("Diese Größe existiert bereits!"); $event->replace = true; return; } $selectedValues[] = $selectedValue; } }); Can't figure it out! Thanks!
-
Hello everyone, I have the exact same issue right now. I'm just wondering where to put this piece of code?! Thanks for any help!
-
Hi everyone, another question concerning image behavior. Everytime I double click an image in CKEditor to adjust alignment, the image size is being resized according to my screen height which is fairly annoying. I'd like to keep that size at maximum. I could not find the right code segment where to deactivate this behavoir. I guess it must be somewhere in the CKEditor plugin code?! Can anyone help?
-
Thanks a lot @Zeka! This does the trick for me ?
-
Hi everyone, I insert images into a textarea where I keep their original upload size (about 1200px in width), so that when I eventually open them up on the page they will show up as large as possible in a lightbox. How can I achive that all images are output as a thumb in the first place? For image fields that I have control about I would use $img->size() but since everything is packed into that $page->body field I don't know how to get in there?! In the end I want something like: <a href="url_to_original.jpg" data-fancybox> <img src="url_to_thumb.jpg"> </a> That a-tag however I build around the image during output with some str_replace since I don't know how to do this in the right way either ? It works anyway but all that image-in-a-body thing is quite a mystery to me still. I'd be grateful for any help!
-
Hi @horst, I did check it but don't know how to achieve select fields with different content for each language. I think it actually must be something easy and common to do.
-
Sorry for bothering again but I still could not find any solution to this ? A clue anyone?
-
Thanks @Gideon So, I actually managed to get it working with a hook. Now I have another field that lists all items of a repeater field. It looks like this: Is there a way to change the appearance of that label which is showing that mysterious numbers? I'd like to have a simple numberation (since the repeater items have no titles). Do I have to change the hook code to achieve that? I have no clue ....
-
Thanks @Gideon So, but that's not working. That field doesn't accept variables like $page ... Here's what I'm talking about: Show children of that page only... I don't even know, if it's possible.
-
Hi everyone, I have pages each with a PageReference field. Now I need to set up a selector for that field to show only their child pages. It must be something like parent.id=1024 but without that fixed id. Or maybe I need a totally different selector? Does anyone unterstands? ?
-
Nobody? ?
-
Hi everbody, I still didn't find any solution for this problem though I think it might be something not too fancy. Looking for a select field (ASM too!) with language tabs. For each language there is not only a translation but an entirely different content. Ex: Select field "Publishers". Field holds different lists of publishers for each language EN / DE / ES. Or: ASM Select "Available as". Holds options such as "book", "ebook", "audiobook". Different selection possible for each language. In case I am not making it clear enough have a look at the pictures ?
-
It's been a while but I'm actually still looking for a solution... Is there a way to find all empty fields (even in repeaters)? The client doesn't want to click through each and every single field for translation whenever a new item has been created. ?
-
Change textarea formatting as CKEditor would do through API
Bike replied to Bike's topic in General Support
Thanks @wbmnfktr, seems to be the right track though I cannot get it working properly. Code is like: $options = array( // markup tags that are allowed. Example: "<br/><strong>" 'allowableTags' => '<p>', ); $p->text = $sanitizer->purify($data["comment"], $options); Other tags still appearing. Also I tried to use $markupHTMLPurifier as there are many more options such as br to p, remove emtpy p etc. which doesn't seem to be available in $sanitizer. But the function is unknown. Any clue? -
Hi everyone, currently I am transferring data from an old database to PW using the API. Textarea in old DB be like: <p>...</p><div dir="somecrappytags">i don't want that</div> Textarea in new DB, of course is exactly the same BUT: when I open and save that textarea in admin, CKEditor replaces all the divs with <p>, and that is what I do want! How can I achieve that formatting CKEditor does within the API? Like simulating open up and save the data in the admin to get rid of all those stupid tags and just keep the paragraphs? Is it sanitizer stuff?! Does anyone understand? ?