Log in | Register | Lost password

Bottom
Help with new Photoshare Template
  • Posted: 28.12.2005, 15:16
     
    Converted
    rank:
    12
    registered:
     March 2009
    Status:
    offline
    last visit:
    Posts:
    0
    I'm trying to build a Thumbnail-style template using the pnRender Stylish template and the PostNuke Example template as starting points, but am having some trouble and could use some advice.

    In template.php this is the show function:

    Code

    function show(&$output, $templateData, $templateHelper)

    {

    // This template is actually pnRender based, but needs to interface with

    // Photoshare via the "HTML" output class



    // Check for empty album

    if (count($templateData['images']) > 0)

    {

    $width = $image['xSize'];

    $height = $image['ySize'];



    $render = new pnRender('photoshare');

    $render->caching = false;

    foreach ($templateData as $k => $v)

    $render->assign($k, $v);

    $render->assign('templateData', $templateData);

    $render->assign('image', $templateData['images'][$templateData['initialImageIndex']]);



    $templateName = 'template_list.htm';

    $html = $render->fetch($templateName);



    $output->SetInputMode(_PNH_VERBATIMINPUT);

    $output->Text($html);

    $output->SetInputMode(_PNH_PARSEINPUT);

    }

    else

    {

    $output->LineBreak();

    $output->Text(_PTMP_LIST_EMPTYALBUM);

    }

    }

    }


    and the new pntemplate called template_list.htm looks like this:

    Code

    <!-- SPROG -->



    function handleOnClickImage(img)

    {

    var url = img.src.replace('viewimage','displayimage');

    url = url.replace('show','user');



    var width = <!--[$image.xSize]-->;

    var height = <!--[$image.ySize]-->;

    var imageWindow = window.open(url,'image','width='+width+',height='+height+',toolbar=0,location=0,directories=0,menuBar=0,scrollbars=0,resizable=0');

    imageWindow.focus();

    }



    <div class="photo">



    <table class="photo-content">

    <!--[section name="templateData" loop=$templateData]-->

    <tr>

    <td class="photo-image">

    <img src="<!--[photoshare_img image=$image.id]-->&thumbnail=1" class="main photoshare-clickable" OnClick="handleOnClickImage(this)"/>

    </td>

    <td class="photo-info">

    <table>

    <tr><td class="label"><!--[photoshare_extra field=1]-->:</td><td><!--[$image.extra1]--></td></tr>

    <tr><td class="label"><!--[photoshare_extra field=2]-->:</td><td><!--[$image.extra2]--></td></tr>

    <tr><td class="label"><!--[photoshare_extra field=3]-->:</td><td><!--[$image.extra3]--></td></tr>

    </table>



    <!--[$image.description]-->

    </td>

    </tr>

    <tr>

    <td colspan="2"><hr></td>

    </tr>

    <!--[/section]-->

    </table>

    </div>


    Right now the output is not looping through different image records, but is repeating the output of the first image record nine times.

    Here's my questions:

    1. What should I change to get one row of output per image record?

    2. What should I change to bring the user to an individual record using the Stylish template when they click on a thumbnail in this List template?

    Any help appreciated, thanks!



    edited by: trimble, Dec 28, 2005 - 08:19 AM

Template courtesy of Designs By Darren.