First, I love the look of the timeline and want to use it; although I want both historical items and "current" items to look the same, as a bar rather than a dot in time. In this case the future is unknown, not scheduled so I don't want the bar to continue into the future, but it should go all the way to the current time when the user pulls the web page.
I am showing retail locations and when they opened and closed; some have closed so they have an opening (start) and closing (end) date. Some have opened, but have not closed but I want them to show as a bar. The only way I see to show them as a bar is to have an end date. So is there a way to auto fill the end date with 'now'?
The only other way I could see doing this is to create each location with a future date and restrict the view to 'now' and backwards, but I can't find this 'option' either.
TIA! (Thanks In Advance!)
Comments
Comment #1
xamanu commentedThis functionality is available. IMHO this shouldn't be solved on the timeline module's side. Further I see this more a general issue for the date module. Nevertheless it should be possible to "hack" it through views' template_preprocess_views_view()-function.
I hope you can get your timeline running as you desire.
Comment #2
riversidekid commentedThanks, I hadn't thought about doing it that way; I'm sure there is a views filter or argument that I could utilize, I just don't understand the 'hacking' enough just yet. I'm learning though and I'm off to research!
Comment #3
John Bryan commentedI'm also interested in an auto end-date of Now
In my case it happpens to be for a family tree display. But currently the deceased show as a time-span line and the living only show as a dot as the have no DOD end date.
So can the filter on only select Date_API fields be removed so the fields containing valid date content can be used.
And I do think that some basic default options for end date (e.g. "Now", "Default date" and "Default length") are basic expectations for a timeline type utility. No harm putting in similar default options for Start (e.g. "Now", "Default date" and "Default length").
In case anyone thinks I am being critical... I do like this module and appreciate the work and support gone into it 8¬)
Comment #4
xamanu commentedJohn,
in order to get the 'dynamic CCK field' or 'calculated CCK field' working there should be first done this issue: #602956: Implement supported fields as plugins then it would be just to program an extension/plugin to the module that supports whatever kind of field. But this is still missing, so it's not working for you right now.
But why don't you want to use the views preprocess hook? It is not really hacking when you use some hook within a custom module (that's why I wrote it within quotation marks). This would be pretty easy and even you can put in your desired logic, like if there is no "end date" use "now" (or whatever). Actually I think using the preprocess hook is way better than putting PHP into your database.
Comment #5
John Bryan commentedImpressed with the quick reply 8¬)
Will try following your advice. No idea how to do it but will do some searching.
I did try commenting out the field selection filter and selected the dynamic field. But whether the field had Unix integer, ISO or string (e.g. "2005-02-01T00:00:00") Timeline didn't process it to generate a line.
So I will lookup 'views preprocess hook'.
Comment #6
xamanu commentedHere is the api doc about the preprocesser you have to use: http://drupalcontrib.org/api/function/template_preprocess_views_view/6
More general information on how to implement a preprocess function: http://drupal.org/node/223430
When you have implemented the function you can check the contents of $vars where you'll find within other information the results of the view before they are getting rendered to the timeline. So you can alter and add values to them.
Comment #7
riversidekid commentedThanks for the links! I have found the drupal documentation on preprocess functions several times over and I'm just not getting it. I am new to drupal and know nothing about php, so I realize I am at a disadvantage. Is there a simple tutorial on preprocess functions that you could suggest? Maybe something on Lynda.com? I really like the Lynda.com instructions for views and other modules, I'm just not 'clicking' with the preprocess functions in a way that makes sense on the timeline view!
Thanks again for links and pointers!
Comment #8
xamanu commentedSorry I don't know any newbe preprocessor documentation. but without knowing how to program at all, it'd be pretty tough to understand it.
Unfortunately I don't see timeline as the best place to implement it since it pretends to be a views output plugin and is just using existing data rather than modifying it. Anyway, you might want to find (or hire) somebody who wants to help you out. Or maybe some other person would upload a little module within this thread that you can use for this purpose.