Jump to content

Recommended Posts

Is there a planned release Date for the new Version with UIKit Admin Theme support?

I would like to buy the module, but without UIKit support I still have to wait 😉 

Share this post


Link to post
Share on other sites
5 hours ago, zoeck said:

Is there a planned release Date for the new Version with UIKit Admin Theme support?

I would like to buy the module, but without UIKit support I still have to wait 😉 

Hi @zoeck,

Thanks for your interest in Media Manager. I can't give a definite date but it will be in the autumn.

  • Like 2

Share this post


Link to post
Share on other sites

Hi, I recently bought the Mediamanager but I am not able to configure tagging of single media files properly. I followed the instructions on https://mediamanager.kongondo.com/documentation/getting-started/enabling-media-tags/ but no matter what option of tagging I choose ("User enters tags by text input", "User selects from list of predefined tags" or "User selects from list of predefined tags + can input their own") only the first option seems to work (entering text by myself). That is not very comfortable for the user and also kind of error prone. Are the other options just not implemented correctly or am I doing something wrong. Any help would be appreciated.

Share this post


Link to post
Share on other sites
19 minutes ago, ampersand83 said:

Hi, I recently bought the Mediamanager but I am not able to configure tagging of single media files properly.

Hi @ampersand83,

Many thanks for the purchase. Welcome to the forums as well :-).

Predefined tags in ProcessWire are relatively new. Updating Media Manager to include the feature is planned, although it may not make it in the next (soon) release.

Share this post


Link to post
Share on other sites

Just to clarify my post above, @ampersand83, my answer is in reference to bulk adding/editing tags. In the upcoming version, media will be edited in a modal in its original page. Hence, you will be able to use any tags input as normal.

Share this post


Link to post
Share on other sites
On 10/9/2018 at 12:21 PM, kongondo said:

Just to clarify my post above, @ampersand83, my answer is in reference to bulk adding/editing tags. In the upcoming version, media will be edited in a modal in its original page. Hence, you will be able to use any tags input as normal.

Thank you @kongondo  for your quick reply. That sounds nice. I really hope you will be able to release the new version this year. I'm looking forward to hopefully many improvements to that already nice module.

Share this post


Link to post
Share on other sites

Hi,

I'm new to Processwire. I've recently bought and installed Media Manager, and I have a couple of questions.

I've added Media Manager field as part of a fieldgroup which is placed in a Repeater field (for users to specify image sets for the masthead). There's a small bug in which closing the media manager Insert media dialog box will remove the new Repeater row that is added. It doesn't happen to regular images field. I've attached a video below for illustration purposes.

 

Also, is there a way to consolidate all the files under 1 directory? Most of the time we upload the files into 1 directory (example: assets/images ) and upload them through FTP and the content editors add in the files from the same directory.

 

 

 

Share this post


Link to post
Share on other sites

Hi @Nekorin,

On 11/7/2018 at 3:57 AM, Nekorin said:

I'm new to Processwire.

Welcome to ProcessWire and the forum 🙂

On 11/7/2018 at 3:57 AM, Nekorin said:

I've recently bought and installed Media Manager

Many thanks for the purchase.

On 11/7/2018 at 3:57 AM, Nekorin said:

There's a small bug in which closing the media manager Insert media dialog box will remove the new Repeater row that is added.

Thanks for reporting this. I'll have a look. I couldn't see this happening in your illustration video though; must have missed it :-).

On 11/7/2018 at 3:57 AM, Nekorin said:

Also, is there a way to consolidate all the files under 1 directory? Most of the time we upload the files into 1 directory (example: assets/images ) and upload them through FTP and the content editors add in the files from the same directory.

I'm not sure I follow completely. You are able to FTP files into the directory /sites/assets/MediaManager/uploads/. You can then use the scan feature in the uploads dashboard to move the files to the Media Manager library. The main purpose of Media Manager is to create one large, central bucket for all your media. Content editors should then be able to pick any of the images in Media Manager to use in any page. Please let me know if I misunderstood your request.

Share this post


Link to post
Share on other sites
5 hours ago, kongondo said:

Thanks for reporting this. I'll have a look. I couldn't see this happening in your illustration video though; must have missed it :-).

