Results 1 to 2 of 2

Thread: Custom List Template (custom edit buttons)

  1. #1
    New user
    Join Date
    02-12-10.
    Posts
    7

    Default Custom List Template (custom edit buttons)

    Hi All

    I'm currently trying to edit my list template (catalog_simpletable.tpl) and have moved the linkEdit part around, as shown below. The reason is to move the editing link in with the entries displayed in the listing module. You can see the end result at http://www.morvargh-sailing.co.uk/in...teractive.html and log in as "test" and "testuser" as the password.

    What i'd like to be able to do is display an icon instead of the "edit the item details" and on only the progress and status columns in the table and not all the entries as it is at present. I think this is possible by writing a custom template in PHP but as a complete numpty when it comes to programming i'm at a bit of a loss.

    Any help people could give is greatly appreciated!

    Code:
    <?php if (count($this->entries)): ?>
    
    <table class="layout_simpletable" summary="Catalog Items" cellspacing="0" cellpadding="0">
    <thead class="header">
    <tr>
    <?php list($field, $heading) = each($this->entries); ?>
    <?php foreach ($heading['data'] as $field=>$data): ?>
    <?php if (!in_array($field, array('catalog_name','parentJumpTo'))): ?>
    <th class="head<?php echo $field; ?>"><?php echo $data['label']; ?></th>
    <?php endif; ?>
    <?php endforeach; ?>
    </tr>
    </thead>
    <tbody class="body<?php echo $entry['class'] ? ' '.$entry['class'] : ''; ?>">
    <?php foreach ($this->entries as $entry): ?>
    <tr class="item<?php echo $entry['class'] ? ' '.$entry['class'] : ''; ?>">
    <?php foreach ($entry['data'] as $field=>$data): ?>
    <?php if (!in_array($field, array('catalog_name','parentJumpTo'))): ?>
    	<td class="<?php echo $field; ?>"><?php if (strlen($data['value'])): ?>
    <?php echo $data['value']; ?>
    <?php if ($entry['linkEdit']): ?>
    <div class="edit"><div class="linkEdit"><?php echo $entry['linkEdit']; ?></div>
    <?php endif; ?>
    <?php endif; ?>
    </td>
    <?php endif; ?>
    <?php endforeach; ?>
    <?php if ($entry['showLink'] && $entry['link']):  ?>
    <td class="link"><div class="link"><?php echo $entry['link']; ?></div></td>
    <?php endif; ?>
    </tr>
    <?php endforeach; ?>
    </tbody>
    </table>
    
    <?php else: ?>
    
    <?php if ($this->condition): ?>
    <div class="condition"><?php echo $this->condition; ?></div>
    <?php else: ?>
    <p class="info">There are no entries matching your search.</p>
    <?php endif; ?>
    
    <?php endif; ?>
    Wha

  2. #2
    User MacKP's Avatar
    Join Date
    06-19-09.
    Location
    Duisburg (Germany)
    Posts
    211

    Default Re: Custom List Template (custom edit buttons)

    Hi sailormatt,
    have you read this tutorial from thyon? -> http://code.google.com/p/typolight-cata ... esTutorial

    Maybe this could help you also: http://de.contaowiki.org/Catalog_Templa ... reibung.29
    It's in german, but the code is the same in english ;-)
    There is an example where you can change only one field in the output.

    regards
    Mediendepot Ruhr
    For real-time chat the (inofficial) Chatroom in IRC:
    -> irc.freenode.net #contao | irc.freenode.net #contao.de

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •