Jump to content

how enable modules


Mable
 Share

Recommended Posts

I installed 2 modules but I can figure out how to make them activated.

Player Plyr
Photoswipe Gallery

<!doctype html>
<html>
  <head>
    <title><?php echo $page->title; ?></title>
  </head>
  <body>
    <h1><?php echo $page->title; ?></h1>
    <h2>Type: <?php echo $page->planet_type; ?>,
        Age: <?php echo $page->planet_age; ?> years</h2>
    <p><?php echo $page->planet_summary; ?></p>

    <?php 
    $pwpswp = $modules->get('MarkupProcesswirePhotoswipe');
    echo $pwpswp->renderGallery();

    $plyr = $modules->get("MarkupPlyrMediaPlayer");
    echo $plyr->renderVideoPlayer($poster, $mp4, $webm, $captions);
    ?>
    
  </body>
</html>

I tried to test on a test page. I added the code as it was written in the tutorial.
In the admin panel, I created the fields and connect them to the template. Then through these fields I tried to upload videos and pictures but they did not appear in my template. What am I doing wrong?

 

Field Plyr 3.jpg

Field Plyr 2.jpg

Field Plyr.jpg

Link to comment
Share on other sites

  • Did you notice that one of those modules is not officially stated as compatible with PW3?
  • You should always post module-specific questions in their dedicated support forums, instead of creating a new thread (the blue button on the official module page at the left)
  • At quick glance, I noticed you are not supplying the page field for your Photoswipe gallery. 
On 6/26/2019 at 8:53 AM, Mable said:

echo $pwpswp->renderGallery();

It should be:

echo $pwpswp->renderGallery($page->nicePictures); // or whatever you've called your images-field...

  • I have never used any of those two modules. But a potential "gotcha" with outputting files in a template is if you're allowing just one single file or multiple. If you expect an array of items, use $page->fieldName->first()->url (in case of the video file). Depending on your field-settings, you can use one method or another, i.e. if it's set to 1 file only, you can use $page->fieldName->url etc.
  • Do you get errors? If you're in debug mode, you should see errors appearing. Also look at the browser console for JS errors.
  • Finally, if you use Tracy Debugger, you should get hints and more extensive debugging infos.
  • Thanks 1
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...