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
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Similar Content

    • By monollonom
      (once again I was surprised to see a work of mine pop up in the newsletter, this time without even listing the module on PW modules website 😅. Thx @teppo !)
      FieldtypeQRCode
      Github: https://github.com/romaincazier/FieldtypeQRCode
      Modules directory: https://processwire.com/modules/fieldtype-qrcode/
      A simple fieldtype generating a QR Code from the public URL of the page, and more.
      Using the PHP library QR Code Generator by Kazuhiko Arase.

      Options
      In the field’s Details tab you can change between .gif or .svg formats. If you select .svg you will have the option to directly output the markup instead of a base64 image. SVG is the default.
      You can also change what is used to generate the QR code and even have several sources. The accepted sources (separated by a comma) are: httpUrl, editUrl, or the name of any text/URL/file/image field.
      If LanguageSupport is installed the compatible sources (httpUrl, text field, ...) will return as many QR codes as there are languages. Note however that when outputting on the front-end, only the languages visible to the user will be generated.
      Formatting
      Unformatted value
      When using $page->getUnformatted("qrcode_field") it returns an array with the following structure:
      [ [ "label" => string, // label used in the admin "qr" => string, // the qrcode image "source" => string, // the source, as defined in the configuration "text" => string // and the text used to generate the qrcode ], ... ] Formatted value
      The formatted value is an <img>/<svg> (or several right next to each other). There is no other markup.
      Should you need the same markup as in the admin you could use:
      $field = $fields->get("qrcode_field"); $field->type->markupValue($page, $field, $page->getUnformatted("qrcode_field")); But it’s a bit cumbersome, plus you need to import the FieldtypeQRCode's css/js. Best is to make your own markup using the unformatted value.
      Static QR code generator
      You can call FieldtypeQRCode::generateQRCode to generate any QR code you want. Its arguments are:
      string $text bool $svg Generate the QR code as svg instead of gif ? (default=true) bool $markup If svg, output its markup instead of a base64 ? (default=false) Hooks
      Please have a look at the source code for more details about the hookable functions.
      Examples
      $wire->addHookAfter("FieldtypeQRCode::getQRText", function($event) { $page = $event->arguments("page"); $event->return = $page->title; // or could be: $event->return = "Your custom text"; }) $wire->addHookAfter("FieldtypeQRCode::generateQRCodes", function($event) { $qrcodes = $event->return; // keep everything except the QR codes generated from editUrl foreach($qrcodes as $key => &$qrcode) { if($qrcode["source"] === "editUrl") { unset($qrcodes[$key]); } } unset($qrcode); $event->return = $qrcodes; })
    • By Sebi
      AppApiFile adds the /file endpoint to the AppApi routes definition. Makes it possible to query files via the api. 
      This module relies on the base module AppApi, which must be installed before AppApiFile can do its work.
      Features
      You can access all files that are uploaded at any ProcessWire page. Call api/file/route/in/pagetree?file=test.jpg to access a page via its route in the page tree. Alternatively you can call api/file/4242?file=test.jpg (e.g.,) to access a page by its id. The module will make sure that the page is accessible by the active user.
      The GET-param "file" defines the basename of the file which you want to get.
      The following GET-params (optional) can be used to manipulate an image:
      width height maxwidth maxheight cropX cropY Use GET-Param format=base64 to receive the file in base64 format.
    • By MarkE
      This fieldtype and inputfield bundle was built for storing measurement values within a field, rendering them in a variety of formats and converting them to other units or otherwise modifying them via the API.
      The API consists of a number of predefined functions, some of which include...
      render() for rendering the measurement object, valueAs() for converting the value to another unit value, convertTo() for converting the whole measurement object to different units, and add() and subtract() for for modifying the stored value by the value (converted as required) in another measurement. In the admin the inputfield includes a checkbox (which can be optionally disabled) for converting values on page save. For an example if a value was typed in as centimeters, the unit was changed to metres, and the page saved with this checkbox selected, said value would be automatically converted so that e.g. 170 cm becomes 1.7 m.

      A simple length field using Fieldtype Measurement and Inputfield Measurement.
      Combination units (e.g. feet and inches) are also supported.
      Please note that this module is 'proof of concept' at the moment - there are limited units available and quite a lot of code tidying to do. More units will be added shortly.
      See the GitHub at https://github.com/MetaTunes/FieldtypeMeasurement for full details and updates.
    • By tcnet
      File Manager for ProcessWire is a module to manager files and folders from the CMS backend. It supports creating, deleting, renaming, packing, unpacking, uploading, downloading and editing of files and folders. The integrated code editor ACE supports highlighting of all common programming languages.
      https://github.com/techcnet/ProcessFileManager

      Warning
      This module is probably the most powerful module. You might destroy your processwire installation if you don't exactly know what you doing. Be careful and use it at your own risk!
      ACE code editor
      This module uses ACE code editor available from: https://github.com/ajaxorg/ace

      Dragscroll
      This module uses the JavaScript dragscroll available from: http://github.com/asvd/dragscroll. Dragscroll adds the ability to drag the table horizontally with the mouse pointer.
      PHP File Manager
      This module uses a modified version of PHP File Manager available from: https://github.com/alexantr/filemanager
       
    • By tcnet
      This module implements the website live chat service from tawk.to. Actually the module doesn't have to do much. It just need to inserted a few lines of JavaScript just before the closing body tag </body> on each side. However, the module offers additional options to display the widget only on certain pages.
      Create an account
      Visit https://www.tawk.to and create an account. It's free! At some point you will reach a page where you can copy the required JavaScript-code.

      Open the module settings and paste the JavaScript-code into the field as shown below. Click "Submit" and that's all.

      Open the module settings
      The settings for this module are located int the menu Modules=>Configure=>LiveChatTawkTo.

       
×
×
  • Create New...