Sorry that the previous video doesn't depict what I was doing correctly and might have caused some confusion. Below is a more accurate representation of what it is about. Basically whenever I add a new row and insert a media element with the media manager, upon closing the media manager dialog window, it 'erases' all the repeater/repeater_matrix rows for the entire page. I'll have to add back all the rows (it kind of makes it a bit annoying to use. Although I can get it to save in the end, I'll have to do it 25 times if the masthead carousel has 5 rotating images). 

 

There is a JS error too when I access media manager or add an image. 

image.thumb.png.9ae616177be72deeebb456fad963e7f1.png

 

5 hours ago, kongondo said:

I'm not sure I follow completely. You are able to FTP files into the directory /sites/assets/MediaManager/uploads/. You can then use the scan feature in the uploads dashboard to move the files to the Media Manager library. The main purpose of Media Manager is to create one large, central bucket for all your media. Content editors should then be able to pick any of the images in Media Manager to use in any page. Please let me know if I misunderstood your request.

Thanks for the tips. What i'm referring to is after scanning, each individual image is placed in its own separate folder with an id as the folder name. Is there any way to keep everything within a single folder after scanning? It is tedious to make changes to images, can't just ftp them in and see the changes reflected immediately on the frontend. 

Does scan have an overwrite existing files function?

Share this post


Link to post
Share on other sites

Hey @kongondo,

I just purchased your media manager module, thank you for providing it. As far as I can see it works, but it looks broken with AdminThemeUiKit. When I bought it I was expecting it to look like in the screenshots. Now I don't want to show it to the client like that. Do you have a V12-beta I can use?

Also when I upload mp4 videos I get an error saying "filetype not allowed", although mp4 is in the list of allowed extensions. Is this aknown error?

Share this post


Link to post
Share on other sites

Hi @Youbility,

First, please accept my apologies for not getting back to you earlier. I've had some serious computer issues that have set me back a couple of weeks. I hope to be back to 'normal' by the end of this week.

On 11/9/2018 at 11:40 AM, Youbility said:

I just purchased your media manager module, thank you for providing it

Many thanks for your purchase.

 

On 11/9/2018 at 11:40 AM, Youbility said:

When I bought it I was expecting it to look like in the screenshots.

I think you saw the screenshots for the upcoming beta version. Its release has now also been delayed (some unforseen bugs, etc). The current version is not compatible with UIKit. The beta version is not production ready too. 

 

On 11/9/2018 at 11:40 AM, Youbility said:

 Now I don't want to show it to the client like that. Do you have a V12-beta I can use?

This is totally understandable. How would you like to proceed? The beta version may not be out soon. If using an older admin theme, e.g. Reno, is out of the question, then the only option left is not to use Media Manager until the new version is out. I'm happy to offer a refund if you'd rather not wait for the new version. Please do let me know.

Thanks.

Share this post


Link to post
Share on other sites
On 11/9/2018 at 2:30 AM, Nekorin said:

a JS error too when I access media manager or add an image. 

Yes. This has been fixed in the upcoming version. The bug had to do with satisfying some ProcessLister requirement.

On 11/9/2018 at 2:30 AM, Nekorin said:

after scanning, each individual image is placed in its own separate folder with an id as the folder name.

Behind the scenes each image is a page in ProcessWire. That's why you see this. The ID is the id of the page with the media.

On 11/9/2018 at 2:30 AM, Nekorin said:

Is there any way to keep everything within a single folder after scanning?

Currently no, but sounds like an idea/feature request to consider. Maybe a checkbox or a pattern to detect if images should be kept together e.g. house-1.jpg, house-2.jpg, etc. The upcoming version of Media Manager allows to add images to an existing media page. 

On 11/9/2018 at 2:30 AM, Nekorin said:

It is tedious to make changes to images,

What sort of changes are these? Changing the images? Cropping? Other?

On 11/9/2018 at 2:30 AM, Nekorin said:

Does scan have an overwrite existing files function?

No. I'll see if I can add this. Yes, it does. it respects your media manager settings. The settings apply across board. Sorry for the erroneous info.

Edited by kongondo
Misleading info

Share this post


Link to post
Share on other sites
On 11/9/2018 at 11:40 AM, Youbility said:

I get an error saying "filetype not allowed", although mp4 is in the list of allowed extensions. Is this aknown error?

That would only happen if the MIME type of the video is some other format not recognised by the system. Are you able to check the MIME type and let me know? If not, I can send you some code to help.

Share this post


Link to post
Share on other sites

Hello @kongondo

 

Our users are getting the error "Empty file upload result" when trying to upload images, documents etc...

649332669_Bildschirmfoto2018-11-29um10_07_19.thumb.png.8759fdf87a0f987cb7c7c3c6fe7aa04f.png

 

But the image still gets uploaded successfully.

424296831_Bildschirmfoto2018-11-29um10_08_05.png.a49778b335b0c1f221bd6e7b95728fed.png

 

 

After that i checked with Chrome dev tools the ajax response when uploading the placeholder image:

I get this error:

1630049281_Bildschirmfoto2018-11-29um10_22_44.thumb.png.86c9ec94b81d90ce5528c9198470c407.png

 

I searched for that page "peter-fractures-lac-37499" but only found the page "peter-fractures-lac". But it is a media manager audio page.

378183065_Bildschirmfoto2018-11-29um10_36_10.thumb.png.299585fb3491131424e33aae86548a2d.png

 

It looks like the module is trying to create a new mm-audio page called "peter-fractures-lac" but since there is already a page with the same name this error happens.

But the question is why is he trying to create a audio page when I am uploading an image?

 

Processwire Version: 2.7.3 dev

MediaManager Version: 0.0.9

JqueryFileUpload Version: 0.0.2

PHP-Version: 7.0.32

 

Kind Regards

Orkun

Share this post


Link to post
Share on other sites

Hi @Orkun,

You say this is happening with all media types you try to upload? That's strange. I think I've experienced this once when Media Manager was not installed properly and every created child (media page) was heading to the first available media parent, and that happens to be 'Audio'. 

  • Is this a fresh install? Or has Media Manager on that site been working OK previously?
  • Is it possible to have a copy of the images and any non-sensitive documents you are trying to upload so that I can debug?
  • Clearing cache several times and deleting the offending 
  • Is reinstalling Media Manager and option? Does that help? Any errors?
  • We've previously had a similar problem with Imagick but I'm not sure whether that's the case.
By the way, JqueryFileUpload Version: 0.0.2 is a bit outdated :-). Grab the latest version if you can.
 
