Jump to content


These Forums Are Now Read-Only


For TubePress support, please post a question here or open a support ticket and we will be glad to assist.


Photo

How Can I Display The Total Numbers Of Files(videos)


Best Answer eric, 15 May 2015 - 05:40 PM

This should be very easy with TubePress now, and upgrade safe. Here's what to do:

  • Create and activate your own TubePress theme (docs for WordPress or standalone PHP). The "Theme Tutorial" should get you up and running quickly.
     
  • Open up your theme's gallery/main template with your favorite text editor. Inside you'll see a theme variable called mediaPage. For instance around line 109 of gallery/main.html.twig you'll see
    {% for mediaItem in mediaPage.items %}
  • You can type {{ mediaPage.totalResultCount }} wherever you'd like to print out the total result count. For instance:
    We found {{ mediaPage.totalResultCount }} video(s) matching your search.
    
    {% for mediaItem in mediaPage.items %}
    
    ...
    
  • Rebuild your system cache once since you edited a template.

That should do it. Give it a try?

Go to the full post


  • Please log in to reply
7 replies to this topic

#1 mkernal

mkernal

    Member

  • Members
  • PipPip
  • 24 posts
  • LocationToronto, ON, CANADA

Posted 12 February 2014 - 04:44 PM

hello,

 

 

say i call the following in a page called "Interviews"

 

[tubepress mode="tag" tagValue="beatboxing tutorials" playerLocation="popup" resultsPerPage="44"]

 

 

How can I also add and display the total number of files for that page???



#2 brandon

brandon

    Advanced Member

  • TubePress Staff
  • 1989 posts

Posted 13 February 2014 - 12:53 AM

Hi mkernal,

 

So you want to be able to display the resultsPerPage=44 on your site? or the total number of videos returned by tubepress?

 

Thanks!


Want a faster, more personalized support experience? Open a ticket with us! We will be gradually phasing out forum-based support in favor of a proper ticketing system. Please help us help you!


#3 mkernal

mkernal

    Member

  • Members
  • PipPip
  • 24 posts
  • LocationToronto, ON, CANADA

Posted 17 February 2014 - 03:55 PM

hi there! :)

 

I would like it to return the total number of videos returned by tubepress 



#4 brandon

brandon

    Advanced Member

  • TubePress Staff
  • 1989 posts

Posted 19 February 2014 - 05:40 PM

Hello,

 

I will have to ask our developers how you can display this.

 

Thank you for your patience.


Want a faster, more personalized support experience? Open a ticket with us! We will be gradually phasing out forum-based support in favor of a proper ticketing system. Please help us help you!


#5 eric

eric

    Lead Developer

  • TubePress Staff
  • 2787 posts

Posted 26 February 2014 - 04:30 PM

This can be "hacked" together fairly quickly with the following two steps:

  • Edit this file with your favorite text editor. You'll want to add the following single line right near the bottom:
    $template->setVariable('totalVideos', $videoGalleryPage->getTotalResultCount());
  • In your copy of tubepress_pro_x_y_z/src/main/resources/default-themes/default/gallery.tpl.php, add the following anywhere you'd like the result to show up:
    <?php echo $totalVideos; ?>

Please note that you will need to redo these changes when you upgrade TubePress. We are working on a new version of TubePress right now that has much better support for this type of customization. Expect it to be out in the next 2 weeks or so!



#6 mkernal

mkernal

    Member

  • Members
  • PipPip
  • 24 posts
  • LocationToronto, ON, CANADA

Posted 14 May 2015 - 08:06 PM

I now have version 4.1.8

How am I able to display the value for the total # of videos available for a section??

 

Thanks As Always!!

 

Michael



#7 brandon

brandon

    Advanced Member

  • TubePress Staff
  • 1989 posts

Posted 14 May 2015 - 08:35 PM

Michael,

 

I've referred this to our developers.

 

Thanks!


Want a faster, more personalized support experience? Open a ticket with us! We will be gradually phasing out forum-based support in favor of a proper ticketing system. Please help us help you!


#8 eric

eric

    Lead Developer

  • TubePress Staff
  • 2787 posts

Posted 15 May 2015 - 05:40 PM   Best Answer

This should be very easy with TubePress now, and upgrade safe. Here's what to do:

  • Create and activate your own TubePress theme (docs for WordPress or standalone PHP). The "Theme Tutorial" should get you up and running quickly.
     
  • Open up your theme's gallery/main template with your favorite text editor. Inside you'll see a theme variable called mediaPage. For instance around line 109 of gallery/main.html.twig you'll see
    {% for mediaItem in mediaPage.items %}
  • You can type {{ mediaPage.totalResultCount }} wherever you'd like to print out the total result count. For instance:
    We found {{ mediaPage.totalResultCount }} video(s) matching your search.
    
    {% for mediaItem in mediaPage.items %}
    
    ...
    
  • Rebuild your system cache once since you edited a template.

That should do it. Give it a try?