Very slick module! Thanks a lot.

I have an odd request based on the use of Cluetip. In order for it to work I need the href and rel attribute to match. (rel is the attribute used to pull the content through ajax) That is for the cluetip to show and link prooerly I need a link that looks like this.

<a class="roundedlg" href="http://example.com/drupal1/node/207" rel="http://example.com/drupal1/node/207">Load cluetip from node</a>

Thus, with ULink it works like this.... but I need to use the absolute url in the rel.

[l|node/207|Pull from a node|class=roundedlg, title=Nice Hint, rel=http://example.com/drupal1/node/207]

Is there a way with this module to simply use rel=node/207 and have it generated as the absolute url?

Thanks.

Comments

garthee’s picture

Yes there are two ways,

1]
If you are going to use uLink tag only at this particular situation.
Go to uLink settings > Node settings and choose Macro substitution (Tokens) (you should have token module for this)

Click configure and there give the following tag for Token tag to be rendered:

<a  href="[ulink-path]"  [ulink-attributes-string] rel="[ulink-path]">[ulink-text]</a>

when calling it in the text you don't have to even call rel and it would be simply
[l|node/207|Pull from a node|class=roundedlg, title=Nice Hint]

2]
However, I would recommend PHP hook, provided you are conversant with PHP scripting

Go to uLink settings > Node settings and choose PHP code

There give the following code

if ($link["attributes"]["rel"]){
  return l($text, $path, $link["attributes"]);
}
else {
  $link["attributes"]["rel"] = $path;
  return l($text, $path, $link["attributes"]);
}

Here you can call it by

[l|node/207|Pull from a node|class=roundedlg, title=Nice Hint, rel=this_text_is_ignored_so_u_can_enter_anything]

Please note, with Macro, only simple substitution is possible and you will have to go to PHPmode to implement If / Else selection.

Further by adding this to the general Macro at General settings page of uLink settings as
"CT"=>"class=roundedlg,rel=default_text"

you can further reduce the typing to
[l-CT|node/207|Pull from a node|title=Nice Hint]

Thank you for your interest in uLink, and hope you are using uAuto, ulink_gallery and uDirsearch three modules make your life easier using uLink.

nathanraft’s picture

Thank you for the extensive help!

I tried the php option first but didn't get it to work so I moved back up to the macro option. I ended up leaving the [ulink-attributes-string] in and it worked perfectly. Then I added the general macro for the class and now I am all set.
Here is what my macro ended up looking like.

<a href="[ulink-path]" [ulink-attributes-string] rel="[ulink-path]">[ulink-text]</a>

What a powerful module! I have not tried the other modules as they seems like extras but after this display of both functionality and developer support I will gladly try them out.

Many thanks. Drop me an email if you are interested in potential future projects.

garthee’s picture

Well, the primary objective of the project was uAuto module; however following drupal's clean design / code philosophy it was decided to make the filtering neat and as general as possible (still I regret the absence of taxonomy and several other aspects) which resulted in an excellent module. However, being only a skeleton it needed the implementations, where I gave the default implementations which has three options (hard coded, Macro, php) and with the help of Deldge, two other modules were written to illustrate how universal filtering could be extended to suit specific needs. Especially ulink_gallery allows you to mass upload (FTP) the files (currently supports only images) to a particular directory and displays them in an album view (configurable by modifying CSS) with a single line of code. The important point here is no reference needed in files table in the database, means you don't have to rely on drupal's upload module. I would have been spending hours with image posts in my site (www.theebgar.phpnet.us) otherwise.

As I told before, primary objective was uAuto, performing auto completion of links as gmail does (currently google web search experimental also) again in an extensible manner. Further, uDirsearch provides a similar functionality of ulink_gallery, through which it lists all the files in a particular directory (no need to exist in files table in the database) when you refer to the folder in uLink tag.

Please refer to the Readme and Developer documents for further information.

garthee’s picture

Status: Active » Closed (fixed)