How can I filter a blog view to display only future events?

More
12 years 9 months ago #28705 by ggppdk
What if FLEXIcontent module had
-(a) pagination and
-(b) order by custom field?

you not be able to use a category template
but
you could copy the news.php module template and shape close to your needs


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

More
12 years 9 months ago #28709 by grabit
Yes but I find the module a bit slower than the blog. (it is only an impression).

But I think I am close to find the solution with the Micker proposal the only problem is the datetime and the Timezone problem. This was not present in Joomla 1.5 and FC 1.5.6.
Code:
<?php for ($i=0; $i<$leadnum; $i++) : $enddate = $items[$i]->fields['Dfin']->display; $enddate = new DateTime($enddate); $enddate = $enddate->format('Ymd'); $now = date('Ymd', strtotime('+1 day')); if( $now <= $enddate) : ?>

new DateTime($enddate); gives me an error 500 with this message:

DateTime::__construct(): Failed to parse time string (9 janvier 2013) at position 5 (v): The timezone could not be found in the database


An Apple a days keeps the doctor away

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

More
12 years 9 months ago #28724 by micker
oups my solution is for fc 1.5.6 .. sorry

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
12 years 9 months ago #28726 by ggppdk
What is the format of your date field??

- first go to the edit flexicontent field and make sure it is outputting in a acceptable format, e,g for J2.5:
(a) select custom format,
(b) with format string d/m/Y

then if you have some dates that maybe invalid

you could use :
Code:
try { $enddate = new DateTime($enddate); } catch(Exception $e) { // catches 'Failed to parse time string $enddate = false; // Do not use this }


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

More
12 years 9 months ago #28731 by micker
my format is
%Y%m%d
paybe the problem ;)

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
12 years 9 months ago #28737 by grabit
Well with the code from GGPPDK the error 500 is gone but now I have a white page with 3 articles and I lost all my website around flexicontent.

Here is a picture with part of the output code underneath.

[attachment=0:2yk8jg7w]<!-- ia0 -->Capture d’écran 2012-09-20 à 11.14.02.png<!-- ia0 -->[/attachment:2yk8jg7w]

An Apple a days keeps the doctor away
Attachments:

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

Moderators: vistamediajoomlacornerggppdk
Time to create page: 0.399 seconds
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
Save