peut on trier en fonction des champs specifiques

More
13 years 3 weeks ago #19994 by ggppdk
Ok, I will give you the code you need but first note that:

The template files are meant to be editable by developers to customize them according to their needs, end users are meant to use only the graphical template editor to add remove fields.

For a template tutorial , please see here:
extensions.netassopro.com/9-tutorials


Better not to alter 'default' template files

So
1. go to template manager and duplicate the template, e.g. name the new template 'default1'
2. open file: components/com_flexicontent/templates/default1/category_items.php

find code:
Code:
<!-- BOF item 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 item fields -->

and replace with:
Code:
<!-- BOF item fields --> <?php $linkcols=array(4,6); $colcnt = 0; if ( $this->params->get('show_title', 1) ) $colcnt++; ?> <?php foreach ($columns as $name => $label) : ?> <td> <?php $colcnt++; if (in_array($colcnt, $linkcols)) echo "<a href='".JRoute::_(FlexicontentHelperRoute::getItemRoute($item->slug, $item->categoryslug))."'>"; echo isset($item->positions['table']->{$name}->display) ? $item->positions['table']->{$name}->display : ''; if (in_array($colcnt, $linkcols)) echo ""; ?> </td> <?php endforeach; ?> <!-- EOF item fields -->

CHANGE line:
$linkcols=array(4,6);

to put the columns you want to link to the item, above i have 4 and 6, you could leave only 4 or 6 :
$linkcols=array(4);

Do not put columns that have already links in them e.g. favourites or some other field that has url or javascript links in it.

If you need to do further modifications please read the tutorials.


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.321 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