
Cybermano
Members-
Posts
87 -
Joined
-
Last visited
-
Days Won
1
Everything posted by Cybermano
-
Thanks @monollonom, it looks very interesting. I will surely give a look and try.
-
Hi @bernhard, thanks for your explanations. I will made my best trying to follow those suggestions.
-
Thanks @bernhard in past I have used Cerberus as mentioned by @Jonathan Lahijani, but MJML is very awesome; expecially for the VScode extension with the html compiler. and preview. I think the template could be used directly in the wire mail construct, (without the ready hook): // ... $m->bodyHTML(wire()->files->render($layoutFile)); // ... Or do you think this is not a good practice? Now I'm testing it dynamically with "placeholders" : // get template $bodyHTML = wire()->files->render($layoutFile); // let's say we have 2 placeholders into the html template: one for user name as [[userName]] and one page body content as [[pageBody]] $bodyHTML = str_replace( ["[[userName]]","[[pageBody]]"], [ucfirst(wire('user')->name),$page->body], $bodyHTML, ); // ... $m->bodyHTML($bodyHTML); // ... This works for me: it has great potential. Many thanks again for sharing this solution.
-
Inputfieldtextarea: saved html table loses data attributes
Cybermano replied to Cybermano's topic in General Support
Hi @Gideon So, I'm back. I've tryed the RTE type, but they didn't fits for my needs: CKeditor cuts the table in the inputfield layout (instead to display my table with 100% and responsive classes), while TinyMCE didn't display anything. So I turned on the simply textarea. I'm still amazed by the different behavior for rendering the delayed output of the two kind of table in two inputfields of same kind and with same configuration: Case A I pass an AdminDataTableMarkup from a custom function by a variable ( $output .= ... ) and this table is rendered with right attributes (eg. the id) Case B I pass a custom html table in the same way, but no id is stored... (i need to pass id or other attributes as classes, with much more effort to pass right data to ajax calls and response actions). Only "cellpadding" and "cellspacing" remains. -
Inputfieldtextarea: saved html table loses data attributes
Cybermano replied to Cybermano's topic in General Support
Hi @Gideon So, thanks for your reply. Currently no RTE is setted: in past the same config didn’t broke the data attributes (but with AdminDataTableMarkup call, not simple html table tags). I will try to set almost one RTE and let you know. Many thanks in advance. -
Hi. I’m using an Inputfieldtextarea to store an html table in a page (admin side), populated by hook using custom markups (no AdminDataTables). This field is setted without textformatters, accepting html/markup content and with open and locked visibility (to render properly the html structure). In this table, all the data attributes of any tr/td (but also other tags such as a links or button, div etc.) are removed from the html and only classes remain in the code. Maybe I’m missing something, but I’m stuck with this behaviour. Anyone has any idea? I searched similar topics in the forum but with no luck… PS I would use data attributes to speed up js/ajax events and keep code cleaner.
-
Very cool! As for all the improvements. Big thanks to all! Maybe, could be this filtering setted into the parent template also for children fields/subfields? Like the override page label ( {fieldA} - {fieldB.subfield} - {title} ).
-
Hi everybody. I was playing with the @Macrura PrevNextTab module, (forking it); but actually I started from here, adding previuos and next action (with logics) to the Save button, as suggested a while ago by @bernhard. Every time I’m annoyed by the boaring "There is no editable next page to edit." after "Save + Next" click: so I decided to implement a "stop" when reached the last item (and same way for previous when reached the first one). This is the results for First and Last items dropdown menu of the Save button: I would like to share the code to put into ready.php, if somebody find it useful: Bye.
-
Hi @Macrura, thanks for this module. I have played a bit and found it useful, but at first time not very friendly. I try to explain... The Next/Prev links seems like to be in "loop" when at last/first items; I feel it quite unfriendly and not very helpful. When lot of siblings are present, it's difficult to understand if we are at the beginning or ending to stop editing/checking pages (for example, I find very annoying when you click on "Save + Next" and only then the message "There is no editable next page to edit." appears...) But your work is very intersting, so I tried to edit your code (I forked it from your repo and pulled a request). Basically, I think that if the next or prev page id is "0", so we can decide to hide the relative links and show First/Last, as needed. I added few code lines into your module to implement last and first placeholders and labels, new logics into .js file to check ajax response (ids and urls) and few rules into .css file. Also added a condition to hide links if only one items is present (so no navigation needed). Currently I tested all only in Tabs, and all works fine. Hope this could be helpful. I think I will try to insert also a link to parent page (just to complete a full nav "scheme"), and maybe to go further and finish the editin also for UI specific settings. PS This idea was initially born implementing new actions for Save and Next admin button (see here the post).
-
Hi @torf, thanks for sharing that.
-
Or maybe this edited code of your first post works? $map = $modules->get('MarkupLeafletMap'); echo $map->getLeafletMapHeaderLines(); $mappoints = new PageArray(); foreach ($page->map_repeater as $point) { $mappoints->add($point) // the repater is a page } echo $map->render($mappoints, 'your_map_field_name', array('height' => '270px')); ?>
-
Hi @torf, maybe I didn't get it at all or maybe I didn't explain well my idea. So I'll try again... 😉 Surely I could be wrong, but for me a PageArray is not only for admin side, but all the pw pages collected into a php variable created with pw selectors in a script file. For shortness I have created 2 pages with two repeaters each (repeater name is "multipoints"), with a title and a leaflet map field (named 'fm_mappa') into. This is the simply code for testing. Please note that I didn't get the repeater with a foreach statement, but with a pw search with a selector for all the templates with name equals to "repeater_NAMEOFTHEREPEATER", as pw builds. Obviously into your selector you can build your search to the desired points, e.g with sorting or something other. echo $pagesWithMultipointsRepeater = wire('pages')->find('template=repeater_multipoints'); if (count($pagesWithMultipointsRepeater)){ $map = $modules->get('MarkupLeafletMap'); $options = array( 'height' => 800, 'markerColour' => 'red', ); echo '<div class="g-mb-25">'; echo $map->render($pagesWithMultipointsRepeater,'fm_mappa',$options); echo '</div>'; } The numbers before the map are the repeater ids (note the "echo" on the first line of the code). And these are the admin pages: I hope that's clearer.
-
Hi @torf Never used Leaflet Map with repeaters, but in past I had to collect lot of points into a single map. I simply used a PageArray with wire('pages')-find('template=MY_TEMPLATE, and so on...') and then I passed the PageArray to the $map->render($MY_PAGE_ARRAY, 'MY_MAP_FIELD', $options); it works. So I suggest to collect your points in a PageArray with proper selectors. Don't forget that your repeater has a template, and if useful you can get the parents of them. Let me know if this solution can fit your needs.
-
Please, note that in the last linked repository your "jk_publish_until" field still has a "none" output format (instead of a [d-m-Y]), that causes a parsing date issue. Furthermore I found a little misunderstanding the unpublish description in scheduled plan if the page will be moved in new parent: this page will be remain unpubilshed? It seems no: the page will be unpublished from it's first parent, but it will remain published in the new one. So the page will not be unpublished at all. Or am I wrong?
-
Hi Juergen, thanks for your hard work: it sounds awesome and I will try it asap. As I understood, this module can operate on the single page when almost one date fields is setted. Right? Did you considered to perform a batch execution (always based on -a date and time) for all children of a page? Maybe based only to their template? Let’s imagine this scenario: A parent page (the main container) having lots of children (more than 1k created by formbuilder with a specific template) and some sub container (backup folders with another template, eg “backup”, so we can have subpages as “backup 2024”, “backup 2025” and so on). On your experience, do you think it could be possible to move the yearly formbuilder children into the relative backup (even setted by hand into module each year, not necessary programmatically) in one shot? Could be possible to have any execution time issue?
-
Hi everybody. I pull up this post for the same problem exporting/importing pages with Export/Import. I have the same template with same fields into two site ( let's call them "A" and "B") and same installation. Well, from site A to site B I can correctly export and import the pages. But the odd behaviour is that from site B to site A, after the import test performed correctly, the "Fatal Error: Uncaught Error: Call to a member function setLanguageValue() on null in wire/modules/LanguageSupport/FieldtypeTextLanguage.module:160 " occours on the import "commit". It seems that the PageTitleLanguage can't save the value: I find the created pages only with the name (url), but not the title (mandatory field)... Anybody has an idea? Many thanks in advance. P.S. line 160 in FieldtypeTextLanguage.module is in a foreach into the public function ___importValue(...) : $importValue->setLanguageValue($language->id, $languageValue); If it's important, but I dont't belive, into both sites the languages id are exactly the same (default = 1010, en = 1021). Also the fields have the same name. I can't explain why is "null" the $importValue, that is derived from line 156: $importValue = $page->get($field->name);
-
I would advice all you that the geocoder API is no longer accessible in the format of the current module. I have an error geocoding address and the return message from nominatim.openstreetmap is: Using the URL /search/ and /reverse/ (with slashes) is no longer supported. Change url from /search/?q=Berlin in /search?q=Berlin Also complete addresses are changed, see below: File not found: API no longer accessible via this URL Using the URL /search/ and /reverse/ (with slashes) is no longer supported. Please use URLs as given in the documentation. Examples how to change the URL: You use: https://nominatim.openstreetmap.org/search/?q=Berlin Change to: https://nominatim.openstreetmap.org/search?q=Berlin You use: https://nominatim.openstreetmap.org/search/US/Texas/Huston Change to: https://nominatim.openstreetmap.org/search?q=Huston, Texas, US See github issue #3134 for more details. See github issue #3134 for more details. Maybe editing ControlGeocoder.js fixes partially the problem? :343 L.Control.Geocoder.jsonp(this.options.serviceUrl + 'search/', L.extend({ change in L.Control.Geocoder.jsonp(this.options.serviceUrl + 'search', L.extend({ :370 L.Control.Geocoder.jsonp(this.options.serviceUrl + 'reverse/', L.extend({ change in L.Control.Geocoder.jsonp(this.options.serviceUrl + 'reverse', L.extend({ I have tested with simple addresses (italian street, number and city) ad it works fine again, both search and reverse. Posted a commit on Github: https://github.com/FriendsOfProcessWire/FieldtypeLeafletMapMarker/commit/63254dffea9bd504eb45b124d64fd5832e38f013
-
Hi there, I'm testing a static call with JS to set a new view of the map (I need it on event change without refreshing the page), as found on Github and Stackoverflow: // frontend var mymap = L.map($('#mleafletmap1')).setView([45.53, 10.21], 2); // backend var mymap = L.map($('#_Inputfield_fm_mappa_map')).setView([45.53, 10.21], 2); This produces a TypeError: t.className is undefined. I looking for a solution, but didn't found it (...and I'm not a skilled js coder). Does anybody have an idea?
-
Hi @Ivan Gretsky, thanks for your reply. I hope to create it asap. I will update you.
-
Hi, is there anybody that knows how to easly disable "scrollWheelZoom" on admin page editing? Or is there a "module/field" settings development plan for map options in admin? (an overrideble setting in the field options could be great). I find a little annoying the zooming in/out of the map on page scroll. At the moment I put manually a js line of code in InputfieldLeafletMapMarker.js after line 24 // line 24 var map = L.map(mapElement).setView([lat, lng], options.zoom); // new line map.scrollWheelZoom.disable(); But I'm not so happy to modify original modules... (on updates the modifications could be lose). The second approach that I have succesfully tested is to load a js file in admin, but it needs to completely initialize a new map, only with the add of an option in the declaration of the map init: var map = L.map('_Inputfield_fm_mappa_map', {center: [lat, lng], zoom: parseInt($('#_Inputfield_fm_mappa_zoom').val()), scrollWheelZoom: 0,} ); Any suggestions?
-
Hi to everybody and special thanks to @Mats for sharing this big porting, to @gebeer @netcarver @dab for the hard implementations and to @Ivan Gretsky to keep it alive again, but also to all the contributors and maintainers of this awesome module. I'm testing it and it works really fine and easy. I would try to add an extra class to the markers and I followed this linked tip to Leaflet.AwesomeMarker properties for the main page with all the markers: $options = array( 'useMarkerSettings' => true, 'markerFormatter' => function($page, $marker_options) { $marker_options['icon'] = $page->icon; // Override the default icon for this marker. $marker_options['markerColor'] = $page->color; // Override the default color for this marker. // Adding extra classes to this marker ?? $marker_options['extraClasses'] = 'music-stage'; // Or dynamically from an option field: $page->stage_kind->value return $marker_options; }, ... ); But as you can see from the screenshot below, no classes are added to the icon (there is a blank space instead between the classes into <i></i> tag; actually it's always present, with or without the 'extraClasses' index into $marker_options). Am I missing something? P.S. The JS correctly loads the object properties: mleafletmap1.addMarkerIcon(L.AwesomeMarkers.icon({prefix: 'fa', icon: 'music', markerColor: 'red', iconColor: 'white', extraClasses: 'music-stage'}) Basically it would be nice to add extra classes to the whole marker (not only to the icon) to manipulate it with js (eg. filtering by type/class on a triggered event such as a button click or select change, or hiding from page if an event date is passed, like for exibitions/music lives and so on). Does anybody have any suggestions to do this? Thanks in advance.
-
Hello, I'm back ... I spent a week of full immersion at work. I fixed the installation error (and pulled a request on GitHub). It was a bad condition in a public function. Sorry, I had missed it. P.S. Please, check your part of read.me (more or less, at line 14) ```<?php echo buildGoogleTranslateUrl('es');?>``` Do you mean calling the function from the module as: ```<?php echo $translate->buildGoogleTranslateUrl('es');?>```
-
Hi @JayGee, of course yes! Thanks for all and don't worry: you did well to take a break after a hard work. I am very happy to have been useful: as soon as I can I check the error in the front end, but as you said I think it is possible to avoid it by assigning default values during module init. I'll get back to you shortly! Bye!