Jump to content

kongondo

PW-Moderators
  • Posts

    7,529
  • Joined

  • Last visited

  • Days Won

    160

Everything posted by kongondo

  1. Sorry all, I haven't yet found time to act on this. I need time to investigate it properly.
  2. See the two posts above yours ?. Currently, this is not possible if using the render() method but I have added it to my todo list.
  3. Actually, this is not true ?. I don't know what version you are using but there has always been a save as unpublished or published during menu creation and an unpublish/publish action that can be applied to existing menu items in the menus list/table. See the big green shiny buttons ?. Create menu before version 027 Create menu version since version 027 Unpublish/Publish post menu creation Am I missing something?
  4. OK. Added to my todo ?
  5. Hi @Orkun, Yes it is just a temporary folder. It should. It works fine here. Could you please tell me about your setup? (ProcessWire and PHP versions, etc). I am not sure whether it is a file permission issue. Are you on a Windows machine? Alternatively, maybe you are trying to upload very large images and the system does not finish and you are trying to re-upload? Please let me know.
  6. Sorry for the late response @Orkun... No, that wouldn't be a good idea. One, it would just get overwritten on an upload and secondly, that is not a correct mimetype for mp3s. Glad you got it sorted. It seems PHP will sometimes misclassify the the mimetypes of some mp3s. Here's a discussion about it on SO. This might also be of relevance (corrupt ID3 tags)
  7. Hi @Stefanowitsch, Sorry for the issues you are currently experiencing. This is a strange one. It might mean Media Manager was not installed correctly and the settings page is not found. It might be the cause of your other issue. Via email (using the email in your receipt) or PM could you please: Send me a screenshot of the open tree at Admin > Media Manager. Confirm that these fields were created: media_manager_audio, media_manager_document, media_manager_image, media_manager_settings, media_manager_video. Confirm that these templates were created: media-manager, media-manager-audio, media-manager-document, media-manager-image, media-manager-settings, media-manager-video. The version of ProcessWire you are using. The PHP version your server is running. Any error messages, in the console and in TracyDebugger (hopefully, you have this installed) Thanks.
  8. Hi @montero4, Moderation note: I have moved your topic to the General Support forum as the gist of your thread is about seeking advice. Hopefully here, you will get lots of advice. However, if at any point in the future you decide you want to hire a developer, please start a topic in that regard in the jobs board and cross reference this thread, if you wish.
  9. You go away for a minute and this is what happens...? TL;DR From Device-centric to App-centric development: ambient computing Dart and Flutter ranked #1 and #2 for fastest-growing language and open source project respectively over the last twelve months - GitHub’s 2019 State of the Octoverse report. Flutter is now one of the ten most starred software repos on GitHub. Flutter described as “the fastest-growing skill among software engineers”. LinkedIn, 2019. Flutter for web is in beta. Flutter for desktop is in alpha for mac-OS. You can edit Flutter code, run it and view the rendered UI online in DartPad. See the samples drop-down on the top-right. Adobe XD, Supernova, etc: flutter plugins. Full announcement here. Videos here (Flutter Interact 2019).
  10. Update: Blog 2.4.5 Changelog Added new option (see example use below) to MarkupBlog::getArchives() that allows to specify if archive months should be sorted descending (Dec - Jan). Default is ascending (Jan - Dec), thanks to question by @montero4 Fixed bug in template blog-archives.php that caused illegal offset warnings. Module has been updated in the modules directory. Example usage of new getArchives() option getArchives() now accepts a third parameter as an $options array. If you want archive months to be sorted and rendered in descending order (December - January), you will need to pass this as an option in the $options array and set the value 'descending' to they key 'archives_month_sort_order'. Since this is the third parameter for the method, you will need to pass options for the first and second parameters as well. If you want the default ascending order of months, you don't have to change anything in your code. Just call getArchives() as usual without any parameters. Otherwise, read on for descending order of months. <?php $blog = $modules->get("MarkupBlog"); // options: if we want to sort archive months in descending order $archiveOptions = array('archives_month_sort_order'=>'descending'); // get archives: order months descending $archives = $blog->getArchives(0, 1, $archiveOptions); // if you want to render the archives $content = $blog->renderArchives($archives);// order months descending Please test and let me know. Thanks.
  11. Hi @montero4, Welcome to the forums and ProcessWire. This seemed like a nice feature to add so I have gone ahead and added it as an option to getArchives(). I'll release over the weekend. PS: I have moved your thread to the blog support forum.
  12. Downloading Media From Media Manager Library I was recently asked whether it was possible to download media already uploaded to Media Manager. Currently, there is no automated way to do this. However, using the ProcessWire API, one can achieve this. Below is a starter code showing how one can download image media from Media Manager. I'll consider adding this feature to Media Manager. Please note that I have deliberately left Tracy debugging statements in the code. You will want to wrap this around a check if user is Superuser. // get limited number of media manager images $mmPages = $pages->find('template=media-manager-image, limit=10'); $tempName = 'media_manager_downloads';// temporary name for folder to place images in // 1. MAKE DIRECTORY // @note: could have used $files->tempDir('hello-world'); but not working for some reason // create a new directory in ProcessWire's cache dir $copyTo = $config->paths->cache . $tempName; if($files->mkdir($copyTo)) { // directory created: /site/assets/cache/media_manager_downloads/ // 2. COPY IMAGES // get and copy image assets foreach($mmPages as $p) { $images = $p->media_manager_image; foreach($images as $image) { //bd($image->filename,'image path')// to debug image path $copyFrom = $image->filename; $bool = $files->copy($copyFrom, $copyTo); //bd($bool,'copied?');// just to test if files were copied } } // 3. ZIP IMAGES // if files were copied, zip them if(!empty($files->find($copyTo))){ // create zip of all files in directory $copyTo to file $zip $zip = $config->paths->cache . "media-manager-image-files.zip"; $result = $files->zip($zip, $copyTo); echo "<h3>These files were added to the ZIP:</h3>"; foreach($result['files'] as $file) { echo "<li>" . $sanitizer->entities($file) . "</li>"; } if(count($result['errors'])) { echo "<h3>There were errors:</h3>"; foreach($result['errors'] as $error) { echo "<li>" . $sanitizer->entities($error) . "</li>"; } } // 4. SEND FILES TO BROWSER FOR DOWNLOADING // if files were added to zip file, send them if(!empty($result['files'])){ bd($zip,'files were added'); $files->send($zip); } } else { bd('NO FILES FOUND!'); } } Hope this helps.
  13. Maybe you could consider Media Manager ??
  14. Yes. They are for both. If using resizing feature, the images will be constrained to those limits. If they fall short of the minimum, the images are discarded. If not using resizing, original images should meet the minimum and maximum constraints. Good idea. I'll see how to better word this. I am coming up blank at the moment ?
  15. Actually, there is ?. See under Settings > Upload Settings > Image. There are settings for min/max height and min/max width. These are directly coupled to the the field's (media_manager_image) corresponding settings. If you change one it will change the other. However, I have just noticed a bug. The min values are decoupled! This shouldn't matter much though since Media Manager will still honour the min values. I will fix these later (i.e. the 'decoupling' issue). Excellent suggestion! I will add this to my TODO as well. NO ETA for above, just yet, sorry. I hope it isn't urgent? Thanks!
  16. Welcome to the forums @Neeraz, It was decided early on to add classes to the <li> instead of the <a>, as it was the usual practice. Getting the <a> via CSS is quit easy, for instance... #menu li a { /* your styles here*/ } You can be as specific as you want with your CSS. Not a good idea as this will get overwritten next time you upgrade Menu Builder :-).
  17. Should be $file->filename or $file->filename() :-)
  18. Hmm. This is a tricky one as it is made up of two parts: Paying a fraction (instalment) of the total cost Future payment (aka recurring payment) Both are tricky, but especially #2. #1 is partly achievable by raising an invoice using manual order creation. The order will be manually marked as complete once the total has been paid. Automating the process may not be an easy task. I'd have to think about it more. # 2 If this means storing user card details, then no; we are not going down that route. However, if it means using payment providers' subscription/recurring payments services, then it is probably doable. The payment providers API is there. Something else to think about, but for future versions. Currently none of these features are in the plan, but I'll have a think. I will probably need reminding though :-).
  19. You mean like in a spreadsheet? You mean including the page values of the fields as well or just the field definitions?
  20. The response I was going to give is aptly summarised by @gornycreative (quoted below...) It would be a nightmare to keep track of global freight. We will provide hooks on our side to facilitate this. However, whilst we will strive to cater for different scenarios, we will prioritise making sure the API works for the bigger providers first and/or the most popular (with respect to our client base). Please note that this (and other advanced features will be incrementally added to Padloper 2 but will certainly not make it in the first release). This is not currently planned. It might make it on my to do list for future releases, depending on demand. No. This is not planned. It might be considered depending on demand, though. Thanks! ?
  21. Update: Menu Builder 0.2.7 Changelog Added the property extra_fields for use with getMenuItems() ONLY. This enables returning the page field values for some selected Fieldtypes. For example, the description field in the page corresponding to the menu item. Thanks @e0f for the inspiration. Full documentation of this new feature is available here. Menus in multi-lingual sites can now be called using their multi-lingual titles or names irrespective of the current user's language. For example, a multi-lingual site with English, German and Finnish languages could have a menu with the respective titles My Awesome Menu / Mein Tolles Menü / Oma Mahtava Valikko. Any of these titles can be used in the code to call the menu (using render() or getMenuItems() methods). [PS: blame you-know-who for these language translations :-)] Changed the way new menus are added. Only one menu can be added at a time. The title field/input is multi-lingual ready. See screens below. Improved the backend GUI when viewing locked menus. Only the menu items and and exit button are shown in such cases. Fixed bug that allowed access to unpublished menus for frontend rendering. Updated the documentation Refactored code to improve efficiency. In dev branch only for testing. Screenshots a. Add Menu (Multi-lingual) b. Edit Menu (Multi-lingual) c. Locked Menu d. An example usage of extra_fields (I am no designer, so yeah, nothing much to see here...but you get the idea :-)) Thanks for testing!
  22. Maybe not what you need, but could be worth looking at the new module Dashboard?
  23. Hi @e0f, Currently, this is not doable out of the box. However, using the method getMenuItems() (see a few posts up for examples), you can use the property pagesID (or index pages_id if getting back array of menu items) to get ($pages->get($m->pageID), for example) the respective ProcessWire pages of the menu items and return the custom fields you want, e.g. description. Having said that, I would not recommend this. It seems like an overkill and may not be very performant based on the number of menu items and other factors. Perhaps if you could explain your use case, I would see if I can add an option to retrieve the values of simple fields (text, integers, dates, etc) for use with getMenuItems(). MenuBuilder is primarily for building navigation menus. From your example, it seems you are using it for a different purpose? Maybe provide a fuller example so that I can get my head around this.
  24. Anything that repeats in any programming language calls for, invariably, something you can iterate/traverse (e.g. an array) and the tool you use for the traversal/looping, (e.g. foreach). Let's go with these two. Looking at the UIkit markup you've pasted, I suppose some of the classes are automatically injected by UIkit JavaScript. However, the basic structure of the markup that repeats is the same. Hence, I'll ignore markup classes for now. The main differences in the images ratio markup are the following: The main containers for the images vary in the class they have. The first, the second and the fourth have the class: <div class="uk-width-expand@s">...</div> The 3rd image container has a different class: <div class="uk-width-2-3@s">...</div> Secondly, the <img> markup themselves have different values for their data-height attribute. Hence, we will need some variable to store these differences. Although some of the values are shared, for instance, the class for the main images container for the 1st, 2nd and 4th images (as stated above), I prefer to store each image's values separately. This can help down the line if the markup changes resulting in different values that were previously identical. Although it may be simple to assume that the images in your image field (which I will refer to as images) are already arranged in order and are in the correct size, from experience, we know that this will most likely NOT be the case. Clients can upload images that are not of the correct size and arrange them randomly. You may need to cater for this, e.g. have the clients tag the images with first, second, etc....but that may be too much work. OK, for the fun part. Please note that in the examples below, I only focus on the images' container part. I have also left in the CSS just for reference, although they may be auto-injected as stated above. We have at least two ways to loop through our images. Both ways involve having an array that will have 4 nested arrays, one each for our 4 images. The first way to loop through our images is to loop through the images themselves and access the array with images info inside this loop as shown below: The main downside to the above approach is we are assuming there will always be four images in the images field. What if a client adds more? What if there are less images? All these will require adding checks in the code (within the loop) to check how many images we have. To counter some of these challenges, we can instead loop through the array with the info for images as shown below: This is just basic code to get you started. There are a number of things that could be improved. For instance, you may want ProcessWire to resize the images for you (done once) rather than depending on your browser to contain larger images. See the Resize and crop section in the API documentation here. There are alternative approaches as well to the examples shown above. PS: code untested
  25. HTML specs say select tag does not have readonly attribute. Use disabled instead. I think a disabled select will not POST though.
×
×
  • Create New...