Thanks.

Share this post


Link to post
Share on other sites

Hi @kongondo

Sorry for my late answer. I could resolve the issue with renaming the audio pagename from "peter-fractures-lac" to "peter-fractures-lac-old" after I have done that somehow a new page was generated automatically called "peter-fractures-lac" with the same audio file like the "old" page ("peter-fractures-lac-old"). From now on I could upload images documents etc... and it worked fine. The Error "Empty file upload result" doesn't come anymore. I also removed now the new generated audio page and renamed "peter-fractures-lac-old" back to "peter-fractures-lac" and everything still works fine. Very strange behavior.

Quote

Is this a fresh install? Or has Media Manager on that site been working OK previously?

- It was working OK previously

 

Quote

By the way, JqueryFileUpload Version: 0.0.2 is a bit outdated :-). Grab the latest version if you can.

I upgraded to 0.0.6 now. Thanks.

 

Kind Regards
Orkun

  • Like 1

Share this post


Link to post
Share on other sites

Hi @kongondo,

I have a proposal for a future version of MediaManager: There are other CMS, where you can preset a internal or external link for each media object. Would this be a useful feature in MediaManager, too?

Greetings,

Thomas.

Share this post


Link to post
Share on other sites
1 hour ago, xportde said:

There are other CMS, where you can preset a internal or external link for each media object. Would this be a useful feature in MediaManager, too?

Hi @xportde,

