Didelot

BT CONTENT SLIDER MODULE- sorted articles request

8 posts in this topic

Hi everyone ! :)

I have a request to make. Is it possible in the future release for the BT CONTENT SLIDER MODULE, in the Content settings to make more sorted articles option ?

Maybe the thing that i want to do is already possible but i don't know how to do it, I want to sort articles in the order i called them.

For example :

I use articles_ids option with the articles (id) 1,7,94,2,65 ...

And I want articles to be sort in the same way.

How can i do that ?

Thanks

Florent

Share this post


Link to post
Share on other sites

Hi there.

I have seen few person ask this feature.

But i have a question,

Why do you set ordering for these article for example:

Article ID | Ordering

1 1

2 4

7 2

65 5

94 3

So you can enter these ID in any ordering.

You only need to choose Article sort by Ordering ASC

I hope this reply will help you.

Share this post


Link to post
Share on other sites

Hi tronghm !

thank you for your fast replie :)

I already order my articles in FlexiContent component in this way :

(for exeample)

Article ID | Ordering (in FlexiContent)

186 0

52 1

218 2

84 3

Then in Bt Content Slider I used Article Id option with 186,52,218,84 .....

I choosed sort by Ordering ASC option

But it still not working, The articles are sort by ID ASC like 218,186,84,52 ...

Is it cause of FlexiContent ? it begin by 0 and i cant replace 0 by any number ...

Florent

PS : [There is a traduction error in Bt Content slider, Ordering is not "Commande" in french in this case but "Ordonner"]

Share this post


Link to post
Share on other sites

Hi there.

I don't thing so.

I have a question these articles are in a category or different categories.

I test this problem in case all chosen article in a category, they are sorted right follow ordering.

If they are in different categories, they are sorted by categories first then sorted by ordering after.

Share this post


Link to post
Share on other sites

Hi,

I have the same question - my articles are in different categories.

Can I make a php override?

So if they are in different categories or not - they should always be sorted like the order I type them in (1,3,6,4).

Is this possible to program? Where?

Kind regards Axel

Share this post


Link to post
Share on other sites

Ok.

I will give you this solution, it is not perfect solution but it will help you.

Please open file mod_bt_contentslider/classes/content.php

Find this line

return items;

Add this code to right above it

//var_dump($items);

if($source == 'article_ids'){

$ids = preg_split('/,/', $params->get('article_ids', ''));

$tmpItems = array();

foreach ($ids as $id) {

$id = (int) trim($id);

foreach($items as $key => $a){

if($a->id == $id){

$tmpItems[] = $a;

unset($items[$key]);

break;

}

}

}

$items = $tmpItems;

}

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now