Display article/items in directory views

More
13 years 5 months ago #11849 by pembaris
Hi,

So I have finished our first phase of transferring previous documentations to our current ones; Powered by FlexiContent :)

www.jomsocial.com/support/docs.html

But next the goal is to achieve something like this -_-

farm5.static.flickr.com/4104/519 ... 6b90_o.jpg

Which is a bit tricky. I was thinking of customizing directory page than category so that search bar can be done by styling mod_search.

But how to display articles/items in directory views?

Can anyone share the code needed to edit this?

I have tried moving those codes from items.php/category_items.php to default_categories.php but none worked :(

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

More
13 years 5 months ago #11862 by micker
can you post your code ??
regards

FLEXIcontent is Free but involves a very big effort on our part.
Like the our support? (for a bug-free FC, despite being huge extension) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing reviews. Thanks![/size]

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

More
13 years 5 months ago #11872 by loicberder
hello pembaris,
i am trying to do that also for my FAQ, for weeks without success
looking forward if you achieve it
please let me know
loïc

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

More
13 years 5 months ago #11885 by pembaris
Code:
<?php /** * @version 1.5 stable $Id: default_categories.php 171 2010-03-20 00:44:02Z emmanuel.danan $ * @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' ); ?> <?php // Get the directory menu parameters $cols = $this->params->get('columns_count'); $c1 = $this->params->get('column1'); $c2 = $this->params->get('column2'); $c3 = $this->params->get('column3'); $i = 0; switch ($cols) { case 1 : $condition1 = ''; $condition2 = ''; $condition3 = ''; $style = ' style="width:100%;"'; break; case 2 : $condition1 = $c1; $condition2 = ''; $condition3 = ''; $style = ' style="width:47%;"'; break; case 3 : $condition1 = $c1; $condition2 = ($c1+$c2); $condition3 = ''; $style = ' style="width:31%;"'; break; case 4 : $condition1 = $c1; $condition2 = ($c1+$c2); $condition3 = ($c1+$c2+$c3); $style = ' style="width:24%;"'; break; } ?> <div class="column"<?php echo $style; ?>> <?php foreach ($this->categories as $sub) : ?> <div class="floattext"> <h2 class="flexicontent cat<?php echo $sub->id; ?>"> <a href="<?php echo JRoute::_( FlexicontentHelperRoute::getCategoryRoute($sub->slug) ); ?>"> <?php echo $this->escape($sub->title); ?> <?php if ($this->params->get('showassignated')) : ?> <span class="small"><?php echo $sub->assigneditems != null ? '('.$sub->assigneditems.')' : '(0)'; ?></span> <?php endif; ?> </h2> <ul class="catdets cat<?php echo $sub->id; ?>"> <?php foreach ($sub->subcats as $subcat) :?> <li> [url=<?php echo JRoute::_( FlexicontentHelperRoute::getCategoryRoute($subcat->slug) ); ?>]<?php echo $this->escape($subcat->title); ?>[/url] <?php if ($this->params->get('showassignated')) : ?> <span class="small"><?php echo $subcat->assignedsubitems != null ? '('.$subcat->assignedsubitems.'/'.$subcat->assignedcats.')' : '(0/'.$subcat->assignedcats.')'; ?></span> <?php endif; ?> </li> <?php endforeach; ?> </ul> </div> <?php $i++; if ($i == $condition1 || $i == $condition2 || $i == $condition3) : echo '</div><div class="column"'.$style.'>'; endif; endforeach; ?> </div> <div class="clear"></div>

So this is "Directory view" that I was looking at. To achieve display as below;

[img
Click for large view - Uploaded with Skitch

I tried loading items/articles respective to their subcategories/categories using some codes like:
Code:
<div id="category-items"> <ul> <?php foreach ($this->items as $item) : ?> <li>[url=<?php echo JRoute::_(FlexicontentHelperRoute::getItemRoute($item->slug, $item->categoryslug)); ?>]<?php echo $this->escape($item->title); ?>[/url]</li> <?php endforeach; ?> </ul> </div>

and
Code:
<?php <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 JText::_( 'FLEXI_ITEMS' ); ?></th> <?php foreach ($columns as $name => $label) : ?> <th id="field_<?php echo $name; ?>" scope="col"><?php echo $label; ?></th> <?php endforeach; ?> </tr> </thead> <tbody> <?php foreach ($this->items as $item) : ?> <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> ?>

but none of it works :(

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

More
13 years 5 months ago #12209 by loicberder
hello,
i have seen that you have finaly founded the way to display article/items in directory views for your site.
Can you help me on that ? sharing the template code ?
thanks in advance
Loïc

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

More
12 years 7 months ago #19481 by ggppdk
Hello pembaris, i have created a new template called faq, for flexicontent v1.5.6, it should also work with v1.5.4 and v1.5.5, although i did not test.

You can get from SVN or from here:
code.google.com/p/flexicontent/downloads/list

The template resembles the format you suggested./b]
Plus:
1. At the top the parent category of the subcategories is displayed in full width
2. The subcategories can be displayed in 1-4 columns
3. By default the item lists for each subcategory only include item title with an small arrow icon in front of them
4. You can add extra item fields to be displayed by editing the category layout of faq template at the template manager
5. Bellow each subcategory you can select whether to display the category description and whether to trim to a maximum length.
6. Next to category the category image is displayed, for now i did not put option to extra image for description, will do in future.
7. everything is inside a css class so that you can style the output as you please

NOTE: This a category view , not directory view, so you must remember to edit category and select 0 items per page and also choose parameters like whether to display category descriptions and the number of columns etc

Regards


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...

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

Moderators: vistamediajoomlacornerggppdk
Time to create page: 0.273 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