Jump to content

Macrura

PW-Moderators
  • Posts

    2,771
  • Joined

  • Last visited

  • Days Won

    40

Everything posted by Macrura

  1. Hi Krlos - thanks - I believe the module does support multilanguage, and we had added support for that a few years ago. I know there is probably no example of how to set a multilanguage field in the samples, but AFAIK it should work if you get the JSON or PHP setup to tell it the various language parameters.
  2. @999design - what error are you getting? The template you use for the custom admin page just needs to return markup; but it does have access to the api. it won't work if you are trying to render a page edit, for example.
  3. I think if you want to use the isChanged() method, you first have to enable change tracking: https://processwire.com/api/ref/wire/track-changes/ https://processwire.com/api/ref/wire/is-changed/ Sanitization added on all of the img attrs is something that would improve the module, thanks for the report...I'll try and add that soon. In terms of timeouts, when you're doing your own PHP import scripts, you usually need to come up with a way to do it in batches, and use some condition to skip already processed pages, like if count($page->images), which would presumably be 0 if the page wasn't processed yet. I seem to recall using this on at least 1 site that had content imported from Joomla...
  4. @Pretobrazza i think you probably need to try one more time using the module api and see if it works; if that doesn't work then maybe you can post some of the markup that has the image references and i can try and test to see if it is caused by the attributes..
  5. @Pretobrazza - thanks, so i found the issue regarding your error; there is some redundancy of code in this module between the api and textformatter which should be fixed at some point by creating another method for strictly processing images. In the meantime I added the check to prevent it processing the width attr if there is a percent, when using the module's api. I don't know if this will fix the issue of the images not importing though, probably worth a try and see if you hit any other errors.
  6. Hi @Pretobrazza - generally this always works, i haven't run into any issues, and it should still be working on many current sites. Have you confirmed that it's basically down to the hook not running? If you are using Tracy Debugger you can go into the module and check by putting a bd('test) into the method that is hooked on save (importExternalImages($event)); But if you are running your own script, you can also just use the module's API, by doing this: $p = $pages->get(2356); $m = $modules->get('ImportExternalImages'); try { foreach($p->children as $c) $m->importImages($c); } catch (Exception $e) { echo $e->getMessage(); }
  7. @Pretobrazza - Hi Bernard - So assuming that there are image references in body field, and you have done the relevant settings, the next thing to see is where it might be failing. Could you try and see what happens if you save the specific field, as in $c->save("body"), and see if that works? Else i may need to do some testing and try and replicate your setup. - Marc
  8. those should be replacing with the corresponding ID3 tag - title, composer, artist, album and track. So if you're not using ID3, then you'd just use the file description field...
  9. you could just do $playlist->add for non iterable. https://processwire.com/api/ref/wire-array/add/
  10. @protro You just need to make sure to pass the files array to the player() method, so your code won't work because you don't have audio on the $page. $page is always the current page; You can reference the other page using $pages->get([pageid]); You can also make your own array of files by creating a WireArray and then adding your audio files to that and then pass the WireArray to the player() method. Based on your description, first you have to get the page array for the playlist, $songPages = $pages->get(/path/to/playlist/parent or Page ID)->children; Then iterate the child pages, adding the audio file from each: $audioFiles = WireArray new(); foreach($songPages as $songPage) { $audioFiles->import($songPage->audio); // if a single audio file field, then $audioFiles-add($songPage->audio); } echo $sm2->player($audioFiles, $options);
  11. @protro (1) the way the tag field would work is if you had a page somewhere holding a whole bunch of audio files, and you had a page reference field on that page named "media_tags", and you added a "tag" (page reference) to that field, say using like ASM select, and the tag was called "Sunday", then you would use the playlist tag, like [smplaylist tag=Sunday], in a textarea or text field, then it is supposed to output that whole playlist. (2) To get the players to output in your scenario, all you would need to do is echo $page->tag_audio. Because you need to echo the field holding the shortcode, so that will initiate the processShortCode() method. You don't need to use the shortcode though - especially in how you have it setup. The shortcode is really for putting players inside other content, like long articles where the players are between paragraphs. For your application you can just init the module and then do this: echo $sm2->player($page->audio, $options); It should work if your audio field is a single or multiple files field. I would use TracyDebugger to check to see what $sm2 is at the point of where you are echoing it.
  12. yeah looks very cool @gornycreative Perhaps if you don't mind sharing it, it would be great to have a look! - this is somewhat the original intention of the module, to be able to provide all of those types of settings interfaces like people build for WordPress etc..
  13. @gornycreative thanks - the use case sounds interesting and obviously useful for dynamically generating options from other places than static choices; I'll play around with it soon and try and post back, have some projects that will probably need more elaborate settings pages soon...
  14. @gornycreative can you post a link to some info about the $wire->file methods? - i couldn't find it in the docs and haven't had time to go look at the core source code. -marc
  15. This looks great – I'm still using an old copy of Kedisoft Totals for all my invoicing, but it's getting long in the tooth, many things don't work right. Looking forward to trying this out!
  16. Thanks - i will check and see if this can be fixed, or I'll add info to the instructions about hidden pages.
  17. Hi @fruid - sorry to hear about this! Could you send me the PHP file to have a look at it? Also let me know your PW, PHP and MySQL versions and i'll take a look. You never know, something could have changed with the PW version or PHP 8, and we need to make sure this module keeps working! - Marc
  18. @taotoo thanks for this - and i actually can't recall how that got fixed but i did sync the repo and the fix was probably in there.. I will definitely get around to do a deep dive check and make sure it works and add the AdminThemeCanvas to the code as you have indicated; I didn't even know about that new theme...
  19. I have no idea if it will work – module config fields can't use a database table, they have to be able to store in JSON, so it would take some research and experimentation to see if it is even possible to use this field type in a module config. So setting schemaClass would have no effect. Most module configs that use repeatable interfaces are done with custom javascript, as far as I have seen. (For example use a text field for the first one, and then a hidden field to store the repeatable values; use JS to allow the users to add an inputfield, and then join all of the values together in pipe delimited hidden field..)
  20. when you do the code to add it, you would need to specify the Fieldtype to multiply, so that needs to be one of the options, 'fieldtypeClass': 'FieldtypeText' in the json or wherever... (haven't tested this, but looking at the module, it does need the "fieldtype to multiply" to be expressly set)
  21. @Clarity - Settings Factory should technically support what any module config would; i've never seen repeater fields used in a module config screen, probably because repeaters require the use of hidden pages. So for now this module would need to stay limited to those fields whose values can be stored in text/json;
  22. awesome! Thanks for using the module - hope it helps and is useful!
  23. @Clarity Can you post the contents of your PHP file? Are you using any namespace? What version of ProcessWire are you on? There is an example settings file in the module, you can copy to your templates folder somewhere and then specify that file for the settings. If that file doesn't work, then something must have changed in the core. It works for me under PW 3.0.178.
  24. @Atlasfreeman the player is working when i visit that page, so i don't know why the play button is pausing after you hit it, because that's not happening to me, i can play all of the tracks. What browser are you using? I'm on firefox and the players work well..
×
×
  • Create New...