Show an article multiple time according to date field

More
8 years 10 months ago #59404 by nowid50
Hello,

I am trying to make an event list. I am facing a simple problem, my client wants to show an item per day.

I have a content type "Event" with a field "Date" with multiple values. And I would like to have an item per value of this field.

For example, I have two events :
  1. Music with some artist, dates : 2016-01-14,2016-01-15
  2. Cycling around the lake, dates : 2016-01-15

These two items would show 3 items in the category view :
  • Music with some artist (2016-01-14)
  • Music with some artist (2016-01-15)
  • Cycling around the lake(2016-01-15)

Is it possible to do it easily with Flexicontent or do I need to do one article per day ?

Thanks in advance.

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

More
8 years 10 months ago #59411 by ggppdk
Hello

- it is relative easy to do in every page,

Just above the item loop in category_items(_html5).php add:
Code:
$field_id = 555; $date_to_items = array(); foreach( $items as $item ) { if ( !$item->fieldvalues[$field_id]) ) continue; foreach( $item->fieldvalues[$field_id] as $theDate) { $date_to_items[$theDate][] = $item; } }

Then change the loop to:
Code:
foreach( $items as $item ) {
to be:
Code:
foreach( $date_to_items as $_date $item ) { echo '<div class="alert alert-info">'$date .'</div>'; ... // normal item display but without the date field in any template position }


- the question is do you want to do it
per page or to show all items of the category in a single page thus collect all items of specific dates


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