Jump to content

Media Manager


kongondo

Recommended Posts

Hi @RyanJ,

13 hours ago, RyanJ said:

if they are even replacing an image on upload? 

No, unless they have access to the settings or set the setting themselves or have been informed about the setting.

13 hours ago, RyanJ said:

which image they are replacing

The image they are replacing is one that has an identical name. The image name is is used to create the media title.

Link to comment
Share on other sites

  • 2 months later...

Having a problem displaying images on the front end.

I've just purchased MediaManager and have successfully imported a heap of images. Now I am trying to include a MM image and display it via an existing template.

The steps I have followed thus far:
1. Add a new textarea field to the existing template - named PortfolioImage
2. Edit a page and insert a single image into the PortfolioImage field, by selecting a MM image. The image shows up in the edit page.
3. In the template file I added the following line:
             if($page->PortfolioImage) echo "<img src='{$page->PortfolioImage}' class='mainimageH' alt='$page->headline'>";
4. The output I get for that line is: <img src='&lt;p&gt;&lt;img alt=&quot;&quot; class=&quot;hidpi&quot; src=&quot;/landscapes/site/assets/files/1500/ql033n.jpg&quot; width=&quot;1200&quot; /&gt;&lt;/p&gt;' class='mainimageH' alt='some text'>

If I have <img src='{$page->PortfolioImage->url}' instead Tracey Debugger shows this error message:  

PHP Notice: Trying to get property 'url' of non-object in .../web/landscapes/site/templates/photos.php:10

I am clearly doing something wrong. Can anyone point me in the right direction please?

PW 3.0.165, MM 0.1.2, PHP: 7.3.16

Link to comment
Share on other sites

1 hour ago, Rob(AU) said:

I've just purchased MediaManager and have successfully imported a heap of images.

Many thanks for the purchase.

1 hour ago, Rob(AU) said:

If I have <img src='{$page->PortfolioImage->url}' instead Tracey Debugger shows this error message:  


PHP Notice: Trying to get property 'url' of non-object in .../web/landscapes/site/templates/photos.php:10

This is because your PortfolioImage is not a file or image field. It is a textarea field. Textarea fields do not have a url property. 

It is not clear to me how you want to display your MM image (i.e. inside a textarea, e.g. CKEditor) or independently of the textarea (i.e., some_media_manager_field->url). I am not sure if you have seen Media Manager's documentation? If not, please have a look at that first. 

Thanks.

Link to comment
Share on other sites

@kongondo now that I have had time to explore a bit more it is making more sense - I had a few family things that interrupted ... male, multi-tasking ... epic fail

I am using PW 3.0.165 and ran into the images not appearing to upload issue, but only on the live site, but that is not causing an issue now.

Is it possible to do something similar to the following using the image media?
echo "<img srcset='{$page->image->srcset('2500x0,/2,/3,/4')}' class='mainimageH' alt='$page->headline'>";

I found a way while writing this. It maybe not elegant, but I'm sharing as it may be helpful in the future.

Quote

foreach($page->photo as $photo) {
  $imgsrcset = $photo->media->srcset('2500x0,/2,/3,/4');
}
     $out = "";
     $out .=  "<img srcset='$imgsrcset' class='mainimageH' alt='$page->headline'>";
     echo $out;
 

 From reading the documentation there are hints about image variations. Is this something designed to provide different images sizes for varying viewport dimensions?

 

Link to comment
Share on other sites

15 hours ago, Rob(AU) said:

I found a way while writing this. It maybe not elegant, but I'm sharing as it may be helpful in the future.

Glad you got it sorted :-).

15 hours ago, Rob(AU) said:

$imgsrcset = $photo->media->srcset('2500x0,/2,/3,/4');

I have never used srcset myself (I think it is a third-party module?) but this should work since media is a Pageimage object in this case.

15 hours ago, Rob(AU) said:

From reading the documentation there are hints about image variations. Is this something designed to provide different images sizes for varying viewport dimensions?

This is used in the ProcessWire sense of image variations as briefly explained here. Whilst you can certainly utilise variations for responsive designs, they are not limited to that use.

  • Like 1
Link to comment
Share on other sites

  • 4 months later...

@kongondowe bought media manager a couple of days ago and are happy so far. but i have one very severe bug and a feature request 🙂

bug: i cant switch pages. when i click on the arrow or page number 2 on the items list i get this error:
{"error":false,"message":"Unknown Lister action"}

