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

Is This Custom Template Ok?


Best Answer Ricardo Moraleida, 25 April 2013 - 01:26 PM

Solved. Turns out I wasn't aware I needed a wrapper for everything.

Go to the full post


  • Please log in to reply
3 replies to this topic

#1 Ricardo Moraleida

Ricardo Moraleida

    Newbie

  • Members
  • Pip
  • 6 posts

Posted 25 April 2013 - 11:37 AM

I'm using this as gallery.tpl.php:

    <div class="video-list tubepress_container"  id="tubepress_gallery_<?php echo ${tubepress_api_const_template_Variable::GALLERY_ID}; ?>">
        
        <?php echo ${tubepress_api_const_template_Variable::PLAYER_HTML}; ?>
        
    </div>
    <div class="video-block tubepress_thumbnail_area" id="tubepress_gallery_<?php echo ${tubepress_api_const_template_Variable::GALLERY_ID}; ?>_thumbnail_area" >
        <div class="holder">
        <?php 
            $i = 0;

            foreach (${tubepress_api_const_template_Variable::VIDEO_ARRAY} as $video): 
                if(is_page('multimidia') && $i == 0) {

                } else {
                

                if($i % 2 == 0 && !is_page( 'multimidia' ))
                    echo '<div class="row">';
            ?>
                <div class="col">
                    <div class="visual">
                        <a id="tubepress_image_<?php echo $video->getId(); ?>_<?php echo ${tubepress_api_const_template_Variable::GALLERY_ID}; ?>" rel="tubepress_<?php echo ${tubepress_api_const_template_Variable::EMBEDDED_IMPL_NAME}; ?>_<?php echo ${tubepress_api_const_template_Variable::PLAYER_NAME}; ?>_<?php echo ${tubepress_api_const_template_Variable::GALLERY_ID}; ?>">
                            <img alt="<?php echo htmlspecialchars($video->getTitle(), ENT_QUOTES, "UTF-8"); ?>" src="<?php echo $video->getThumbnailUrl(); ?>" width="<?php echo ${tubepress_api_const_template_Variable::THUMBNAIL_WIDTH}; ?>" height="<?php echo ${tubepress_api_const_template_Variable::THUMBNAIL_HEIGHT}; ?>" />
                        </a>
                    </div>
                    <div class="about">
                        <a id="tubepress_image_<?php echo $video->getId(); ?>_<?php echo ${tubepress_api_const_template_Variable::GALLERY_ID}; ?>" rel="tubepress_<?php echo ${tubepress_api_const_template_Variable::EMBEDDED_IMPL_NAME}; ?>_<?php echo ${tubepress_api_const_template_Variable::PLAYER_NAME}; ?>_<?php echo ${tubepress_api_const_template_Variable::GALLERY_ID}; ?>">
                            <h4><?php echo htmlspecialchars($video->getTitle(), ENT_QUOTES, "UTF-8"); ?></h4>
                            <p><?php  echo $video->getDescription(); ?></p>
                        </a>
                    </div>
                </div>
                <?php

                

                if($i % 2 == 1 && !is_page( 'multimidia' ))
                    echo '</div>';

                ?>
        <?php } $i++; endforeach; ?>
        </div>
        <?php if (isset(${tubepress_api_const_template_Variable::PAGINATION_BOTTOM})) : echo ${tubepress_api_const_template_Variable::PAGINATION_BOTTOM}; endif; ?>
    </div>

and this as normal.tpl.php:

<?php 
/**
 * Copyright 2006 - 2013 TubePress LLC (http://tubepress.org)
 * 
 * This file is part of TubePress (http://tubepress.org)
 * 
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 */
?>
<div class="holder">
	<div class="visual">
		<?php echo ${tubepress_api_const_template_Variable::EMBEDDED_SOURCE}; ?>
	</div>
	<div class="txt">
		<div class="ttl">
			<h3><?php echo htmlspecialchars($video->getTitle(), ENT_QUOTES, "UTF-8"); ?></h3>
			<p><?php echo ${tubepress_api_const_template_Variable::VIDEO}->getDescription(); ?></p>
		</div>
		<img src="<?php echo get_template_directory_uri(); ?>/images/img-08.png" class="photo" alt="image" width="242" height="256" >
	</div>
</div>

Both files render correctly, with the videos and all. But my thumbnails don't work. I've followed the troubleshooting steps but still nothing - no console errors, no duplicate files. I'm sensing i might have lost something on the new templates. Is that it?

 

Also, tubepress_debug doesn't throw any errors, just regular messages as if everything was ok.



#2 Ricardo Moraleida

Ricardo Moraleida

    Newbie

  • Members
  • Pip
  • 6 posts

Posted 25 April 2013 - 01:19 PM

Reverted to using 

theme="default"

and it came back to life. So this is probably a template issue. I've double-checked the class names and ids of each div being used, added I had forgotten but thumbs are still dead. Any ideas?



#3 Ricardo Moraleida

Ricardo Moraleida

    Newbie

  • Members
  • Pip
  • 6 posts

Posted 25 April 2013 - 01:26 PM   Best Answer

Solved. Turns out I wasn't aware I needed a wrapper for everything.



#4 FranzVz

FranzVz

    Member

  • Members
  • PipPip
  • 17 posts

Posted 25 April 2013 - 10:41 PM

Nice job on figuring it out!

Don't be afraid to share your theme here to expand the community --> http://community.tubepress.com/files/