Jump to content

Macrura

PW-Moderators
  • Posts

    2,756
  • Joined

  • Last visited

  • Days Won

    40

Posts posted by Macrura

  1. Sure, well I don't know if/when I'll be able to use your version as I have mountains of infrastructure running on setups that I'm hesitant to change (if it ain't broke don't fix it), but probably on the next iteration of the main profile I use, I can see how the existing field could be replaced, and whether it will be a "drop in" replacement, or require some front end code adjustments...

    • Like 1
  2. 1 hour ago, Mailte said:

    Is there a way to add a download button in the compact ui?

    I don't think there is a native download feature in soundmanager, and nothing in this module that I'm aware of;

    I used plyr (https://plyr.io/) recently to have downloadable audio: https://sfcmp.org/media/artist-chats/

    There may be a way to modify the output of the bar ui player though and add a download button.

    But more recent audio players like plyr are working well for me, and you could implement it using a simple hanna code.

  3. On 11/21/2023 at 7:48 PM, gornycreative said:

    Go on...

    I was looking into doing something like this myself, having used UIKit2 and Master 2 a TON in my wordpress days.

    Essentially my PW block builder is similar to what they do in terms of output, but I haven't considered the option of actually bringing elements from the Yootheme pro over into - say - a latte template tree.

    Is that what you ended up doing, or do you run templates at all?

    @gornycreative sure - thanks!

    Basically i'm only using YT Pro for the styling, and for modeling the basis of certain types of content/markup. Using the local install of WordPress+YTPro I could setup the preferences for the look and feel of the site, choose the theme, etc. I can sync the YTPro generated CSS file, JS and fonts across to the theme folder in my PW folder. I have a MarkupThemeEngine module that handles frontend theme stuff. It has an api that simplifies handling of display assets (CSS/JS).

    A fair amount of the markup is custom coded, textbook UIKit - but that markup inherits the styling of the YTPro generated CSS file. The reason i can't use WordPress is that it ends up being too much work for the users, and it doesn't meet our requirements for a lot of content types. Many things that need plugins in WP can be easily created in PW with some small effort.

    The template files are designed to make decisions and do all of the heavy lifting, creating intelligent processes that assist the users to get things done fast. The backend config for any given page is mostly text, images and preferences – nobody has to actually design or configure anything in the admin. Fairly complex pages with multiple sections, images, audio, and video can be setup and done in a matter of minutes. (If i needed to create a more complex layout, I might go and do it in my WordPress install and then analyze the output code and turn that into an algorithmic setup in PW).

    There are not that many templates - Basic Page and a Page Builder, plus the custom ones for Albums, Events and Players.

    The Page Builder template uses a PageTable - each section of any Page Builder page is stacked "sections"; to add a section is just an entry in the PageTable; and then you select the "Section Type". At that point there may be a couple of things to populate - image, text, and some preferences.

    There is a centralized Media Library, and a Media Select field that uses InputfieldSelectize to choose any item in the media library.

     

    • Like 2
  4. 1655135747_WelcometoSFContemporary.thumb.jpg.c75f53fa1fbde00d23acb452ec1d07b4.jpg

    Happy to announce the launch of the completely rebuilt San Francisco Contemporary Music Players website, using ProcessWire.

    https://sfcmp.org/

    The previous website was a hornet's nest of disorganized content, dozens of 3rd party plugins, duct taped together within WordPress... difficult to use, time consuming and confusing to manage. And didn't look so good either.

    Lot of fun to rebuild this, though took several months. YOOtheme Pro and UiKit were a dream for me to work with, just love those. Made it so possible to create all of the custom sections, widgets, sliders, cards, mega menus, and so on. Don't consider myself a front-end focused web dev, so have a deep appreciation for the time, care and effort that Yoo has put into both UiKit and YOOtheme Pro. Almost no additonal CSS was needed to be written for this; the stock UiKit classes and attributes make it possible to just build things in HTML and not have to fiddle with CSS.

    Ryan's commercial modules played a major role in the build. ProFields, ListerPro, ProCache, and FormBuilder were all important. FormBuilder+Stripe allowed me to confidently migrate their need for a stripe checkout from some WP plugin to the clean and simple setup now using FB. ( https://sfcmp.org/donate/print-for-sale-dirge-by-hung-liu/ )

    Some libraries also were of great use and value, namely PLYR for audio, and tabulator for some table display type of stuff.

    As always, the API was a dream to work with, many custom import scripts were created along the way to import legacy Press, Albums, Repertoire works, Program Booklets library, Players etc.. The image API is doing wonders with SRC sets, and webp images. The PW documentation site was a daily companion.

    This forum likewise was always a most valuable and enjoyable resource to search and rely on for solving the occasional conundrum. There is such a wealth of info here that i never found it necessary to post a question.

    Lastly, to underscore just how unparalleled, flexible and user-friendly the PW backend is, we had the backend training session a couple of weeks after the site was launched, and within 30 minutes, the person who will be managing the content was able to know how to create and manage concerts, blog posts, albums, press articles and more.

    • Like 19
    • Thanks 1
  5. On 10/6/2023 at 6:45 PM, MarkE said:

    OK, the problem here seems to be that values of fieldset children are omitted by ProcessSettingsFactory. Somewhere between (in the buildForm() method) line 136 $form->add($fArray); and line 174 return $form; the values of the fieldset children get dropped. If I comment out the section

    foreach($inputfields as $key => $cField) {
    ...
    }

    the field values load correctly

    thanks for this - i'll see if i can fix that asap.

    • Like 1
  6. Hi @MarkE,

    One way is to create a json file with the fields you want to give access to from the other module. So if the other module had something like a checkbox, or select field, you would need to copy those field definitions into a new json file, say in your templates/settings folder. Then you would create a new admin page, using the Settings Factory process, and enter the path to that json file.

    Now the settings factory is storing the override values for that module separately. So in order to now have those be used, it depends on how you are using that module, if it is being used on the front end, you could override the settings but it depends on which settings are public in that module, and how they are output. If you let me know which module you want to do this on i can see if I can figure it out..

  7. 13 hours ago, fruid said:

    I tried that, FYI I see 

    PHP Warning: Undefined array key "footer_imprint__1021" in .../modules/SettingsFactory/ProcessSettingsFactory.module:151
    

    Yes i see that the lines that handle the languages (148-154) is not checking if the array key is set yet. Will have to add that check to prevent the warning.

    • Like 2
  8. 8 minutes ago, fruid said:

    has something changed in this module? Because I cannot seem to find the place where you enter the path to the json or php file with the settings array. I'm on ProcessWire 3.0.207

    @fruid First create a new admin page (under admin, with admin template) and then select ProcessSettingsFactory as the process.

    After that you'll see the Inputfields Definition File Path field show.

  9. On 8/30/2023 at 1:09 PM, Matthieu said:

    Hello,

    I'm trying to use your module, but I think I miss something...
    I import first some pages after if I save manually each one all is fine but if I try to bulk save nothing append.

    Third case, when I use the api way, the url of image in textarea are well updated but the "images" field stay empty.
    Any idea how to clean this situation? Thanks

    @Matthieu

    Thanks for posting this question, and sorry for the delay – the module runs off of a ProcessWire hook, which is the "save" hook, and it only works when you are in the "ProcessPageEdit" process.

    But, we already provided an api for this module, all you have to do is init the module and then use the "importImages()" method and it will work.

    Sample Code:

    $m = $modules->get("ImportExternalImages");
    $p = $pages->get(/path/to/page); // or page ID
    $m->importImages($p);

    This also assumes you already setup the images and textarea field preferences in the module. After running that api call, the module will search the specified textarea field, analyze it for image URLS and attempt to import all of the found images into the specified image field.

  10. Not sure what caused this but i seem to have these entries in the modules table with a period, and seem to be causing some error notices in the modules screen.

    1576248667_ScreenShot2023-07-22at10_49_07AM.thumb.png.4a5cd526757cf304f93e340f3d12cefa.png

    1021183639_ScreenShot2023-07-22at10_19_38AM.thumb.png.9a1feb67b2dd823d59a14aec436d6d8a.png

    Deleting those rows does solve the issue; Posting here in case someone else runs into this. Seems to have been caused by some upgrade/downgrade process of the core.

  11. 50 minutes ago, Krlos said:

    Hi @Macrura,

    I just found your amazing module, how can I enable multilanguage support for fields?

    Thanks.

     

    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.

    • Like 1
  12. 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...

  13. @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.

     

  14. 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();
    }
  15. @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

  16. 23 hours ago, protro said:

    Thanks @Macrura,

    Also is there a way to pass in a Page's fields to control to Bar-UI Track Title Template if I didn't want to rely on ID3 tags? What are these tokens {title} referencing ?

     <span itemprop="name">{title}</span>

    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...

    • Like 1
  17. @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);

     

    • Like 1
×
×
  • Create New...