It would be and it doesn't need to wait for the future. It is already here 🙂. With the new version (announcement imminent), you can add as many fields as you want to your respective Media Manager templates. Let's say you want a URL for your images. All you would need is to:

  1. Add a URL field (in this example, called link) to the Media Manager image template (media-manager-image). 
  2. If not accessing your Media Manager Library directly, create a Media Manager Field (let's call it albums) and add it to your page's template, say basic-page. In the Media Manager Field (albums) settings, enable 'Allow users to edit selected media'. 
  3. Edit a page using basic-page template.
  4. Add images to the field 
  5. Hover over an image and click the Edit link. 
  6. Edit your link field to add your URL. 
  7. In your template file, you can access your URL like this:

 

$albums = $page->albums;
$out = '<div>';
$out .= $albums->each(function($m) {
    if($m->typeLabel !='image') return;
    $thumb = $m->media->height(260);
    $img = "<img src='{$thumb->url}' alt='{$m->media->description}' height='130'>";
    $o = "<div><a href='$m->links'>$img</a></div>";
    return $o;
  });
$out .= '</div>';

// OR: Using foreach
/*
$out = '<div>';
foreach ($albums as $a) {
    if($m->typeLabel !='image') return;
    $thumb = $m->media->height(260);
    $img = "<img src='{$thumb->url}' alt='{$m->media->description}' height='130'>";
    $out .= "<div><a href='$m->links'>$img</a></div>";
    $out .= $m->body;
}

$out .= '</div>';
*/
echo $out;

 

And that's it. Any field you add to your Media Manager template is available as $m->name_of_field, where $m is an instance of MediaManager field as per the example above. More examples in my next (eventual) post(s).

I tried to make a video, or an animated GIF, even a simple screen capture to show you what I mean but everything failed! Lots of artefacts, etc. I've recently moved to Linux, so still finding my way round. 

 

Share this post


Link to post
Share on other sites

Beta testers needed 😃. Please send me a PM if you'd like to help. An active subscription/current license is required.

I'm happy (and frankly relieved 😁) to announce Media Manager v 012 is ready for beta testing. Please accept my apologies for the delay. 

 

With this version:

  1. Only ProcessWire 3.x (preferably the latest master) is supported from now on.
  2. Currently, only AdminThemeUiKit is supported. (we may support Reno theme in the future).

 

Changelog

 

ProcessMediaManager (Media Manager Library/back-end)

  1. New UI: Responsive and closely matches ProcessWire theme (UiKit)

  2. Media thumbs shown in their natural orientation

  3. Upload Anywhere: Upload directly to Media Manager Library using drag and drop

  4. New edit media page in modal (natural ProcessWire page) (respects locked status and Media Manager edit permission if present)

  5. Create image variations in natural ProcessWire page during editing

  6. Add, edit, display and access custom ‘columns’ (fields) added to media manager templates (e.g. add text field to media-manager-image and access value using Media Manager API)

  7. Hide media types menu items if media type not in use

  8. Global setting for allowed media types (e.g. image and video only)

  9. Hide ‘All’ menu item

  10. New filters dashboard

  11. Updated and freshened up upload’s dashboard

  12. Option to upload ZIP archives as is (to save as documents) vs. to decompress them (recursively)

  13. Preview PDF documents in ‘gallery mode’ (if browser supports it)

  14. Selection of media is now identical to how images thumbs are selected in ProcessWire

 

media-manager-edit-1.thumb.png.b5c09ee5ab27f3e23fa505703604a911.png

 

media-manager-edit-2.thumb.png.7a69dd02fac3fe4cef7e753f2af9c9b1.png

 

media-manager-select-media-1.thumb.png.92090c92959cf5f77f024f7870f578e9.png

 

media-manager-select-media-2.thumb.png.2ea01a2274f8f69343ad6d978ce8a0f9.png

 

media-manager-tags-1.thumb.png.286d68e6e9d96af93847378bc807abf1.png

 

media-manager-tags-2.thumb.png.ee33eaf848b55156ea4d6f214e74a780.png

 

media-manager-upload-anywhere-1.thumb.png.d1f77f4440cc15e742cad604d09dacfd.png

 

media-manager-uploads-add-1.thumb.png.cd6d2532323ad124e897368670650abd.png

 

media-manager-uploads-add-2.thumb.png.e23432b6915353b4b8d4e2de982b209e.png

 

media-manager-uploads-scan-1.thumb.png.36cb1c85db85ab8b27355fcd9dc33603.png

 

media-manager-filters-1.thumb.png.4c93ca42d7ba13c4954ca9e8b9505e61.png

 

media-manager-filters-2.thumb.png.6beeb947eb7165f4e2dfe9bfcb52d37e.png

 

media-manager-settings-custom-columns-1.thumb.png.fa8917406e55334124b66b85d5ea2db0.png

 

media-manager-settings-more-new-1.thumb.png.b2e5b240d162adcd2dde1ba054369202.png

 

FieldtypeMediaManager

  1. Enable Upload Anywhere (for InputfieldMediaManager use)

  2. Allow users to edit media displayed in a Media Manager Inputfield

  3. Change whether to use text or icons for action ‘buttons’

  4. Custom fields: Display and edit ‘columns’ (fields) added to media manager templates

 

media-manager-field-settings-1.thumb.png.6148135c4a576cb4fcbe33f6d08031b5.png

 

media-manager-field-settings-2.thumb.png.30d210db2fdf1f8de6e5b026e2b44107.png

 

InputfieldMediaManager

  1. New UI: Responsive and closely matches ProcessWire theme (UiKit)

  2. Media thumbs shown in their natural orientation

  3. Upload Anywhere: Upload directly to Media Manager Library using drag and drop AND simultaneously insert into the Media Manager field on the page being edited

  4. Inputfield Media Manager markup updated/refreshed using Ajax when media is added or edited. No need for a page reload (so you won’t lose unsaved changes on the page)

  5. New edit media page in modal (natural ProcessWire page) (respects locked status and Media Manager edit permission if present)

  6. If a media in a Media Manager Inputfield is unpublished or trashed, it is automatically removed from all Media Manager Inputfields present on the page (including its variations) and the fields refreshed using Ajax

  7. View values of custom columns (not all Fieldtypes supported for viewing although all supported for accessing using the API). These are refreshed on the Inputfield using Ajax once editing is complete.

  8. Better support for repeaters

  9. Preview PDF documents in ‘gallery mode’ (if browser supports it)

  10. Selection of media is now identical to how images thumbs are selected in ProcessWire

 

media-manager-inputfield-1.thumb.png.c3f356f72a140774c1eabbaa829b2f02.png

 

media-manager-inputfield-2.thumb.png.57f86a0296623ce95633049a742feb26.png

 

media-manager-inputfield-upload-anywhere-1.thumb.png.4973a98dce29d8c56361ab41bdb01d4e.png

 

media-manager-inputfield-upload-anywhere.thumb.gif.da6d7a953a1dd8f6124922fc4f17ccc5.gif

 

 

1901912334_media-manager-inputfield-upload-anywhereunzipping.thumb.gif.5ebb9657fcd0ec149167ac80572a8a93.gif

 

media-manager-pdf-preview.thumb.gif.9bfb103ab4b3a6994d5aa0ab309e4423.gif

 

Inserting image variations

media-manager-inputfield-insert-variations-1.thumb.png.4d4cd09f47f95d04a28f2d6a431b1aed.png

 

media-manager-inputfield-insert-variations-2.thumb.png.9717c1e0baf4107409aa49eca13dc165.png

 

Media Manager API (working in the front-end and manipulation via the API)

  1. Access media in a Media Manager field on a given page (see examples below)

In the example below, we access custom fields (columns) added to the image media template (media-manager-image). In this case, two fields have been added. A URL field named links and a text field called headline. You can add any field you want. Please note though that not all fields can be displayed in the backend (for practicality). In the frontend, there are no such restrictions and you can access any of the fields as shown below. Your MediaManager object gives you access to the fields. For instance:

$m->name_of_your_field. 
Below, we have 
$m->links and $m->headline.

 

Please note that $m->media still returns the first media in the MediaManager object. In case you have added more than one media to your media field, e.g. more than one image added to one MediaManager object (done via editing a Media), you can access all of them using:

$m->mediaField;

In the case of image media, $m->mediaField returns a Pageimages object which can be iterated. This assumes, of course, that your media_manager_image field accepts more than one image (the default).

The default setting for number of files accepted for other media types is 1, hence $m->mediaField returns a Pagefile object. You can edit these fields (media_manager_audio, media_manager_document and media_manager_video) to accept multiple files is you wish, in which case $m->mediaField will return a Pagefiles object which you can loop through, access using first(), last(), eq(n), etc.

 

// get the media manager field on the page
$mediaContent = $page->media_manager_tests;

$tbody = '<tbody>';
$tbody .= $mediaContent->each(function($m) {
    if($m->typeLabel !='image') return;
	$thumb = $m->media->height(130);
    $img = "<img src='{$thumb->url}' alt='{$m->media->description}' height='130'>";
	$tds =
		"<td>$img</td>" .
		"<td>{$m->headline}</td>" .
		"<td><a href='{$m->links}'>{$m->title}</a></td>";

	$row = "<tr>{$tds}</tr>";
    return $row;
});
$tbody .= '</tbody>';

$content .=
	"<div class='uk-overflow-auto uk-width-1-1'>".
		"<table id='news-outlets' role='presentation' class='uk-table uk-table-divider uk-table-hover uk-table-justify uk-table uk-table-middle uk-table-responsive'>".
			"<thead>" .
				"<tr>" .
					"<th class='uk-width-small'>Preview</th>" .
					"<th class='uk-table-expand'>Summary</th>" .
					"<th class='uk-width-medium'>Link</th>" .
				"</tr>" .
			"</thead>" .
			"{$tbody}".
	"</table></div>";

 

Output of the above code

media-manager-api-output-1.thumb.png.aac5a7285b355bd7deaf8b78b245438c.png

 

media-manager-api-output-2.thumb.png.af279330ea44dc6e8bdd49607d34b6f6.png

 

 

  • Like 5

Share this post


Link to post
Share on other sites

Hi,

i have trouble getting images resized in the listerPro module from Ryan. He asks if the MediaManager module implements the markupValue() method?!

To clarify in The listerPro module can list fields such as images of records. in order to produce a nice list / table it can resize the images on the fly ... thumbnails of 80x80 or what ever setting you whish.

In my setup this is not working (mediamanager field, single instance, only image allowed) and Ryan suggests the markupValue() is probably not implemented.

I my self thought there might be an abstraction depth problem as on the normal imagefield one interacts with the field. In the mediamanager one interacts with the $field->media object ... one level down ...

Share this post


Link to post
Share on other sites

Hi @besrwordt,

Welcome to the forums. 

12 hours ago, besrwordt said:

He asks if the MediaManager module implements the markupValue() method?

Currently, no.

12 hours ago, besrwordt said:

In my setup this is not working (mediamanager field, single instance, only image allowed) and Ryan suggests the markupValue() is probably not implemented.

I'll look into this. What versions of MM and PW are you using?

Share this post


Link to post
Share on other sites
11 minutes ago, kongondo said:

Hi @besrwordt,

Welcome to the forums. 

Currently, no.

I'll look into this. What versions of MM and PW are you using?

Hi @kongondo, PW is 3.0.98 MM is 0.1.1 and ListerPro is 1.1.1

Thanks!

Share this post


Link to post
Share on other sites

@kongondo Another thing: how would i go about to merge 2 mediamanager fields via API... if i add the media from one field to another i get the Class 'MediaManagerArray' doesn't yet implement method 'makeBlankItem() error ...

            foreach ($page->mm-field->media as $t-media ){
                $_another_mmmedia_field.=$t-media;
            }

...

 

Share this post


Link to post
Share on other sites

@besrwordt,

Do you have a current Media Manager subscription? makeBlankItem() is implemented in the latest Media Manager (version 012, soon coming out of beta). However, you can still import from one MM field to another. A MM field behaves like PageArrays (WireArrays). 

 

A Media Manager field stores only two pieces of data; the (page) ID of the media being referenced and the media type (1=audio; 2=document; 3=image; 4=video; 3x=image variation). There's two ways you can go about exporting/importing from one field to the other. The second way is easiest if you need to import everything from one field to another, no questions asked. The first method allows fine control, e.g. if you want to skip certain media types. In the examples below, media_export is the Media Manager field with the media you want to copy over/merge with a second Media Manager field. media_import is the second Media Manager field into which media is being imported/copied over.

Method One: Loop through each media in the Media Manager field you are exporting from

// page with mm field we are importing into (media_import)
$p = $pages->get(1234);

// page with mm field we are exporting from (media_export)
foreach ($page->media_export as $m ) {
    // @note: here you can skip media you don't want to export
    // instance of new MediaManager()
    $mm = new MediaManager();
    // populate the MediaManager object properties with required data (media id and type)
    $mm->id = $m->id;
    $mm->type = $m->type;
    // import/add the media to the 2nd mm field (media_import)
    $p->media_import->add($mm);
}

// output formatting of
$p->of(false);
// save only the media manager field (page with import mm field)
$p->save('media_import');
// revert output formatting back on
$p->of(true);

 

Method Two: Import everything at once

// page with mm field we are importing into (media_import)
$p = $pages->get(1234);
// import all the media in the 1st mm field (media_export) into the 2nd mm field (media_import)
$p->media_import->import($page->media_export);
// output formatting of
$p->of(false);
// save only the media manager field (page with import mm field)
$p->save('media_import');
// revert output formatting back on
$p->of(true);

 

Note that all WireArray behaviour apply. For instance, you might want to first experiment in cases where your 2nd Media Manager field (media_import) already has some media which may or may not be present in the first Media Manager field. 

 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By Gadgetto
      Status update links (inside this thread) for SnipWire development will be always posted here:
      2019-08-08
      2019-06-15
      2019-06-02
      2019-05-25
      If you are interested, you can test the current state of development:
      https://github.com/gadgetto/SnipWire
      Please note that the software is not yet intended for use in a production system (alpha version).
      If you like, you can also submit feature requests and suggestions for improvement. I also accept pull requests.
      ---- INITIAL POST FROM 2019-05-25 ----
      I wanted to let you know that I am currently working on a new ProcessWire module that fully integrates the Snipcart Shopping Cart System into ProcessWire. (this is a customer project, so I had to postpone the development of my other module GroupMailer).
      The new module SnipWire offers full integration of the Snipcart Shopping Cart System into ProcessWire.
      Here are some highlights:
      simple setup with (optional) pre-installed templates, product fields, sample products (quasi a complete shop system to get started immediately) store dashboard with all data from the snipcart system (no change to the snipcart dashboard itself required) Integrated REST API for controlling and querying snipcart data webhooks to trigger events from Snipcart (new order, new customer, etc.) multi currency support self-defined/configurable tax rates etc. Development is already well advanced and I plan to release the module in the next 2-3 months.
      I'm not sure yet if this will be a "Pro" module or if it will be made available for free.
      I would be grateful for suggestions and hints!
      (please have a look at the screenshots to get an idea what I'm talking about)
       




    • By apeisa
      Update 31.7.2019: AdminBar is now maintained by @teppo. Modules directory entry has been updated, as well as the "grab the code" link below.
      ***
      Latest screencast: http://www.screencas...73-ab3ba1fea30c
      Grab the code: https://github.com/teppokoivula/AdminBar
      ***
      I put this Adminbar thingy (from here: http://processwire.c...topic,50.0.html) to modules section and to it's own topic.
      I recorded quick and messy screencast (really, my first screencast ever) to show what I have made so far. You can see it from here: http://www.screencas...18-1bc0d49841b4
      When the modal goes off, I click on the "dark side". I make it so fast on screencast, so it might seem a little bit confusing. Current way is, that you can edit, go back to see the site (without saving anything), continue editing and save. After that you still have the edit window, but if you click "dark side" after saving, then the whole page will be reloaded and you see new edits live.
      I am not sure if that is best way: there are some strengths in this thinking, but it is probably better that after saving there shouldn't be a possibility to continue editing. It might confuse because then if you make edits, click on dark side -> *page refresh* -> You lose your edits.
      ***
      When I get my "starting module" from Ryan, I will turn this into real module. Now I had to make some little tweaks to ProcessPageEdit.module (to keep modal after form submits). These probably won't hurt anything:
      if($this->redirectUrl) $this->session->redirect($this->redirectUrl); if(!empty($_GET['modal'])) $this->session->redirect("./?id={$this->page->id}&modal=true"); // NEW LINE else $this->session->redirect("./?id={$this->page->id}");   and...
      if(!empty($_GET['modal'])) { $form->attr('action', './?id=' . $this->id . '&modal=true'); } else { $form->attr('action', './?id=' . $this->id); // OLD LINE }  
    • By Mike Rockett
      Jumplinks for ProcessWire
      Release: 1.5.54
      Composer: rockett/jumplinks
      Jumplinks is an enhanced version of the original ProcessRedirects by Antti Peisa.
      The Process module manages your permanent and temporary redirects (we'll call these "jumplinks" from now on, unless in reference to redirects from another module), useful for when you're migrating over to ProcessWire from another system/platform. Each jumplink supports wildcards, shortening the time needed to create them.
      Unlike similar modules for other platforms, wildcards in Jumplinks are much easier to work with, as Regular Expressions are not fully exposed. Instead, parameters wrapped in curly braces are used - these are described in the documentation.
      Under Development: 2.0, to be powered by FastRoute
      As of version 1.5.0, Jumplinks requires at least ProcessWire 2.6.1 to run.
      View on GitLab
      Download via the Modules Directory
      Read the docs
      Features
      The most prominent features include:
      Basic jumplinks (from one fixed route to another) Parameter-based wildcards with "Smart" equivalents Mapping Collections (for converting ID-based routes to their named-equivalents without the need to create multiple jumplinks) Destination Selectors (for finding and redirecting to pages containing legacy location information) Timed Activation (activate and/or deactivate jumplinks at specific times) 404-Monitor (for creating jumplinks based on 404 hits) Additionally, the following features may come in handy:
      Stale jumplink management Legacy domain support for slow migrations An importer (from CSV or ProcessRedirects) Feedback & Feature Requests
      I’d love to know what you think of this module. Please provide some feedback on the module as a whole, or even regarding smaller things that make it whole. Also, please feel free to submit feature requests and their use-cases.
      Note: Features requested so far have been added to the to-do list, and will be added to 2.0, and not the current dev/master branches.
      Open Source

      Jumplinks is an open-source project, and is free to use. In fact, Jumplinks will always be open-source, and will always remain free to use. Forever. If you would like to support the development of Jumplinks, please consider making a small donation via PayPal.
      Enjoy! :)
    • By nbcommunication
      I've spent the last while experimenting with srcset implementation - and PageimageSrcset is the result:
      PageimageSrcset
      Provides configurable srcset and sizes properties/methods for Pageimage.
      Overview
      The main purpose of this module is to make srcset implementation as simple as possible in your template code. It does not handle images rendered in CKEditor or similar fields.
      For an introduction to srcset and sizes, please read this Mozilla article about responsive images.
      Pageimage::srcset()
      // The property, which uses the set rules in the module configuration $srcset = $image->srcset; // A method call, using a set rules string // Delimiting with a newline (\n) would also work, but not as readable $srcset = $image->srcset("320, 480, 640x480 768w, 1240, 2048 2x"); // The same as above but using an indexed/sequential array $srcset = $image->srcset([ "320", "480", "640x480 768w", "1240", "2048 2x", ]); // The same as above but using an associative array // No rule checking is performed $srcset = $image->srcset([ "320w" => [320], "480w" => [480], "768w" => [640, 480], "1240w" => [1240], "2x" => [2048], ]); // Use the default set rules with portrait images generated for mobile/tablet devices $srcset = $image->srcset(true); // Return the srcset using all arguments $srcset = $image->srcset("320, 480, 640x480 768w, 1240, 2048 2x", [ "portrait" => "320, 640", ]); // The set rules above are a demonstration, not a recommendation! Image variations are only created for set rules which require a smaller image than the Pageimage itself. On large sites this may still result in a lot of images being generated. If you have limited storage, please use this module wisely.
      Portrait Mode
      In many situations, the ratio of the image does not need to change at different screen sizes. However, images that cover the entire viewport are an exception to this and are often the ones that benefit most from srcset implementation.
      The main problem with cover images is that they need to display landscape on desktop devices and portrait when this orientation is used on mobile and tablet devices.
      You can automatically generate portrait images by enabling portrait mode. It is recommended that you use this in combination with Pageimage::focus() so that the portrait variations retain the correct subject.
      The generated variations are HiDPI/Retina versions. Their height is determined by the portrait ratio (e.g. 9:16). Variations are always generated, regardless of whether the original image is smaller. Upscaling is disabled though, so you may find that some variations are actually smaller than they say they are in their filename.
      The sizes attribute should be used when portrait mode is enabled. Pageimage::sizes will return (orientation: portrait) and (max-width: {maxWidth}px) 50vw by default, which handles the use of these images for retina devices. The maximum width used in this rule is the largest set width.
      Pageimage::sizes()
      There is no option to configure default sizes because in most cases 100vw is all you need, and you do not need to output this anyway as it is inferred when using the srcset attribute. You can use the method for custom sizes though:
      // The property $sizes = $image->sizes; // Returns 100vw in most cases // Returns '(orientation: portrait) and (max-width: {maxWidth}px)50vw' if portrait mode enabled // A method call, using a mixture of integer widths and media query rules // Integer widths are treated as a min-width media query rule $sizes = $image->sizes([ 480 => 50, "(orientation: portrait) and (max-width: 640px)" => 100, 960 => 25, ]); // (min-width: 480px) 50vw, (orientation: portrait) and (max-width: 640px) 100vw, (min-width: 960px) 25vw // Determine widths by UIkit 'child-width' classes $sizes = $image->sizes([ "uk-child-width-1-2@s", "uk-child-width-1-3@l", ]); // (min-width: 640px) 50vw, (min-width: 1200px) 33.33vw // Determine widths by UIkit 'width' classes $sizes = $image->sizes([ "uk-width-1-2@m", "uk-width-1-3@xl", ]); // (min-width: 960px) 50vw, (min-width: 1600px) 33.33vw // Return the portrait size rule $sizes = $image->sizes(true); // (orientation: portrait) and (max-width: {maxWidth}px) 50vw // The arguments above are a demonstration, not a recommendation! Pageimage::render()
      This module extends the options available to this method with:
      srcset: When the module is installed, this will always be added, unless set to false. Any values in the formats described above can be passed. sizes: Only used if specified. Any values in the formats described above can be passed. uk-img: If passed, as either true or as a valid uk-img value, then this attribute will be added. The srcset attribute will also become data-srcset. Please refer to the API Reference for more information about this method.
      // Render an image using the default set rules echo $image->render(); // <img src='image.jpg' alt='' srcset='{default set rules}'> // Render an image using custom set rules echo $image->render(["srcset" => "480, 1240x640"]); // <img src='image.jpg' alt='' srcset='image.480x0-srcset.jpg 480w, image.1240x640-srcset.jpg 1240w'> // Render an image using custom set rules and sizes // Also use the `markup` argument echo $image->render("<img class='image' src='{url}' alt='Image'>", [ "srcset" => "480, 1240", "sizes" => [1240 => 50], ]); // <img class='image' src='image.jpg' alt='Image' srcset='image.480x0-srcset.jpg 480w, image.1240x640-srcset.jpg 1240w' sizes='(min-width: 1240px) 50vw'> // Render an image using custom set rules and sizes // Enable uk-img echo $image->render([ "srcset" => "480, 1240", "sizes" => ["uk-child-width-1-2@m"], "uk-img" => true, ]); // <img src='image.jpg' alt='' data-uk-img data-srcset='image.480x0-srcset.jpg 480w, image.1240x640-srcset.jpg 1240w' sizes='(min-width: 960px) 50vw'> // Render an image using portrait mode // Default rule sets used: 320, 640, 768, 1024, 1366, 1600 // Portrait widths used: 320, 640, 768 // Original image is 1000px wide // Not possible to use portrait mode and custom sets or portrait widths in render() // Sizes attribute automatically added echo $image->render(["srcset" => true]); // <img src='image.jpg' alt='' srcset='image.320x569-srcset-hidpi.jpg 320w, image.640x1138-srcset-hidpi.jpg 640w, image.768x1365-srcset-hidpi.jpg 768w, image.jpg 1024w' sizes='(orientation: portrait) and (max-width: 768px) 50vw'> Configuration
      To configure this module, go to Modules > Configure > PageimageSrcset.
      Set Rules
      These are the default set rules that will be used when none are specified, e.g. when calling the property: $image->srcset.
      Each set rule should be entered on a new line, in the format {width}x{height} {inherentwidth}w|{resolution}x.
      Not all arguments are required - you will probably find that specifying the width is sufficient for most cases. Here's a few examples of valid set rules and the sets they generate:
      Set Rule Set Generated Arguments Used 320 image.320x0-srcset.jpg 320w {width} 480x540 image.480x540-srcset.jpg 480w {width}x{height} 640x480 768w image.640x480-srcset.jpg 768w {width}x{height} {inherentwidth}w 2048 2x image.2048x0-srcset.jpg 2x {width} {resolution}x How you configure your rules is dependent on the needs of the site you are developing; there are no prescriptive rules that will meet the needs of most situations. This article gives a good overview of some of the things to consider.
      When you save your rules, a preview of the sets generated and an equivalent method call will be displayed to the right. Invalid rules will not be used, and you will be notified of this.
      Portrait Mode
      Set Widths
      A comma limited list of widths to create HiDPI/Retina portrait variations for.
      Crop Ratio
      The portrait ratio that should be used to crop the image. The default of 9:16 should be fine for most circumstances as this is the standard portrait ratio of most devices. However, you can specify something different if you want. If you add a landscape ratio, it will be switched to portrait when used.
      Any crops in the set rules ({width}x{height}) are ignored for portrait mode variations as this ratio is used instead.
      UIkit Widths
      If your website theme uses UIkit, you can pass an array of UIkit width classes to Pageimage::sizes to be converted to sizes. The values stored here are used to do this. If you have customised the breakpoints on your theme, you should also customise them here.
      Please note that only 1- widths are evaluated by Pageimage::sizes, e.g. uk-width-2-3 will not work.
      Remove Variations
      If checked, the image variations generated by this module are cleared on Submit. On large sites, this may take a while. It makes sense to run this after you have made changes to the set rules.
      Image Suffix
      You will see this field when Remove Variations is checked. The value is appended to the name of the images generated by this module and is used to identify variations. You should not encounter any issues with the default suffix, but if you find that it conflicts with any other functionality on your site, you can set a custom suffix instead.
      Debug Mode
      When this is enabled, a range of information is logged to pageimage-srcset.
      PageimageSrcsetDebug.js is also added to the <head> of your HTML pages. This will console.log a range of information about the images and nodes using srcset on your page after a window.onresize event is triggered. This can assist you in debugging your implementation.
      The browser will always use the highest resolution image it has loaded or has cached. You may need to disable browser caching to determine whether your set rules are working, and it makes sense to work from a small screen size and up. If you do it the other way, the browser is going to continue to use the higher resolution image it loaded first.
      UIkit Features
      This module implements some additional features that are tailored towards UIkit being used as the front-end theme framework, but this is not required to use the module.
      Installation
      Download the zip file at Github or clone the repo into your site/modules directory. If you downloaded the zip file, extract it in your sites/modules directory. In your admin, go to Modules > Refresh, then Modules > New, then click on the Install button for this module. ProcessWire >= 3.0.123 is required to use this module.
×
×
  • Create New...