Dictionary template

More
14 years 4 months ago #1289 by dyvel
Dictionary template was created by dyvel
I'm looking for any help creating a category template to achieve a "Dictionary" like on this page www.demib.com/ordbog/

Would this be possible with flexicontent?

Btw, thanks for a really great component - it rocks!

Please Log in or Create an account to join the conversation.

More
14 years 4 months ago #1291 by dyvel
Replied by dyvel on topic Dictionary template
Ok, here is a "dirty" and quick solution for a dictionary. It doesn't work with alpha index right now, but solves my problem just fine.

What I did: Made a copy of the default template and renamed it dictionary

replace the code in category_items.php with this code:
Code:
<?php /** * @version 1.5 beta 5 $Id: default_items.php 85 2009-10-10 13:48:04Z vistamedia $ * @package Joomla * @subpackage FLEXIcontent * @copyright (C) 2009 Emmanuel Danan - www.vistamedia.fr * @license GNU/GPL v2 * * FLEXIcontent is a derivative work of the excellent QuickFAQ component * @copyright (C) 2008 Christoph Lukes * see www.schlu.net for more information * * FLEXIcontent is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. */ defined( '_JEXEC' ) or die( 'Restricted access' ); // first define the template name $tmpl = $this->tmpl; ?> <form action="<?php echo $this->action; ?>" method="post" id="adminForm"> <?php $letters = array('a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'); ?> <?php if ($this->items) : // routine to determine all used columns for this table $columns = array(); foreach ($this->items as $item) : if (isset($item->positions['table'])) : foreach ($item->positions['table'] as $pos) : if (!in_array($pos->name, $columns)) : $columns[$pos->name] = $item->fields[$pos->name]->label; endif; endforeach; endif; endforeach; ?> <input type="hidden" name="option" value="com_flexicontent" /> <input type="hidden" name="filter_order" value="<?php echo $this->lists['filter_order']; ?>" /> <input type="hidden" name="filter_order_Dir" value="" /> <input type="hidden" name="view" value="category" /> <input type="hidden" name="letter" value="" id="alpha_index" /> <input type="hidden" name="task" value="" /> <input type="hidden" name="id" value="<?php echo $this->category->id; ?>" /> </form> <?php foreach ($letters as $letter) : if (in_array($letter, $this->alpha)) : ?> <table id="flexitable" class="flexitable" width="100%" border="0" cellspacing="0" cellpadding="0" summary="<?php echo $this->category->name; ?>"> <thead> <tr> <th id="flexi_title" scope="col"><?php echo strtoupper($letter); ?></th> </tr> </thead> <tbody> <?php foreach ($this->items as $item) : ?> <?php if (strtoupper($item->title{0}) == strtoupper($letter)) { ?> <tr class="sectiontableentry"> <!-- BOF item title --> <th scope="row" class="table-titles"> <?php if ($this->params->get('link_titles', 0)) : ?> [url=<?php echo JRoute::_(FlexicontentHelperRoute::getItemRoute($item->slug, $this->category->slug)); ?>]<?php echo $this->escape($item->title); ?>[/url] <?php else : echo $this->escape($item->title); endif; ?> </th> <!-- BOF item title --> <!-- BOF fields --> <?php foreach ($columns as $name => $label) : ?> <td><?php echo isset($item->positions['table']->{$name}->display) ? $item->positions['table']->{$name}->display : ''; ?></td> <?php endforeach; ?> <!-- EOF fields --> </tr> <?php } endforeach; ?> </tbody> </table> <?php endif; endforeach; ?> <?php else : ?> <div class="noitems"><?php echo JText::_( 'FLEXI_NO_ITEMS_CAT' ); ?></div> <?php endif; ?>

I hope you can use it and perhaps extend it...
Again - thanks for a great component

See it in action here (work in progress):
solar7group.com/ordbog.html

Please Log in or Create an account to join the conversation.

More
14 years 4 months ago #1297 by bsky92
Replied by bsky92 on topic Dictionary template
Thanks, nice work, I may use something like that :)

Please Log in or Create an account to join the conversation.

More
14 years 3 months ago #2825 by Linuus
Replied by Linuus on topic Dictionary template
It would be nice to achieve this at the Directory template.

So, the categories would be grouped as the items in your template.

Could anyone help me, or push me in the right direction? :)

I'm a little lost...

Please Log in or Create an account to join the conversation.

Moderators: vistamediajoomlacornerggppdk
Time to create page: 0.275 seconds
Save
Cookies user preferences
We use cookies to ensure you to get the best experience on our website. If you decline the use of cookies, this website may not function as expected.
Accept all
Decline all
Essential
These cookies are needed to make the website work correctly. You can not disable them.
Display
Accept
Analytics
Tools used to analyze the data to measure the effectiveness of a website and to understand how it works.
Google Analytics
Accept
Decline