Port LinktoContent to 6.x
sky_rivers - April 30, 2008 - 02:31
| Project: | Link to content |
| Version: | 6.x-2.x-dev |
| Component: | Code |
| Category: | feature request |
| Priority: | critical |
| Assigned: | Docc |
| Status: | needs work |
Description
Any plan to make this compatible with Drupal 6.X?
This is a great module!

#1
Yes, of course.
Unfortunately I didn't had much time in the last weeks to build in all the features I'd like to into 5.x.2.x (which will be the base for 6.x). And tinymce 6.x seems to be in an early stage too so I could not test very well.
Hope, you can wait a little more.
greetings,
Stefan
#2
Hi Stefan,
could you give us an idea of when you are planning to release this? This is a very important feature!
Thank you,
da scope
#3
Hi.
I'm sorry but I don't have the time anymore to do active development on linktocontent.
If you'd like to adopt it: http://drupal.org/node/280349
sorry,
Stefan
#4
Yes, very important feature.
Waiting for it, I've seen it on typo3, it's awesome !
#5
Very important feature, surprised I don't hear more people wanting this feature!!
#6
You don't see my inbox :-)
The module is in transfer to a new maintainer. Therefore it could take a(nother) while before it is finally upgraded.
greetings,
Stefan
#7
#8
any progress for the 6.x branch?
#9
Not yet, since I still need to dive into the current module. However, patches are welcome. :)
#10
It seems there isn't much to be done as i myself was able to make it work with Tinymce 2.x and Drupal 6.x. I mainly made the changes suggested by the Coder module. Since i'm not good at writing modules, the setting pages are pretty messed up. However link to node button works well. From my experience, i can say that someone with more knowledge than me in writing modules and creating patches can make the initial port within a few hours.
Btw, i first tried Tinymce 3.x but the buttons did not appear.
#11
How is the development of this going? What kind of help is needed?
#12
This port is actually postponed on my task list until #319363: Rewrite editor plugin API as well as #245799: Update TinyMCE integration to 3.x are completed. If you want to see this happen faster, please have a look at http://drupal.org/project/wysiwyg
#13
I`ll give a D6 port a go this weekend.
#14
this would be awesome!
#15
yeah almost there.
Only the linktocontent_category.module left.
Also converted the tinymce plugins to 3.x
Il put up some patches this week
#16
Just chiming in that I would love to see this working with tinymce 3.x - a lot of my projects could really benefit from having this module. I'll paypal 50$ USD to ya Docc if you can make this compatible with tinymce 3 for drupal 5 as well. :D
#17
hehe no worries, will put up a patch for tinymce 3.x aswell.
Just gotta make the patches. Hopefully i can sneak them in between work before the weekend.
Regards
#18
Docc: Thanks so much for your work! I am very excited to install this on Drupal 6! Do you have a wish list on Amazon or something similar?
#19
Thanks to all, Docc in particular, who is driving the port forward. Docc, any paypal address or elsewhere to donate?
I really can't imagine how Drupal maintainers live without a module like that, especially when you are involved with content editors.
#20
@Docc: How's the progress? Mind to post an intermediate patch? I'll soon start with a port on my own if we won't hear from you.
#21
Ill post the patches tonight
#22
So here is the first D6 patch.
Did not find the time yet to convert the category contrib.
this patch is only for the D6 port. Patch for tinymce 3.x can be found here http://drupal.org/node/227538
ps if you get hunk failes on the .info files, just add the 'core = 6.x' line, and correct the dep. line (dependencies > dependencies[]) on the .info files
Regards
#23
I've tested your patches (both tinyMCE and linktocontent), and I've had only one problems:
- I get a warning when trying to enable link to content plugin in admin/settings/linktocontent (following INSTALL.txt):
warning: Invalid argument supplied for foreach() in /var/www/drupal/modules/linktocontent/linktocontent.module on line 155.
So far, no more problems, but I can't test any more because I can't enable the tinymce plugin.
Thanks for all your work!!!
#24
Thanks!
The patch is not bad. However,
a) we do not want to re-implement the D5 menu system approach. Instead, menu retrieval has to be updated to use D6 menu API functions.
b) you used tabs instead of spaces in several places. Tabs are forbidden in Drupal. Use 2 spaces instead.
Patch updated regarding b) and some other clean-ups.
Additionally, I've placed two @todo markers in hook_menu() implementations.
#25
Tnx Sun,
Thought i would get away with the D5 approach ;)
Will look into the implementation of the D6 menu system.
#26
I installed tinyMCE 3.05 and applied the linktocontent-HEAD.t3.patch and linktocontent-HEAD.d6.patch to the HEAD version of linktocontent. Enabling the module in Drupal worked, editing the module settings seems to have worked, and I checked the linktocontent menu and linktocontent node in the tinyMCE button settings. I also copied the plugins to the appropriate place in tinyMCE plugins and added their reference to plugin_reg.php in the module tinymce folder, but the two buttons are not showing in TInyMCE when editing content.
Also when I first installed the module I received a Drupal error because the contrib/linktocontent_menulinktocontent_menu.module was missing the closing "," on line 29.
What version of tinyMCE is this patch working in (should I be using TInyMCE 2.x). would it be possible to attached a zip file of a already patched linktocontent module?
Thanks for working on this very important module!
#27
Fixed the bug mentioned in #26.
#28
#29
Any updates?
#30
Not yet, ill have spare time next week.
Question is, does it make sense to put in more efforts now when this module is going to be converted to fit the Wysiwyg API?
Most rewrite will be in the tinymce plugins i know, but will the the way the data presented to those plugins from the module change aswell?
#31
The port to 6.x makes definitely sense. Sure, for Wysiwyg API integration there will be major changes all over the module - but the fundamental changes between 5.x and 6.x for dealing with the menu system are required anyway. btw: I'm considering to implement Wysiwyg API support in 6.x only.
#32
I did get the patch from post 22 to work with tinyMCE 2.X and it has been very helpful! I have been busy and should have posted my results sooner. I hope to try TInyMCE 3.X again soon. A few comments from my experience using the patch: The linktocontent menu option often does not load the menu dropdowns until I select refresh in the linktocontent window. Also, the linktocontent node option works very well and the categories for vocabulary and web link (i have web links content type installed) works! so maybe this will help in getting categories to work?
Thanks a lot for your work on these patches Docc and Sun. Please continue your work.
#33
I got the latest version of this patch (post #27) working using TinyMCE on Drupal 6.6. I am also using the newest version of TinyMCE, which at the time of this posting was 3.2.1, using the patch from http://drupal.org/node/227538. I could not get it to work with the WYSIWYG module, however I seems like a little tweaking would be all that is needed. Thanks for the great work guys.
#34
subscribe broo...
#35
I've tried implementing the patch (and the TinyMCE 3.x patch) in Drupal 6.x with TinyMCE 3, and I get the button but the "loading" never finishes.
#33: Could you post every step you took?
#36
Ah, I think I know where I went wrong. I didn't download the HEAD, just the last dev-release. Where can I find and download the HEAD? Do I have to use CVS?
Edit: As far as I can tell I have the right version (the one released on the 4th of november). If this is the case I repeat my question above - how do I implement the patches correctly to get this working with TinyMCE 3.x and Drupal 6.x? (I've tried following the instrucitons I've found, but when I try to insert links it stops at "loading".)
#37
Thanks for all the work on this. I'm using tinymce, footnote, biblio, and pathologic, and this looks like just what I need to have a nice complete linking solution for my users.
I'd love to test a a patch for D6/tinymce, but I wasn't sure where to start w/ this thread, so I thought I'd ask before I spent a lot of time hacking around.
Thanks,
- Eric
#38
Straight re-roll against latest HEAD.
@Docc: IIRC, all what's missing here is to refactor some code in linktocontent_menu.module to use the new menu system instead? Any updates regarding this?
#39
Well its been a while, but i adapted it to fit the D6 menu system a while back with a custom menu_tree_all_data() function. Wich accepts *any* menu item, not just the root of a custom menu.
Problem is that now it does not pass the nummeric check in the function.js.
Because it sends the menu id like this "$mid = 'navigation:12'" instead of a number only.
Ill see if i can create a patch out for review.
#40
The 6.2.x-dev is not compatible with de 6.8 drupal version... :-(
i wonder how this looks like?
#41
This looks like you should help getting it done?
#42
i'm sorry but i can't (i'm not a developper). I only can test it
I was talking about the user interface of the module (in tinyMCE), is it a pop-up with a list of nodes ? can we configure which node type are allowed ?
#43
@Roulion:
Of course. You can. Go to admin/settings/linktocontent and click on "Configure" next to the plugin you'd like to set up (e.g. "linktocontent_node"). On the following page you can (un-)check all the content types you want to list in the plugin window.
hth,
Stefan
#44
@sun
Only patching is the problem. I feel like a idiot for still not knowing how to create a proper patch.
Will create one tonight. If i have any problems i will let you know.
#45
@Docc:
Creating patches is a very good reference to learn patching :-).
Stefan
#46
@stBorchert
If I'm not mistaken, the issue Roulion reported in #40 precludes the possibility of following up on your suggestion. It is not possible to configure a module that cannot be installed.
admin/settings/linktocontent is no different than admin/settings if the linktocontent module has not been installed. A trip to admin/build/modules to enable the linktocontent module shows the following:
This was true for version 6.8 as well. There is a red X by the module instead of a checkbox and there is no possibility of installing it.
I've only glanced at the code but I have no idea why it would be incompatible with Core.
#47
@Splicer
Did you apply the patch from comment 38? Otherwise it isn't a wonder why its not compatible.
#48
Subscribing since I found out FCKeditor is now experimentally supporting this module.
#49
@stBorchert
That must be the answer for me and for Roulion. I have been thus far unable to apply the patch, but I'm playing with the -p option of patch because I suspect that the problem I'm running into has to do with the directory tree. I keep running into 'missing header for unified diff at line 8 of patch' and the patch is rejected.
Out of curiosity and because this is less than clear to me so maybe other readers would be helped: with what version of Drupal is linktocontent-6.x-2.x-dev compatible? This thread seems to be about the port to D6 so my first time through I thought that the patch was to be applied to a 5.x version of the module. That's why I ignored the patch before.
#50
@Splicer: I can only guess that you are referring to the (hidden) release node http://drupal.org/node/96547, which will serve as development snapshot for the upcoming 6.x-2.x release.
The patch in #38 should apply cleanly against CVS HEAD.
#51
@sun: Hidden, eh? It's not that hard to find: Downloads->Modules->Browse by name->Filter by compatibility with 6.x core, use the pager to go to the fourth page, scroll to "Link to Content" (about 5/6 of the way down the page) and click on "download." That's how I usually go about finding packages.
I know it's a -dev package and consequently haven't counted on it, but I'm a little troubled that the user is to blame for downloading a module from the module download page, then reporting that it turns out not to be compatible.
#52
suscribing
#53
subscribing
#54
subscribing
#55
I would like to note that the experimental version of linktonode (drupal 6.x-2.x-dev) does not work well with a multilingual site.
The node list is populated with nodes of all languages and the url always starts with the same language prefix
e.g: /nl/staff when it should be /en/staff
I took a look at the code but I can't seem to find the right place where the node-list is prepared...
#56
hey All..
I'm so confuse with so many questions... Does any body has the Linkto node working?? can you list categories or taxonomies??
If so how do you fix it?
Help..
#57
@yennyp As far as I can tell, the only way to get a working version of Link to Content is to get it from CVS. The package that is available in the download section of the drupal.org site has not worked with any version of Drupal released in the last three (possibly more) months.
Hopefully someone will correct me if I'm wrong, but if you've gotten the Link to Content module from the download section of drupal.org, give up and delete it.
#58
Here's a slight modification to allow the code in functions.js to work when tinyMCE.baseURL is an array of paths. Not sure why that should ever happen, but it does in my installation: the first path is the one to tinyMCE and the second points to fckeditor. Maybe it's a Wysiwyg API thing, not sure.
This is a re-roll of my modifications plus the patch from #38 against the latest HEAD.
#59
subscribe
#60
subscribe
#61
Is this going to happen for Drupal 6?
If not does anyone know of any alternative method I can give to clients who need to link to Internal Nodes, this is critical for us as we cannot expect not-so-savvy end users to have to go and find the URL of the page they are looking for a in a new window for linking, they will find it over complicated.
I don't mind ditching TinyMCE if there is another method out there.
Thanks for any help,
Gary
#62
subscribe
#63
subscribing.
This is enormously important feature - from my experience users want to use a WYSIWYG editor but often can't remember nids or url titles of their content. I'd like to see this also for FCKEditor.
Actually, tracking back a nid or url to a piece of content is a recurring issue when creating menus, blocks etc. When I started to use Drupal this was the greatest obstacle for me as to search back for correct urls (with using Pathauto) all the time. I think Drupal should assist users to browse and link content in core...
#64
In this file the linktonode module is ported from D5 to D6. It works for TinyMCE. Just install and use.
Because this module was ported for a client of us, there is some extra functionality. If the modules path and path_redirect are installed, a redirect will be created if you change the path of a node so dead links can be avoided.
#65
Thanks so much for this. Echoing the comments of others - this module provides functionality that will have a huge impact for our content contributors, so thank you very much for working on it.
I was able to install the version in #64, and is working in Tiny MCE with WYSIWYG API. However the only option for browsing content is through taxonomy, which doesn't work well for our content. I have Linktocontent Node enabled, and Linktocontent Category is unavailable to enable (not compatible with Drupal 6.10 message). I would have expected Linktocontent Node not to use Categories as the required means of browsing content. Let me know if there's something different I can do.
Looking forward to seeing this develop, and the next version having improved browsing options.
Thanks!
#66
subscribing
#67
Will it with with FCK and d6?
#68
No, you need to download experimental port for FCKed that actually exists here:
http://drupal.fckeditor.net/download/linktocontent-fckeditor-6.x-2.x-dev...
See README for D6 FCKed module for more info.
#69
subscribing
#70
subscribing
#71
i'm not getting all the categories in the popup that i selected under /admin/settings/linktocontent, in fact i can reference the simplenews contetn type which i didn't select in the list
also some i18n support would be great, so you reference the right nodes in the right language
#72
subscribe
#73
subscribing
#74
I'd like to help porting. Want to use the module within the next week. Can develop php stuff, would need help with JS and TinyMCE-parts.
#75
I haven't had any luck getting the port from #64 to work...
I'm running Drupal 6.11 with:
wysiwyg 6.x-2.0
tinymce 3.2.3.1
mziegmann, do you mind sharing what versions of each you're running successfully?
Thanks.
#76
Confirm module from #64 doesn't work. Admin pages work (I enabled all node types), WYSYWIG API admin page picks up the button, but the button doesn't actually appear when adding pages.
WYSIWYG API 6.x-2.0
TinyMCE Version 3.2.4.1 (2009-05-25)
#77
#78
Responding to #75... sorry, but the Link to Content button is no longer working for me. I haven't paid attention to this for a while, and meanwhile have updated several modules (including WYSIWYG API and TinyMCE). So I no longer have this button on my WYSIWYG toolbar.
#79
Thanks for confirming this, guys. At least I know I'm not making a mistake on my end...I'm going to try to figure out what's going on but I can't promise anything as I have no idea what I'm doing :)
#80
subscribe
#81
Same issue is here. Getting button under WYSYWIG API settings for TinyMCE but not getting button on node/add/page .
What is the issue ?
#82
I couldn't make it work with Tyny MCE so I moved to FCK editior.. it's very specific in the isntallation and things to make work but it does work..
#83
All admin pages work, but no button.
Subscribing
#84
Do you mean not button in other roles?? only in the admin one??
It may be that Tyny MCE has profiles as it has FCK.. chec the tyny settings for something like types of toolsbars.. I think you need to add the button in yhe main toolbar that you're using.
#85
yennyp: no, there's no button for any role. The button is definitely not appearing when it should be.
#86
Subscribing +1 for TinyMCE support
#87
Subscribing +1
#88
also subscribing
#89
Where do I subscribe ?? I need a solution urgently... to link to nodes are you using fckeditor or tynyMCE??? I've like a thousand pages , in a hierarquical structure.. how my users suppose to link from 1 page to another if they don't know any HTML??
#90
subscribing
#91
Subscribing. Drupal 6 + Wysiwyg module would be great.
#92
//subscribing
#93
subscribing
#94
subscribing
#95
Hey all,
How are you doing this?? who is proving the support?? can you provide the url.. ??
is link to content working with taxonomy and which editor??
#96
Subscribing.
The current Drupal 6 snapshot is from January. How much work will it require to produce a "Drupal 6.13 version compatible" snapshot of Linktocontent-6.x?
Best regards,
Olivier
#97
Here is another project attempting the same thing.
http://drupal.org/project/tinymce_node_picker
#98
That module uses the views module, making the installation very big, for a simple link.
#99
Thanks for pointing out this related project!
This related project (tinymce_node_picker) does a great job for Drupal 6, and the Views integration allows you to tweak what you want to see in the node list. It was fairly easy to add node type and node language to the display fields of the view.
Only issue with that other module is that you still need to retrieve most files manually from CVS as no release for this module already contains all files needed by the plugin.
Maybe both project's developers could unite and leverage upon each other's code to get an even more terrific plugin out :-)
Cheers,
Olivier
#100
I've got a work-around for #64 not working
It is similar to the one in http://drupal.org/node/227538 so hopefully this will get looked at there.
Edit the function wysiwyg_tinymce_plugin_settings in wysiwyg/editors/tinymce.inc
Comment out the if statement at 314 - if (!empty($plugin['load'])) {
(This line might change depending on version, but was the if statement same in the 5.2 version too)
Hope this helps someone...
#101
Subscribing
#102
Subscribing.
I've installed this module. Like #55, I have a multilingual site, and it isn't working correctly. Unlike #55, rather than displaying the list of nodes in all languages, I'm only seeing the list of English nodes. The SQL it is sending to retrieve the list is:
SELECT DISTINCT(n.nid), n.type, n.title, n.created, n.changed, n.sticky, u.name, tn.tid FROM node n INNER JOIN users u ON u.uid = n.uid LEFT JOIN term_node tn ON n.nid = tn.nid WHERE (n.language ='en' OR n.language ='' OR
n.language IS NULL) AND ( ISNULL(tn.tid) AND n.status = 1 )ORDER BY n.sticky DESC, n.created DESC
So it's specifically requesting only nodes in English, even when I'm editing a page in Spanish.
Am I missing a step in the configuration?
#103
I've done a little more digging since #102 above. I found that the i18n module is inserting the WHERE clause limiting the nodes to English via a hook on db_rewrite_sql. When I change the "content selection mode" for this module to "All content. No language conditions apply.", all nodes are displayed in the list. So either the i18n module isn't picking up on the fact that I'm editing content I've indicated is in Spanish, or FCKEditor/Linktocontent isn't making that information available.
#104
subscribing