Hey,

I'm looking for the best way to include a Jquery timeline within the body content of a specific node. So, I might have node 1, that's an article about Person A and I'd like to have a Jquery timeline specific to Person A. Then Node 2, an article about Person B and a timeline specific to Person B. There will be nodes were I don't want a timeline at all. I'd like the text of the article to wrap around that timeline, so that's why I say "within the main page content". I hope that makes sense.

I'm using Drupal 7, but need whatever method I use to be compatible with Drupal 8.

Any ideas about the best way to achieve this?

Thanks in advance.

Billy

P.S. I'm the only one that will be adding/editing content on this site and I expect that each timeline will have to be custom built, rather than automatically populated. What I'm hoping to achieve would be similar to inserting an image or a swf file into an article.

Comments

nevets’s picture

There are a number of modules that produce timelines, Timelinr is one of them. . This search will show more possibilities.

imbilly’s picture

Hey Nevets,

Thanks for your reply. I'm new to Drupal, so please excuse me if I'm not understanding things correctly.

Seems like the modules are dependent on the "views" module and that they auto populate the timeline based on a view or fields.

If I understand that correctly, that's not really what I'm looking for. I'd like to be able to place a custom timeline within the main content of the article. (within the "Body" which I think is default field for main content in Drupal).

I could achieve something close to what I want by placing a graphic, say 300px x 1200px in a 300px x 600px div within the article and allowing a scroll bar. BUT, I wouldn't have the interactivity and nice transitions that js. would allow for.

I thought about doing something like this with Flash and then embedding it in the article, but I'm thinking that's not a great platform to move forward with

nevets’s picture

If you use views and a timeline module, in the long run you will make things easier for you.

If I was going to do this, I would make a content type for timeline items, including the fields I needed. This would include a term reference field to a vocabulary I would use to categorize the item. So I might have a category, "The history of bikes" and other called "Electric cars". With this approach I could use one view that takes a taxonomy term id and produces the appropriate time line. Note with this approach, items could be categorized so they show on more then one time line.

With this approach it is easy to add and remove items from a timeline.

With your approach you will need to add the .js and .css files need to produce the timeline and "hand code" the time line. If there are more than a few items in the time line it will become hard to edit.

imbilly’s picture

Hey Nevets,

. . . including the fields I needed

The items that occur in the timelines site wide are going to vary widely. Unless I was going to use generic fields like "item one, two, three . . . " and so on, I think using fields would become really cumbersome. The number of items per timeline will also vary considerably. So even using generic fields, I might need say 40 to cover the longer timelines, even though I might only use 15 in a particular timeline. The background pictures and other assets would also change, which I suppose could also be covered with a field, but again it seems cumbersome. Am I thinking about this correctly or am I missing something?

Also, can I insert a "view" into the body field? Maybe as a block, but then I'd need a block for each specific timeline wouldn't I?

With your approach you will need to add the .js and .css files need to produce the timeline and "hand code" the time line. If there are more than a few items in the time line it will become hard to edit.

Yes, editing would be much more difficult, but these timelines are historical and aren't likely to change very often, if ever.

nevets’s picture

I think you are over thinking using a content type and fields.

First one instance of the content type would be one item on a timeline.

Second, as for fields, I suspect you can "normalize" what each item contains, it would make for a cleaner presentation. But if you don't want to use fields but the visual in the body (I think you will need a date field for the views timeline module to function).

I would use a single view that that a taxonomy term id, and there are ways to insert a view in the body.

imbilly’s picture

Hey Nevets,

You've spent no small amount of time here trying to help me out here and I appreciate that. I've been reading and it seems like script tags in the body are problematic, though since I'm the only one that will be able to edit those fields, I'm not concerned with the security issues involved with multiple editors/submitters.

I don't see how, given what I'm trying to do, one of the timeline modules for Drupal will do anything but create a nightmare on the backend. But I'm new and I can see you've been around awhile, so I'll see about downloading one of the modules and trying it out. I've got a test site I can use.

Again, thanks for the help and advice.

Billy

nevets’s picture

From my perspective adding structure to projects like this makes them easier to manage in the long run. There may be shortcuts that get you where you want to go faster, but they often ignore what Drupal has to offer.