Easiest way to create html link?

Hi everyone,

I am switching from dreamweaver to IntelliJ and am wondering what the easiest way to link existing text in an html document to another document would be in IntelliJ IDEA or PHPStorm (I am still trying to decide between the two)

As I am sure most of you probably know or have seen in dreamweaver it was easy to select text, then using the properties panel you could literally drag a line out to the project window and drop on a file which then created your link in code for you. I found it very helpful when building sites.

I am guessing that code completion would have something to do with it in IntelliJ but I am wondering what you more experienced IntelliJ users might suggest. What is the easiest, fastest way to do something so basic to site building?

Thanks

6 comments
Comment actions Permalink

Code complete (CTRL+Spacebar) is the standard way of doing such. You will find that IDEA is more keyboard centric than mouse centric. Overall, using the keyboard is much faster than always having to reach for the mouse al the time. Also keep in mind, Dreamweaver is more of a WYSIWYG editor (at least it use to be. I have not looked at in in 8 or 9 years). IDEA is a text based HMTL editor.

When inside the href attribute of an anchor tag, if you type CTRL+Space you can complete the link. It'll show you all the possible resources. In the example below, the last two items are Servlet URL mappings.

Screenshot 1

Notice at the bottom of the screenshot the comment about searching? If you know the name, or the start of the name of the resource you want, enter the start of it, and then enter Ctrl+Alt+Space. Here, I want to search for a page that starts with 'sales'. So I enter "sale", then hit CTRL+ALT+Space:

Screenshot 2


It finds three pages in two different directories that starts with the word sale.

When used in conjunction with Zen coding and/or live templates, adding a link can be very quick and easy. For example, with Zen coding enabled, I got to the first screen shot by typing:

     a
     [tab]
     [CTRL+ALT+Space]

After selecting the target via the auto complete, my cursor end between the open & close tags as defined in the 'a' live template. So I can just type name of my link.

And if I want to be very lazy, I can edit the live template for the 'a' completion so it automatically opens code complete when I use the 'a' template:

Screenshot 3


Now it only takes two keystrokes to get to the very first screenshot:
     a
     [tab]

This will still work when I want to search. I hit a, tab, start typing 'sale', then type ctrl+alt+space and the code complete changes from basic to smart and finds the possible pages as shown in the second screenshots.

Search the help documentation for "Zen" and "Live Templates" for more information.

I hope that helps.

Message was edited by: Mark Vedder: Added screenshots as attachment



Attachment(s):
screenshot3.png
screenshot2.png
screenshot1.png
0
Comment actions Permalink

For some reason, the forum software ate the images I pasted inline. So I had to add them as attachments

0
Comment actions Permalink

<Deleted>
This was a double post. The forum software was slow and problematic today :(

0
Comment actions Permalink

The forum software did something with the images I posted. I can't seem to get back into the original post. Sop here they are.

Screenshot 1:


Screenshot 2:


Screenshot 3:

0
Comment actions Permalink

Wow, Mark, thank you!

Thats even faster than dragging the line to the project list in DW.

I am playing with it now.  It works great in IntelliJ IDEA but I am getting "No Suggestions" in PHPStorm when I enter ctrl+alt+space when in the href attribute for the filename. Thats probably just a project setting that is incorrect or something like that.

I going to look up live templates now.

0
Comment actions Permalink

I was able to see the attachments, but none of the inline images seem to be working.

Thanks again for pointing me in the right direction here

0

Please sign in to leave a comment.