Jump to content

Macrura

PW-Moderators
  • Posts

    2,766
  • Joined

  • Last visited

  • Days Won

    40

Everything posted by Macrura

  1. ok great, i'm hoping to test the changes and push the update to the module next week..
  2. the way this module works is that the json is attached to each option; you could use a plain selectize init on your inputfield select, i do that a lot and it works well... using something like a hook in ready or admin custom files...
  3. To answer the first question, can you try the attached module and let me know if it works; You need to use the new method addBlankOption(); which will then add the correct data-data attribute to the option in case you want to use something like 'Please Select...'; $f->addBlankOption(); or $f->addBlankOption('Please Select...'); This is really only necessary when using from the API because in page edit context i think the default behavior works; this does allow you to use this inputfield in modules which is cool, and have a blank option; needs more work though since the blank option json in data-data attribute will need to match the other options.. might be some time till that part is solved, but this should work for now.. InputfieldSelectize.module
  4. ok thanks - will look into it asap - it is because the module is using the addOption() method which is filtering out the items with no value, guess this needs to be fixed... Edit : testing here and it seems to be working correctly - i'm not seeing the empty option filtering out - can you tell me more about the settings on the inputfield is it set to single (not multiple pages?)
  5. Hi Sipho - ok i'm not sure how the required works for single input, when you look at the source, is the source code showing the first option selected (the pw source <select> element? If that's the case then the required behavior of the field is inheriting from PW, i don't think the JS can affect that..
  6. speaking of download icons – there is a (probably not used much, but nonetheless awesome) module called Secure File - for that module, the download button doesn't work, i guess AOS is not compatible with that module; I disabled the "Add Asset Download Button", since that module already provides a download link for the file. Just wanted to post that here in case someone else uses secure file and comes across the non-working download (if they have AOS add asset download enabled)...
  7. The way i see Gantry is like a really developed 'frontend api', which seems to use an mvc-ish model; I use a frontend api based on the wireRender pattern which is in some way similar to the Gantry setup. In PW, it could be done, you'd end up with several interconnected modules that simplify frontend needs, like global settings, managing per-page assets, injecting stuff (js, schema, meta etc) into the head.. There are already some frontend api modules now like Spex; For just having a styles guide page, that would be easy, you could just have a pure html page showing all of the demo stylings, sections, shortcodes and whatever; or have a hardcoded demo site on a subdomain for the clients to reference.
  8. @adrian - ok thanks, that's good to know; Not sure what could be the cause of this, it happened on some 2.7.3 sites, as well as some 3.x sites. Overall Site5 has been good in terms of speed, uptime and reliability; i submitted a support ticket regarding this issue but never really got any answer as to why it could happen... This is the error that happens to the editors when they save, if the table crashes.. SQLSTATE[HY000]: General error: 145 Table './database_name/field_body' is marked as crashed and should be repaired (in /wire/core/WireDatabasePDO.php line 454)
  9. I encountered a situation over the past few months where tables have been crashing when a user saves a page in PW. I'm assuming it is something related to the server/hosting provider (Site5), because it only happens on this host, but across completely different unrelated accounts. When it happens the table in question gets "marked as crashed", and then shows "in use" when you see the table in PHPMyAdmin. No data is retrievable by PW from whichever table/field is crashed, so if the body table crashes, then the front end doesn't show any body text anymore until someone goes into PHPMyAdmin and repairs the table. I'm trying to make a module or at least some button the client can click from their admin that will run a repair on the tables so i don't have to help them and go to their cPanel etc.. I added a button on the dashboard of the sites in question (for sites that i use a dashboard on), or i told them to bookmark the link to the repair process, something like example.com/repair_database.php?action=repair; so far it seems to work but wanted to check to see if anyone sees any problems or improvements to this, it was done in only a few minutes, so may have left out something... I'm not sure if this could/should be made into a module, since it is conceivable that a table could crash that would render the modules system non functional, so thought maybe better to be a bootstrapped script(?) <?php // in root of pw installation - this is the 3.0+ version; repair_database.php /* Bootstrap PW ----------------------------------------- */ include("/home/path/to/index.php"); $config = \ProcessWire\wire('config'); $user = \ProcessWire\wire('user'); if(!$user->isLoggedin()) die("access denied"); function optimizeTables() { $tables = array(); $db = \ProcessWire\wire('db'); $result = $db->query("SHOW TABLES"); while ($row = $result->fetch_assoc()) { $tables[] = array_shift($row); } foreach ($tables as $table) { $result = $db->query("OPTIMIZE TABLE `$table`"); while ($row = $result->fetch_assoc()) { echo $row['Table'] . ': ' . $row['Msg_text'] . "<br /> \n"; } } } function repairTables() { $tables = array(); $db = \ProcessWire\wire('db'); $result = $db->query("SHOW TABLES"); while ($row = $result->fetch_assoc()) { $tables[] = array_shift($row); } foreach ($tables as $table) { $result = $db->query("REPAIR TABLE `$table`"); while ($row = $result->fetch_assoc()) { echo $row['Table'] . ': ' . $row['Msg_text'] . "<br /> \n"; } } } ?> <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <title>Database Repair &amp; Optimize Tool</title> </head> <body> <pre> ____ _ ____ __ __ / __ \___ ____ ____ _(_)____ / __ \____ _/ /_____ _/ /_ ____ _________ / /_/ / _ \/ __ \/ __ `/ / ___/ / / / / __ `/ __/ __ `/ __ \/ __ `/ ___/ _ \ / _, _/ __/ /_/ / /_/ / / / / /_/ / /_/ / /_/ /_/ / /_/ / /_/ (__ ) __/ /_/ |_|\___/ .___/\__,_/_/_/ /_____/\__,_/\__/\__,_/_.___/\__,_/____/\___/ /_/ </pre> <?php if($input->action == 'repair') { repairTables(); } if($input->action == 'optimize') { optimizeTables(); } ?> </body> </html> example button:
  10. Also consider InputfieldSelectizeMultiple, it can support any complex markup for the select items, and any field, subfield, sub-subfield etc..
  11. sorry, my first reply was a mistake, thought i edited it, but instead added a 2nd reply - the first reply only fixes the z-index issue; in terms of why the tags all vanish, it must be something with the JS init; for any sites in production, i have now switched over to use the module, and it works fine, and fixes both the vanishing tags and the z-index; depending on how you use image tagging you should be able to seamlessly switch between core tagging and module tagging, as long as you don't use the label/value pairs that the module features. At this stage the differences can be summed up: | Feature | Core | Module | |---------------------------|------|--------| | Label/Value Pairs Support | N | Y | | Z-index problem | Y | N | | Template context support | N | Y | | Tags vanish on upload | Y | N |
  12. that's actually inside the comment header, in case i need to put it back
  13. I think this has to do with how the core inits the field on reloaded, the module does it differently (thanks to @Robin S) and the tags remain in place.
  14. @matjazp you can add those to your AdminCustomFiles, or use the SelectizeImageTags module which has the fix built in; not sure what other ramifications of these CSS overrides are, but so far they work and i haven't seen any issues, but they do override core CSS styling on the image field.
  15. looks like the modules directory isn't parsing or understanding the info file: "requires_versions":{"":[">=",0]} http://modules.processwire.com/export-json/SelectizeImageTags/?apikey=pw300 i probably need change something in that <modulename>info.php, since the $config check needs to check the target site, not the modules website, in case the engine that creates that json page is PW..
  16. it definitely works overall (when the module is already in the modules dir), but can't figure out why it fails on the upgrades download, the requires numbers look messed up...
  17. ok thanks - yeah i moved the module info into the <modulename>.info.php field and in there i add the module requires to the array by checking the config->version; maybe there is something wrong with how i'm doing that... $info = array( 'title' => 'Selectize Image Tags', 'author' => 'Macrura', 'version' => 007, 'summary' => 'Admin helper for enabling selectize.js on images tags field.', 'href' => '', 'icon' => 'tags', 'singular' => true, 'autoload' => 'template=admin', 'requires' => array( 'ProcessWire>=3.0.61' ) ); if($this->wire('config')->version < '3.0.67') { $info['requires'][] = "JquerySelectize"; } *Btw - i do have that module (JquerySelectize) also installed anyway, in case that matters..
  18. @Robin S i'm having some trouble with the upgrade on this, not sure what's going on, maybe related to the upgrade method? this is on 3.0.70, so it should meet the requirements... i'll try removing the upgrade function and see if the mod requirement works
  19. Is anyone seeing a problem with the new image tags, where all of the image or file tags disappear when you upload a new item? Its happening to me on 3.0.70 on file and image fields. Thankfully the tags do not get removed from the items, but they all become invisible when you add an image or file. I'm guessing the core InputfieldFile is reloading the field after upload but the selectized fields are maybe not set to reinit on reloaded ? Here is a GIF of the behavior when using core selectize image tags: Here is it working correctly, using the module init of the field (same core selectize version)
  20. looks like adding new pages to the field should just be a matter of adding 2 selectors in the page field edit links module, so that it can be inclusive/aware of Selectize inputfield.
  21. it should be possible to re-init the selectize page select when the pw-modal closes, in terms of creating a new page; i will have to look at how the page select edit links does it, because thetuningspoon did most of the module... Also - be careful with the editUrl if you upgrade PW past 3.0.66- there seems to be a problem when there is an anchor inside the option/item that interferes with displaying the remove button; i have not figured it out yet what the problem is there but am actively investigating it - created github issue and posted topic on the 3.0.67 topic; EDIT - seems that maybe there is no problem, my test environment shows the remove button fine when using core version of lib...
  22. sure – let me know if you run into any issues, as that new version utilizes the core selectize library;
×
×
  • Create New...