-
Posts
2,766 -
Joined
-
Last visited
-
Days Won
40
Everything posted by Macrura
-
bug addHookAfter and image drag/drop on repeater causing issues
Macrura replied to a-ok's topic in General Support
cool that you found the selectize inputfield.. hope it works well and let me know if you run into any issues or requests. In combination with the custom PHP option it opens up to almost anything.. hope to be releasing an ajax version sometime in future.. -
you mean so around line 132 changing like this: switch ($info['http_code']) { case 200: //return true; // Can't set int for number sent, since Mailgun doesn't return that data return 1; // this instead ? break; ...
-
I'm working on converting a site from WireMailSMTP + Mandrill to using Mailgun. In case anyone else needs to do this i'm posting the steps and snafus here. So far in adapting the existing code, the differences i have logged so far are; 1.) in WireMailSMTP you have to set sendSingle(true) if you want the messages to each be sent individually, but this is the default for WireMailMailgun, so that call gets removed. 2.) the method for adding attachments differs: this: $mail->attachment(string $filepath); becomes this: $mail->addAttachment(string $filepath); 3.) If your site sends from different domains, then you need to switch that setting before send. It appears to me that the API key is the same for all my domains, so I should only need to change the one setting when i send the email assuming i have already entered the API key in the WireMailMailgun module settings, then i can extract the domain of sending email address and set the domain to that (and also assuming I have all of those domains configured in Mailgun). $domain = substr(strrchr($identity->email, "@"), 1); $mail->setDomainName($domain); *** This doesn't actually work because the runtime setting is not overriding the domain that is set in the ___send() options. *** I made modifications to the module and now i have this working with my system; would probably need another setting like "match "sending domain" to "from email" domain" or something and also make the domain field optional in the module settings.. https://github.com/plauclair/WireMailMailgun/issues/7 ------------------------------------------------------------------------------------------------------------ Additional comments and observations: - would also be nice if an attachment() method could simply be added which aliases the other method (would save some code checks)
-
it wouldn't work with Selectize.js because the fields select there is a special ASM select with nestable ability for the fieldsets. I think the only way would be enable the field itself to have an option of autocomplete. The ideal way would be not to have automcomplete, but instead to have a search filter, because i think most of the time you do want to see all the options, but still be able to find what you want by typing.
-
ok thanks!
-
One issue I ran into today was a clash of Ace editors (using latest Tracy) i have ace editors on my InputfieldSelectize module, as well as any field that uses that AceExtended inputfield; seems that i need to disable the tracy console panel to prevent it from affecting the Ace instance. These 2 files are not loading: /site/modules/TracyDebugger/ace-editor/theme-monokai.js /site/modules/TracyDebugger/ace-editor/worker-javascript.js And getting this error: NetworkError: Failed to load worker script at "/site/modules/TracyDebugger/ace-editor/worker-javascript.js"
-
PW 3.0.22: Several upgrades and optimizations
Macrura replied to ryan's topic in News & Announcements
Cool - thanks! i seem to be clueless on how to do this default data but will check out some other modules and see if i can hack it... in terms of the InputfieldSelectize i think it will be good though to provide the base code to select pages using their title only so then as you say the inputfield will at least be usable out of the box. -
@psy thanks for this - nicely done, and looking forward to using this. You should probably remove the closing PHP tags, per the style guide: https://processwire.com/api/coding-style-guide/
-
PW 3.0.22: Several upgrades and optimizations
Macrura replied to ryan's topic in News & Announcements
Hi Ryan, yes(!), just tested and that appears to be the culprit. I guess i should at least set those default values in the module as you mention, as i'd like to "the right way" -
i think the ace is an awesome addition, and can't see why anyone would want plain text.. i'm ok with having the ace in for Tracy, as it could be tricky to handle if someone doesn't have it, and since you only need PHP that makes the requirements less. Adding a config to deal with the big Ace could make things overly complex. Snippets manager would be great!
-
Just a heads up that the newest version (ProcessWire 3.0.22 devns) breaks some things, one of which is module settings fields on some modules, this being one of them (the Placeholder Text field will not save any value). (Still looking into the cause and hope to discover fix soon as it also affects my inputfield modules). **This is now fixed in 3.0.23 devns**
-
PW 3.0.22: Several upgrades and optimizations
Macrura replied to ryan's topic in News & Announcements
Thanks as always for this! One problem though that I encountered was that the new version (.22) broke my custom inputfield (InputfieldSelectize), the inputfield seemed to no longer save or load the strings that define the array and option/items markup and then that caused all pages using that to break. is there something that would prevent either storing or loading data into those settings fields (??) Update: The module config data (for each field) is saved to the database, but is not being loaded into the field editor fields when the page renders. This happens on the following modules tested so far: Inputfield Chosen Select Inputfield Selectize Selectize Template & Field Tags if anyone has any clues how to fix this, would be appreciated! I spent some time to look at this but sort of striking out at this stage... -
great - thanks for the report; what i like about php.js (which i guess is now Locutus) was being able to grab a function when/where needed from there and pop it right into a project's main.js file and thanks for those references to Lodash and lazy.js, just took a look over at those sites...
-
cool thanks - yeah this has become indispensable on around 4 big sites at the moment
-
The module should show up in the directory in a few days. In the meantime, some small fixes and optimizations were made, such as fixed height editor window, and testing on both admin themes. At this time, the fullscreen, side-by-side editing only seems to work on the default theme; in Reno the editor goes behind the left menubar. If anyone has a quick CSS fix for this feel free to post, else i'll have a look at some point when i need to use that mode on reno
-
InputfieldSelectize A Inputfield to provide a select interface for Processwire CMS FieldtypePage using the (awesome) Selectize.js jQuery plugin, by Brian Reavis. Selectize: https://github.com/selectize/selectize.js Modules directory: http://modules.processwire.com/modules/inputfield-selectize/ Github: https://github.com/outflux3/InputfieldSelectize Features Custom designed options and items for any page select field. Your select options can use any field or subfield on the page, but also sub-subfields, or any data you provide, since you are not limited by tag replacement: you control the precise data supplied to the options using a PHP array that returns data to the module, which is in turn supplied in JSON to the select as adata-dataattribute. The plugin uses the JSON object for each option meaning you can do whatever you want with that data in designing your options/items. Each instance lets you define which fields are searchable for the select Your selects can use display logic based on the value of any field/data item, for example using ternery conditionals you can avoid empty parenthesis. You can design the options and items (what is seen once an option is selected) independently of each other. Therefore you could have special fields on the options for searching, but exclude those on the item. Likewise you can show elements on your item like an edit button which is not needed on the option. Multiselect pages are sortable, and deletable by backspace or optional remove button. When AceExtended editor is installed, the module will use that for the code input fields. Usage Install the Module Edit your pagefield and choose InputfieldSelectize as inputfield. You will see the empty fields that need to be populated to make this work Notes For examples of what you can do (in general) with your selects when using Selectize.js, view the plugin site at http://selectize.github.io/selectize.js/. The plugin theme is selected on the required JquerySelectize module ----- Examples Basic Example PHP (the data array for each item - this must return a plain array): $data = array( 'title' => $page->title, 'company' => $page->company_select ? $page->company_select->title : 'Not set', 'total' => count($page->recipients), 'editUrl' => $page->editUrl ); return $data; Javascript (item and option same) Here, the item.property each refer to the keys of the PHP array that you returned in the above field. This field must be a valid Javascript string with each of the properties you want to show as demonstrated below, and recommended to use the escape(item.property) syntax. These strings are passed to the render functions of the plugin. '<div class="item">' + '<span style="display:block;font-size:14px;font-weight:bold;">' + escape(item.title) + ' (' + escape(item.total) + ')</span>' + '<span>' + escape(item.company) + '</span>' + '</div>' Example screenshot: A more advanced example This example shows how to use conditionals for the PHP and JS to get the select options to look clean and provide the necessary information to assist users in choosing the correct options: PHP $data = array( 'title' => $page->title, 'year' => $page->year ?: $page->year_sort, 'for_inst' => $page->for_inst, 'edit_href' => $page->editUrl ); return $data; Item Javascript: '<div class="item">' + '<div style="color: black; font-size: 14px;"><span style="font-weight:bold;">' + escape(item.title) + ' (' + escape(item.year) + ')</span>' + ' <a class="pw-modal pw-modal-medium" href="' + escape(item.edit_href) + '">Edit <i class="fa fa-edit"></i></a></div>' + (item.for_inst ? '<div style="color:gray;">for ' + escape(item.for_inst) + '</div>' : '') + '</div>' Option Javascript: '<div class="item" style="width:100%;">' + '<div style="color: black; font-size: 14px;"><span style="font-weight:bold;">' + escape(item.title) + ' (' + escape(item.year) + ')</div>' + (item.for_inst ? '<div style="color:gray;">for ' + escape(item.for_inst) + '</div>' : '') + '</div>' Example with images In this example the selects will feature a thumbnail image: You could also set the width of the selected item to 100% depending on where you place the field (e.g. in a column) $image = $page->images->first(); $thumb = $image->size(100,100); $data = array( 'title' => $page->title, 'thumb_src' => $thumb ->url, 'img_dims' => $image->width . 'x' . $image->height, 'img_desc' => $image->description, 'img_size' => $image->filesizeStr, 'edit_src' => $page->editUrl ); return $data; '<div class="item" style="width:100%;">' + '<div class="image-wrapper" style="float:left;"><img src="' + escape(item.thumb_src) + '" alt=""></div>' + '<div class="info-wrapper" style="float:left; padding:5px;">' + '<span style="font-size:14px;font-weight:bold">' + escape(item.title) + '</span><br>' + '<span>Dimensions: ' + escape(item.img_dims) + 'px</span><br>' + '<span>Filesize: ' + escape(item.img_size) + '</span><br>' + '<span>' + escape(item.img_desc) + '</span><br>' + '<a class="pw-modal pw-modal-medium" href="' + escape(item.edit_src) + '">Edit <span class="ui-icon ui-icon-extlink"></span></a></div>' + '</div>' '<div class="item">' + '<div class="image-wrapper" style="float:left;"><img src="' + escape(item.thumb_src) + '" alt=""></div>' + '<div class="info-wrapper" style="float:left; padding:5px;">' + '<span style="font-size:14px;font-weight:bold">' + escape(item.title) + '</span><br>' + '</div>' + '</div>' Current Notes & Issues: Works with 3.0.23 devns Doesn't currently support creating new options (and may exhibit strange behavior if you try and add one not in the list) Doesn't yet support optgroups
-
cool - thanks, this works well! Now i just have to figure out how to update the sort on the pagetable for the parent page... Edit: was simple, just need to sort the pagetable field on the runtime/temp property... awesome
-
I have a property of a child page that runs through a custom function to get a sort of the pages (hex colors). assuming i can get the page ids of all of the child pages in the right order, is there any way i can run a script to sort these child pages (in the admin), they need to stay manual sort after the script runs so that the users can then make adjustments to the sort... Looked at some threads and the page sort function, but looks like it may require running a sql query to update that sort (?)
-
This topic will serve as the thread for the Selectize.js family of modules, which utilize this popular jQuery plugin for enhanced tagging of images, fields, templates and page selection in Processwire admin. http://selectize.github.io/selectize.js/ The modules will ultimately include: JquerySelectize Base module that provides the library for use by other modules Github: https://github.com/outflux3/JquerySelectize Modules: http://modules.processwire.com/modules/jquery-selectize/ ----- SelectizeTemplateFieldTags Uses the library to init the tags field on fields and templates, and makes the icon searchable by name. Github: https://github.com/outflux3/SelectizeTemplateFieldTags Modules: http://modules.processwire.com/modules/selectize-template-field-tags/ Screens: Tagging a template: *******sorry but the forum upgrade destroyed these images -- you need to click on them to see them now ******** Search icons by name and see the icon: ----- SelectizeImageTags Uses the library for image tags field. Github: https://github.com/outflux3/SelectizeImageTags Modules: http://modules.processwire.com/modules/selectize-image-tags/ Screen:
-
modifying $config property (e.g. siteSettings) from ready.php
Macrura replied to Macrura's topic in General Support
ok great, yeah i just changed to that and all appears to work fine... Will update the code above with the 'final' answer... -
modifying $config property (e.g. siteSettings) from ready.php
Macrura replied to Macrura's topic in General Support
I read through most of the replies here, and tried to analyze what the best way to improve upon the original post/request. So far this is the version working with devns branch; it is similar to the original method posted, but uses suggestions from Soma, tpr and LostKobrakai... $this->wire("config")->site = new WireData(); $st = $pages->get('/settings/')->settings_table; foreach($st as $row) { if(!$row->value) continue; if($row->disable == 1) continue; $thisKey = $row->setting; $this->wire("config")->site->$thisKey = $row->value; } This allows the site settings from the database to be accessible everywhere needed, and not have to init the array in config.php. The syntax is slightly cleaner/easier than using the array style. $this->wire('config')->site->pub_search_pattern; or in a template: $config->site->pub_search_pattern; -
yes - it autosaves it in local storage, which is why the module init would need to ID each field with it's page id and instance id... so by default the autosave is off (and probably not necessary)...
-
seems the init state does not show the lines/words counter - this is a documented issue with the plugin, see https://simplemde.com/ you can force it to update on load by enabling autosave; (adding these to the init call) autosave: { enabled: true, uniqueId: thisID, delay: 1000, }, spellChecker: false the plan is to make each instance individually configurable, but for now this is a very bare-bones implementation. i'm going to add those options to the js init, but maybe leave them commented out, and let users uncomment to disable spellcheck, and enable autosave; BTW - the autosave is interesting and works, not sure how useful it is or even if it makes sense in the context of a CMS. if it were to be enabled, additional configuration would be required to change the way it works so as to have a unique id for the page and the field though.
-
an unwanted button link shown on my custom Process module
Macrura replied to adrianmak's topic in General Support
head_button_clone (i think) -
Basic implementation of the Simple MDE as an Inputfield. https://simplemde.com/ Module developed in reply to request from @OrganizedFellow (https://processwire.com/talk/topic/13474-found-a-handy-js-based-markdown-editor/) Modules Directory: http://modules.processwire.com/modules/inputfield-simple-mde/ Github: https://github.com/outflux3/InputfieldSimpleMDE Editor example: Preview mode: Frontend output (using Markdown/Parsedown textformatter and Image Tags) Limitations etc: This has been tested with multiple instances on 1 page and seems to work fine. Toolbar is not configurable, but you can edit the JS file; In the spirit of keeping this simple, there are no module settings. If you want the spellchecker, you can enable it in the JS file. If is seems that there is a need for configurable instances, it could be added, but so far this works fine and can't see any reason to complicate it further.
- 37 replies
-
- 20
-