Firstly, good job to blixxxa and tronathan for creating such an important drupal module.

However, one of the problems I (and others [a], [b], [c]) have with tinymce_node_picker is that it inserts the URL's of pages and content items without respecting that these URL's might change in the future. i.e. it inserts the "/content/testing-page" path - and if this changes, the link then fails.

One way around this is to install pathfilter, and then to adjust the tinymce_node_picker view to set path's in the pathfilter format (as discussed here). This works fine for pages, but not for articles/files, and especially not if drupal is set to store files privately. Also, getting the hack to work, is a pretty tricky job - you need to know what your doing.

So the point of this post is to find out whats the best way forward to improve support for naturally changing aliased URL's.

One way, I'm thinking is:

  1. move the node picker listing functionality (the listing in the popup) into its own code (independent of views) so that the insert links can be formatted properly without the site admin having to mess around with views and templates.
  2. implement the pathfilter functionality into tinymce_node_picker to remove the dependency (all it is is a filter with a preg_replace - very basic module) and then:
  3. implement an api to allow people to write the custom functionality for inserting links of custom content types as well as filtering/processing the links of these custom content types too.

This is just a discussion at this point. I'm not the module maintainer, so if this sounds too drastic, don't worry, nothings going to change anytime soon unless lots of people agree and write in patches!

Thanks.

Comments

peter törnstrand’s picture

I'm all with you on this one. This is the future of the Node picker module as I see it and you done a good job describing what needs to be done. However, I don't think we need to drop the usage of the Views module but rather write a custom View style that is better equipped handling exactly what the Node picker module needs done. The advantages of using Views is in my opinion just to great to just let it go, I'm thinking of custom tailored exposed filters and the ability to choose what fields are listed in the display.

I will think about how we could go about getting this functionallity in the module and perhaps put a link to this thread on the modules startpage to get more feedback from the users.

Cheers!

alexkb’s picture

Hey blixxxa, thanks for the prompt reply and great to know my thoughts aren't wishful thinking!

I've started the ball rolling over on the views issue queue with regard to providing default view themes in a module: #721778: themeing a view from a module. If you already know how to do this, feel free to reply, cheers.

peter törnstrand’s picture

I have never supplied a view template via a module but custom styling of a view via a module could be done by accessing the views result directly and building the output. That however takes away some of the freedom you get by using views.

I'm involved in another project, Image Browser (2.x-DEV), where we use a completly own styling of the popup window. Maybe that could be the way to go.

alexkb’s picture

Thanks blixxxa. I've taken a look at your other module image browser, and have started implementing the same technique for tinymce_node_picker. It still needs some work though, so won't post a patch just yet. Will try find some time in a couple of days.

Thanks!

daemonchrist’s picture

Please don't remove the Views integration!

I just discovered that I could alter the view to create links in the form of /node/xyz, which is how I like to do all the internal links on my sites. This prevents the links from breaking when the alias changes, and I use Global Redirect ( http://drupal.org/project/globalredirect ) to prevent duplicate content.

In fact, I would go as far as to say that /node/xyz should be the default output for Node Picker, for the above reason and the fact that it doesn't introduce any additional dependencies (other than Views, but everyone uses Views).

Thanks for the awesome module!

peter törnstrand’s picture

The module will still be based on Views for listing of nodes and taxonomy, so no worries there.

peter törnstrand’s picture

Status: Active » Closed (won't fix)

A status update. Things has been moving along on this issue and a new version of this module, called Node Picker (versus TinyMCE Node Picker), has been created at http://drupal.org/project/nodepicker ... no official release yet but I hope to have a 1.0 release ready soon.

I'm marking this issue as "Won't fix" as this module will be replaced.