I'm using the Biblio module and it is kind of a pain for my users to add citations. Adding a citation involves adding something of the form:

[bib]citekey[/bib]
or
<bib>citekey</bib>

where, in my case, the citekey is the node id. Since I use Pathauto and I don't have a custom View that explicitly shows the citekey, my users have to go to the node, hover over the edit tab to get the node id to see the citekey, and then go back to the edit page and add the citation. Like I said, it's a pain.

I think Linkit would be a fantastic solution here. It already provides a way of getting the node ID within my WYSIWYG editor (TinyMCE). All I need now is a way to make it output the result in the proper format, i.e. as either a [bib] or a <bib> tag instead of a link tag and to put the node id in-between the tags instead of as an attribute.

Is anyone up for this?

Comments

kyleoliveira’s picture

Issue summary: View changes

Cleaned up some formatting...

anon’s picture

The idea is nice, but I dont see this as something to include in Linkit as its very specific.

Maybe we could do something about the output process, so other modules can alter that.
Not sure how now tho.

kyleoliveira’s picture

If I were to attempt to change the output process, where should I start looking for the D7 version?

anon’s picture

Good question, tho I don't have the answer to that yet. Im not even sure that is possible with the code structure we have now.

Do you have any idea of how it could work?

kyleoliveira’s picture

Well, one spot may be in editors/tinymce/linkitDialog.js around lines 60-77. That looks where they actually create a link in TinyMCE by executing a few commands that insert the link by using editor.execCommand to insert either content or a link (if I'm reading this right). I guess an inelegant approach would be to add something on or around the if-statement on line 64 that would add another branch where we add our alternative tag rather than the link. Alternatively, this section might be able to be reconfigured so that the call to editor.dom.createHTML can produce what we want instead of just an a-tag.

kyleoliveira’s picture

FYI - I've posted a similar issue in the Biblio queue in hopes of getting more eyes on the feature request: Add Linkit integration

anon’s picture

I talked with some colleagues about this, and we have an idea of making this pluggable with ctools.

We have started some development in a branch called "field-widget" as we need this pluggable stuff together with the implementation for Linkit in regular fields.

The work is not done, but we have a start if you interested in taking a look.

anon’s picture

Version: 7.x-2.2 » 7.x-3.x-dev

In 7.x-3.x you can build your own insert pluings.
I think this can be completed with that.

anon’s picture

Status: Active » Postponed
kyleoliveira’s picture

Excellent, I'll take a look at that and see if I can get it to do what I want.

Thanks!

anon’s picture

Please feel free to check that out, but remember that 7.x-3.x is in an early dev state right now.

anon’s picture

Status: Postponed » Closed (won't fix)

This should be a plugin and will not be included in Linkit core.

kyleoliveira’s picture

Sorry for the delay, but web development isn't my main job description at the moment. Given that this should be a plugin, where should I look to find information on developing such a plugin? A template or example would be much appreciated.

SandPond’s picture

The Bibliography module is powerful and well-done, but it is cumbersome for users to locate the citationID (nodeID) and then enter [bib]citationID[/bib] manually using WYSIWYG TinyMCE. The Linkit module might be used to remedy this, or separate Biblio "submodule" that provides a button for WYSIWYG editor.

It seems that the 3rd party WYSIWYGs are a bit too generic and do not adapt perfectly for use with Drupal. An integrated Drupal-specific editor might be better. Then module developers would have a much easier job seamlessly integrating essential functionality, such as a button for Biblio, image pickers, etc, etc.

SandPond’s picture

Issue summary: View changes

Fixed bib tags not showing up