making plugin-related post stick in 3rd position
Posted: Tue Apr 19, 2016 6:48 pm
Hello once more,
I'm running a simple question and answer plugin on my site. The first question went online in march. See http://www.multikulinarisch.es/1044-ges ... e-mrz.html
As long as there is no newer question (sitting in position 1, 2 or 3), I'd like it to stick the last question post (or an additional piece called current question linking to entry 1044) in position 3 of the entries list http://www.multikulinarisch.es.
I tried to use my plugin's entries_header hook in order to somehow exchange positions within the entries array before it gets displayed. So far I managed to retrieve the current position of the latest question post, its timestamp and entryId. Unfortunately there seems to be no $entries I could manipulate and $eventData array is way to complex at this point. Therefore I have no idea whether or how this could be achieved.
If at all possible, the swapping would have to take place before entries.tpl displays the foreach part or even better, before $entries gets assigned to $serendipity['smarty']. Another possible solution might be using javascript.
I'd like to hear your ideas and thoughts on this.
peggylon
I'm running a simple question and answer plugin on my site. The first question went online in march. See http://www.multikulinarisch.es/1044-ges ... e-mrz.html
As long as there is no newer question (sitting in position 1, 2 or 3), I'd like it to stick the last question post (or an additional piece called current question linking to entry 1044) in position 3 of the entries list http://www.multikulinarisch.es.
I tried to use my plugin's entries_header hook in order to somehow exchange positions within the entries array before it gets displayed. So far I managed to retrieve the current position of the latest question post, its timestamp and entryId. Unfortunately there seems to be no $entries I could manipulate and $eventData array is way to complex at this point. Therefore I have no idea whether or how this could be achieved.
If at all possible, the swapping would have to take place before entries.tpl displays the foreach part or even better, before $entries gets assigned to $serendipity['smarty']. Another possible solution might be using javascript.
I'd like to hear your ideas and thoughts on this.
peggylon