I plan to use Linodef to reference site content while creating a new content or writing a reply. I use the Bueditor button code to filter a specific content type. However, there are lots of content which makes the dropdown select list impractical.

An alternative approach might be to provide a popup window and get the results from a view which can be defined as $drupal_element_type="view_myview". This type of functionality has been implemented by the Easylink module which provides a button for the TinyMCE editor. There is also the Link to Content module for TinyMCE which provides a popup window where the user can filter the content.

Linodef already has several advantages over these above mentioned alternatives. I think with a more user friendly interface it would be the best choice for internal linking.

Comments

Roi Danton’s picture

Title: popup windows? » BUEditor submodule: popup windows?
Assigned: Unassigned » Roi Danton

I see the point. Implementing a view would be no choice because I have to query all the links the view provides to create appropriate tags (I was thinking about that while defining the way Linodef should work).

Currently the Lino BUEditor submodule uses a Javascript function that is similar to the default button function of BUEditor. Instead I could use a select box for the list of nodes/fields/terms. At least I'd favor this over a popup window ...

... though the best way would be to give the choice to the user, so you could decide which button type you want to use (Javascript button, select box or popup). I'll look how good this feature would fit into the module.

drupaloSa’s picture

Well, i'm not a coder myself so i don't know what you mean by "I have to query all the links the view provides to create appropriate tags". However, if you have to do this in order to get node ids, then perhaps we can provide them as fields in the view. Does this make any sense :)

Another option may be to use an autocomplete search box to find the node we're looking for (see node quick find and autocomplete node finder). Perhaps it may be possible to use the existing search functionality of these modules.

Roi Danton’s picture

Hehe, thx for these hints. Those modules could be useful for an additional button (type nodename, then press enter), but only looking at their functions will tell if the modules provides an api like structure.

Currently I'm working on two additional buttons: One as a popup window, the other as Javascript dialog using jQuery UI module. The second is almost done, for the first I'll have to look how to pass the data from one window to another (if its possible that easy).

drupaloSa’s picture

In fact i've asked this in Autocomplete Node Finder issue queue a couple of months ago: #306934: provide button for a wysiwyg editor?. The maintainer said that CCK Nodereference had also the same search functionality. I'm not sure what this means or if it could be of any help, but i hope you can find what you're looking for in those modules.

I'm curious about how this module will progress :)

Roi Danton’s picture

Me too.^^

Yes, Nodereference use similar techniques but I think I'll implement the required functions for the autocomplete button in this module. Otherwise Linodef will depend on 1000+1 modules one day. ;)

Roi Danton’s picture

Component: User interface » Code

After a couple of days working with the Javascript Dialog box it turned out that it isn't more useful than the currently implemented button (overview for big node/field/term lists has same quality) so I removed it.

Instead the popup window is working now. It took several hours since I never worked with hook_menu before. Inbetween I thought I had to realize it with views but then I got to know about the Wildcards in hook_menu. This saved my day. ;) The advantages of the popup window: Better overview for many nodes etc and it stays open after you've included a tag so you're able to include several tags without having to click on the button each time.

The popup is not styled yet (I've just written a plain template) but this is secondary. Next I'll include autocomplete button and then I commit it to CVS. You are welcome to test the dev release then for bugs (I'll let you know when it's ready to test).

drupaloSa’s picture

great news!

Roi Danton’s picture

Okay, the autocomplete is much more tricky than I suspected.

I can't use Nodereference and Userreference (even not as template) and Quick Node Find/Autocomplete Node Finder don't work as well. Maybe the reason is the inclusion in the Javascripts of the Button or the reason is unknown.

1) Therefore my own autocomplete list/menu entry doesn't work as well 'cause the form is part of the Javascript of the Button (unlikely) or because its inside an other form. => solution: popup
2) Besides that the submitting of variables to create the autocomplete list (e.g. element you entered and a API related variable) wasn't successful til now. EDIT: due to reason #1.
3) Furthermore I'm forced to use AHAH function (so the site doesn't reload after submitting), but for that I need the ID of the active textarea which isn't possible before submitting (can't pass variables from Javascript to PHP without submitting). => solution: Maybe include in popup (would solve #1 at least), but no idea how to insert the code into the correct textarea.

So three unsovled problems (the autocomplete itself, passing the variables (doesn't exist if #1 is solved) and the submitting of the form) prevent the completion of linodef rc2. If I don't find a solution the next couple of days I go without the autocomplete button for rc2.

drupaloSa’s picture

I wish i could be of any help but as i already said i lack the knowledge; i'll keep my fingers crossed for the inclusion of the autocomplete feature though :)

By the way, this issue was orginally about the popup window so once you release that version it can be considered as fixed. If the autocomplete feature doesn't make it into that release, it can be a seperate feature request.

Roi Danton’s picture

Title: BUEditor submodule: popup windows? » BUEditor submodule: itemlist & autocomplete popup window

I've found a way to implement the autocomplete button inside a popup and return the tag to the editor. I just want to do some further testing tomorrow morning (me @UTC+1) and then I'll commit the code to drupal.org. So the 6.x-1.x-dev will be updated sometime tomorrow night (the dev versions get updated only twice a day).

Before releasing an official rc2 I'd like you to have a look at the changes and say what you like/dislike, pls. :) (I need to change quite a few things in the documentation anyway)

drupaloSa’s picture

Then that means i'll be able to try it Saturday. By the way, does the autocomplete also use the "field-name|content-type|vocabID" filter?

Roi Danton’s picture

Yes, the autocomplete uses exactly the same filter (the same function) as the listbutton and the popup window.

I've committed the chances, the dev version should be updated within 12 hours or earlier. Before uploading the folder to your Drupal installation, deactivate the Linodef and Linodef BUEditor module and delete the old "Linodef" folder. Then upload the new folder and heed the fact that you have to activate three Linodef modules. ;)

Please heed the commit message (found at page' bottom). That means update your BUEditor Buttons and "no link" tags (if you've used them already). It is unlikely that the tags will change again in a future version. Sorry for that but I needed to do it now.

drupaloSa’s picture

Component: Code » Buttons API

I'm testing the dev version on my localhost. Drupal installation is in a sub-folder and this results in wrong links when the popup button is used.

Currently the popup window link is like this:
http://localhost/linodef/popup-ac/linodef_buttons_bueditor/ders/0
However it should be like this:
http://localhost/drupal/linodef/popup-ac/linodef_buttons_bueditor/ders/0
The subfolder name, drupal, is missing in the link.

Roi Danton’s picture

What a foolish bug, I haven't added base_url. If you don't want to wait for the dev release to be updated download the updated file here and replace linodef_buttons_bueditor.module.

drupaloSa’s picture

Finally, i found the time to test the dev release. So far, everything seems to work as expected. I'll also install this in a production site very soon.

I have a couple of suggestions to further improve the usability, though.

  • An option to include a short description/user-guide for the pop-up windows (or perhaps a translatable default text may be used instead)
  • A "close" button for the pop-up windows.
Roi Danton’s picture

Thx for the feedback, I'll include the two suggestions. Before using it at a production site wait for rc2 release, pls. Don't use the dev release since it is more difficult to give support for a production site then. I just need a couple of days for rc2.

Roi Danton’s picture

Status: Active » Fixed

Added translateable text, close button, own css file.

Comitted to D6 branch. Please test the dev release on a test environment for bugs/flaws since with this dev update Linodef got tons of new features. RC2 will be released before Christmas unless major design bugs are found. If you find a bug relating this issue then reactivate it, please. Thx!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.