so navigation is not possible. pw is latest dev 3.0.187 -> this is obviously a severe bug

feature: 

it would be great if we could save bookmarks for the filter, like the standard lister can. our customer will need to do similar searches over and over and it would be nice if they could store the important ones

Link to comment
Share on other sites

1 hour ago, csaggo.com said:

we bought media manager a couple of days ago and are happy so far

Hi @csaggo.com,

Many thanks for the purchase.

1 hour ago, csaggo.com said:

but i have one very severe bug

Not a great start for MM! 😉.

1 hour ago, csaggo.com said:

bug: i cant switch pages. when i click on the arrow or page number 2 on the items list i get this error:
{"error":false,"message":"Unknown Lister action"}

I'll have a look but very much likely something to do with your environment or the install went bonkers. This hasn't been reported recently. I'll test and get back to you. Before, that, please give me more information about your environment, i.e. 3rd-party modules and multilingual or not thanks.

1 hour ago, csaggo.com said:

it would be great if we could save bookmarks for the filter, like the standard lister can.

Currently this is not available as you've noted. However, you can save filter profiles. Please see the docs here, in case you missed it.

Thanks.

Link to comment
Share on other sites

8 minutes ago, kongondo said:

I'll have a look but very much likely something to do with your environment or the install went bonkers. This hasn't been reported recently. I'll test and get back to you. Before, that, please give me more information about your environment, i.e. 3rd-party modules and multilingual or not thanks.

thanks @kongondofor getting back so quickly. pw is 3.0.187 as mentioned, we use multilanguage indeed. we also use multisite (so basically we change the root-homepage with https://github.com/somatonic/Multisite/ based on domain-name) but my guess is, that its not relevant for backend.

but you are right, the standard page-lister from the pages menü cant switch to page 2 either, so its a pw or setup issue... i will try to figure it out with ryan.

also thank you for the doc-link i indeed missed that. perfekt 🙂

  • Like 1
Link to comment
Share on other sites

3 minutes ago, csaggo.com said:

but you are right, the standard page-lister from the pages menü cant switch to page 2 either, so its a pw or setup issue... i will try to figure it out with ryan.

Glad you've at least isolated the cause of the problem. If you find a solution, please let me know if there's anything I need to do on MM side. Thanks.

  • Like 1
Link to comment
Share on other sites

@ryan my i draw your attention to https://github.com/processwire/processwire-issues/issues/1447
thats quite a big deal for us "internationals" as it affects every place where the page Lister Module is used.

i first thought it was in media manager but later noticed that its also in the page/lister/ and so on in the backend:
bug: i cant switch pages. when i click on the arrow or page number 2 on the items list i get this error:
{"error":false,"message":"Unknown Lister action"}

 

  • Like 1
Link to comment
Share on other sites

  • 3 weeks later...
On 6/11/2020 at 11:56 PM, kongondo said:

Did you install Media Manager in a subfolder? If yes, sorry, it's a bug that occurs if you've installed Media Manager in a subfolder. It got fixed a while back but I haven't committed yet. For now, please do this:

Change this line in ProcessMediaManager.module around line #154:

"template=media-manager-settings, parent={$path},include=hidden"

to this:

"template=media-manager-settings,include=hidden"

If that's not it, then please supply more details about your setup. 

Thanks.

Hi @kongondo, thanks fo your plugin, I just bought and installed it and am now setting things up. Just wanted to let you know I had this same problem and this fix worked for me, but I don't have Media Manager installed in a subfolder (I think). My setup is: localhost (MAMP), Media Manager is installed in Applications/MAMP/htdocs/website/site/modules/MediaManager. When I move on to the live site I will let you know if it happens there as well. If you have any questions to help find out more about this bug let me know.

edit: I'm using PW 3.0.165 and MM v0.1.2 β

Edited by wwwouter
  • Like 1
Link to comment
Share on other sites

19 hours ago, wwwouter said:

I just bought and installed it and am now setting things up.

Thanks for the purchase.

19 hours ago, wwwouter said:

Just wanted to let you know I had this same problem and this fix worked for me

Thanks for confirming.

19 hours ago, wwwouter said:

When I move on to the live site I will let you know if it happens there as well. If you have any questions to help find out more about this bug let me know.

Thanks for this. Please do let us know how it goes.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...