Thursday, March 8, 2012 About myself (in short) Lowell Montgomery - - PowerPoint PPT Presentation

thursday march 8 2012 about myself in short
SMART_READER_LITE
LIVE PREVIEW

Thursday, March 8, 2012 About myself (in short) Lowell Montgomery - - PowerPoint PPT Presentation

Thursday, March 8, 2012 About myself (in short) Lowell Montgomery (LoMo on Drupal.org) Live in Frankfurt, Germany (Born in UK and from northern California) First Drupal website: http://FrankfurtNavigator.com (site-builder /


slide-1
SLIDE 1

Thursday, March 8, 2012

slide-2
SLIDE 2
  • Lowell Montgomery (LoMo on Drupal.org)
  • Live in Frankfurt, Germany

(Born in UK and “from” northern California)

  • First Drupal website: http://FrankfurtNavigator.com

(site-builder / themer / author)

  • Cocomore: 1) Internee; 2) developer trainee;

now freelancer

  • Author / Content creator: Cocomore Drupal Blog

http://drupal.cocomore.com/blog

About myself (in short)

Thursday, March 8, 2012

slide-3
SLIDE 3

But what about Eclipse???

Thursday, March 8, 2012

slide-4
SLIDE 4

Benefits of using Eclipse

  • Free / Open-source
  • Multi-Platform (Java-based)
  • Powerful debugging features
  • Syntax highlighting and error flagging
  • Lots of plugins to extend features
  • Drupal templates available

Thursday, March 8, 2012

slide-5
SLIDE 5

Drawbacks of using Eclipse

  • Resource hog
  • Java-based, not native app
  • Some pricey IDEs may be better, especially if you

already use them

Thursday, March 8, 2012

slide-6
SLIDE 6

http://www.eclipse.org/downloads/ Get latest version of Eclipse Classic for your OS Note: PDT bundles are not up-to-date

Thursday, March 8, 2012

slide-7
SLIDE 7

Installing on Linux or Windows should be easy, too. Note: You do need a JVM (Java Virtual Machine)

Thursday, March 8, 2012

slide-8
SLIDE 8

http://wiki.eclipse.org/Eclipse/Installation

Modern OS X has a suitable JRE by default.

Linux users may want Oracle JDK (latest Aptana Studio)

Thursday, March 8, 2012

slide-9
SLIDE 9

Select a suitable “workspace” for Eclipse to store your project(s). Note: You can have multiple workspaces.

Thursday, March 8, 2012

slide-10
SLIDE 10

Thursday, March 8, 2012

slide-11
SLIDE 11

Install the PDT (PHP Developer Toolkit)

Thursday, March 8, 2012

slide-12
SLIDE 12

Help > Install New Software…

Thursday, March 8, 2012

slide-13
SLIDE 13

Note: Default PDT is Not up-to-date

Thursday, March 8, 2012

slide-14
SLIDE 14

http://download.eclipse.org/tools/pdt/updates/3.0/milestones/

Instead, you may want to use the milestones repository…

Thursday, March 8, 2012

slide-15
SLIDE 15

You could just get the “PDT Runtime Feature”

Thursday, March 8, 2012

slide-16
SLIDE 16

Thursday, March 8, 2012

slide-17
SLIDE 17

Thursday, March 8, 2012

slide-18
SLIDE 18

After installation comes a prompt to restart…

Thursday, March 8, 2012

slide-19
SLIDE 19

Install other Eclipse plugins

Thursday, March 8, 2012

slide-20
SLIDE 20

Thursday, March 8, 2012

slide-21
SLIDE 21

Name: XTND.US Location: http://xtnd.us.downloads/eclipse

Thursday, March 8, 2012

slide-22
SLIDE 22

Thursday, March 8, 2012

slide-23
SLIDE 23

Thursday, March 8, 2012

slide-24
SLIDE 24

Install other Eclipse plugins

eGit for GUI-based Git repository actions

Thursday, March 8, 2012

slide-25
SLIDE 25

Thursday, March 8, 2012

slide-26
SLIDE 26

Click on this this icon near the top right → Git Repository Exploring

Thursday, March 8, 2012

slide-27
SLIDE 27

Add existing… Clone… Create new… 1) Look for nested… 2) Search 3) Select 3 Choices:

Thursday, March 8, 2012

slide-28
SLIDE 28

The eGit interface

Thursday, March 8, 2012

slide-29
SLIDE 29

Install other Eclipse plugins

Subclipse for GUI-based SVN repository actions

Thursday, March 8, 2012

slide-30
SLIDE 30

Note: You really probably want Subclipse. But Subversive is the default SVN integration plugin.

Thursday, March 8, 2012

slide-31
SLIDE 31

http://subclipse.tigris.org Name: Subclipse 1.6.x (Eclipse 3.2+) Location: http://subclipse.tigris.org/update_1.6.x

Thursday, March 8, 2012

slide-32
SLIDE 32

Thursday, March 8, 2012

slide-33
SLIDE 33

Critical Stuff: Preferences

Drupal Coding Standards tweaks…

Thursday, March 8, 2012

slide-34
SLIDE 34

Preferences > General > Text Editors

Thursday, March 8, 2012

slide-35
SLIDE 35

Preferences > General > Workspace

Thursday, March 8, 2012

slide-36
SLIDE 36

Preferences > PHP > Code Style > Formatter

Thursday, March 8, 2012

slide-37
SLIDE 37

Preferences > PHP > Editor > Save Actions

Thursday, March 8, 2012

slide-38
SLIDE 38

Preferences > Web > CSS Files > Editor

Thursday, March 8, 2012

slide-39
SLIDE 39

Preferences > Web > HTML Files > Editor

Thursday, March 8, 2012

slide-40
SLIDE 40

Preferences > XML > XML Files > Editor

Thursday, March 8, 2012

slide-41
SLIDE 41

Helpful Stuff: Preferences

Import Templates for Drupal hooks

Thursday, March 8, 2012

slide-42
SLIDE 42

http://drupal.org/project/eclipse

You can install both Drupal 6 and Drupal 7 core hooks.

Note: This is NOT a module & both download as a folder called “eclipse”. Rename, if you like.

Thursday, March 8, 2012

slide-43
SLIDE 43

Preferences > PHP > Editor > Templates

Thursday, March 8, 2012

slide-44
SLIDE 44

Thursday, March 8, 2012

slide-45
SLIDE 45

Creating (or customizing) your own templates

Thursday, March 8, 2012

slide-46
SLIDE 46

Look at an existing function template

Thursday, March 8, 2012

slide-47
SLIDE 47

Look at the pattern…

2) Variable parts get wrapped in ${…} 1) Dollar signs get doubled 3) ${cursor} is where the cursor is placed after variable replacement.

Thursday, March 8, 2012

slide-48
SLIDE 48

http://drupalcontrib.org/api/drupal/contributions!views! docs!views.api.php/group/views_hooks/7

Get code for a contrib API hook: Example uses a D7 Views hook

Thursday, March 8, 2012

slide-49
SLIDE 49

Copy and paste…

You may also want to add a docs block to the template.

Thursday, March 8, 2012

slide-50
SLIDE 50

Fix variables, etc…

Thursday, March 8, 2012

slide-51
SLIDE 51

Productive workflow

Keyboard shortcuts you’ll want to take home with you.

Note: The print version of the presentation does not illustrate all shortcuts

  • discussed. Most of these were demonstrated with recorded video “clips”.

Some of these have been changed to still graphics for the PDF.

Thursday, March 8, 2012

slide-52
SLIDE 52

Keyboard Shortcuts for better workflow

  • ⌘K (Ctrl + K) Next (Add shift key for “Previous” (e.g. to move between

function calls in an open editor window)

  • F3 Goto function declaration (in new editor tab if declaration is in another file)
  • ⌘D (Ctrl + D) Delete current line or selection
  • ⌘O (Ctrl + O) Lookup function in document (popup menu with all functions

in the current document)

  • ⌘ + Option + ↓ (Ctrl + Alt + ↓)

Duplicate current line or selection (below; use ↑ to duplicate above)

  • Option + ↓ (Alt + ↓) Move selected lines down (use ↑ to move them up)
  • ⌘/ (Ctrl + /) Toggle commenting (add or remove line comments in PHP code)
  • control + M (Ctrl + M) Toggle maximize/restore state of active view or

editor

Thursday, March 8, 2012

slide-53
SLIDE 53

⌘O (Ctrl + O) Look up function in document

Thursday, March 8, 2012

slide-54
SLIDE 54

Note: You can also see all functions by expanding files in the PHP Explorer perspective (available in PDT, only) or see the “outline” view in various perspectives.

Thursday, March 8, 2012

slide-55
SLIDE 55

⌘/ (Ctrl + /) Toggle line comments on and off for selected lines.

Thursday, March 8, 2012

slide-56
SLIDE 56

Preferences > General > Keys

Filter commands to find what you are looking for. Modify keyboard shortcut, if you like.

Note: ⌘-shift-L displays list menu of available keyboard shortcuts.

Repeating this keystroke pops up the illustrated “Keys” preferences.

Thursday, March 8, 2012

slide-57
SLIDE 57

Back to Plugins…

Ahtik - Eclipse Word Wrap

Note: This plugin is only for the PDT editor, the Aptana Studio 3 editor already includes a Word Wrap function. If you have both PDT and Aptana Studio 3 installed, you will see two different Word Wrap

  • ptions in the contextual menu, even though only one of them is

applicable to the editor you are currently using.

Thursday, March 8, 2012

slide-58
SLIDE 58

Name: Ahtik Location: http://ahtik.com.eclipse-update Ahtik - Eclipse Word Wrap Feature

Thursday, March 8, 2012

slide-59
SLIDE 59

Word wrap (OFF) 80-Character marker

Thursday, March 8, 2012

slide-60
SLIDE 60

Word wrap (ON) 80-Character marker

Thursday, March 8, 2012

slide-61
SLIDE 61

Word wrap (OFF) Word wrap (ON) Note: Line numbers not accurate with word wrap on

(Turn word wrap back off to see correct line numbers.)

Thursday, March 8, 2012

slide-62
SLIDE 62

Comparison: Textmate with “Soft wrap” feature on.

Thursday, March 8, 2012

slide-63
SLIDE 63

Note: With Aptana Studio 3 Eclipse plugin (at least when using Studio

3’s “PHP Source” editor), soft-wrapped lines are correctly renumbered if you drag a view wider or narrower (as illustrated — Aptana Studio info later).

Thursday, March 8, 2012

slide-64
SLIDE 64

Back to Plugins…

Eclipse Color Theme

Thursday, March 8, 2012

slide-65
SLIDE 65

Name: Eclipse Color Theme Location: http://eclipse-color-theme.github.com/update

Thursday, March 8, 2012

slide-66
SLIDE 66

Preferences > General > Appearance > Color Theme

I don’t mind the default theme, but maybe you want a different one.

Thursday, March 8, 2012

slide-67
SLIDE 67

Another very popular plugin…

Aptana Studio as Eclipse plugin

Thursday, March 8, 2012

slide-68
SLIDE 68

http://www.aptana.com/products/studio3/download

Thursday, March 8, 2012

slide-69
SLIDE 69

Thursday, March 8, 2012

slide-70
SLIDE 70

Aptana Studio 2: http://download.aptana.com/tools/studio/plugin/install/studio

Thursday, March 8, 2012

slide-71
SLIDE 71

Aptana Studio 3: http://download.aptana.com/tools/studio3/plugin/install

Thursday, March 8, 2012

slide-72
SLIDE 72

Preferences > Aptana Studio > Editors > PHP Note: This adds new editor preferences which will need “Tab policy” to be modified for spaces/2

(and others under Editors)

Thursday, March 8, 2012

slide-73
SLIDE 73

1) Commands > Bundle Development > Install Bundle 2) Select jQuery “Bundle” 1) Commands > Bundle Development > Install Bundle 3) Repeat “step 1” and select Drupal Bundle.

Thursday, March 8, 2012

slide-74
SLIDE 74

Mac/Linux: ~/Documents/Aptana Rubles

Where to find the “Rubles” (bundles) in your file system:

Windows: Aptana Rubles directory in your user folder.

Thursday, March 8, 2012

slide-75
SLIDE 75

At the time of my DrupalCamp Essen session this had me stumped.

It turned out that the hook and theme function templates found in the Commands menu (provided by Aptana-installed “bundles”, aka “Rubles”) only work when active in the “PHP Source Editor”, which is provided by the Aptana plugin. Bundle- added commands are “grayed out” when active in the PDT-supplied “PHP Editor” view, but it’s not easy to tell which editor is in use. For easiest use of Aptana Studio’s bundles, you may wish to uninstall PDT and the Drupal PDT plugin, then assign the “PHP Source Editor” to .module, .install, .test, profile, .engine, and .test files.

Thursday, March 8, 2012

slide-76
SLIDE 76

Keep an eye on the Cocomore Drupal Blog ( http://drupal.cocomore.com/blog ) for more tips to improve productivity in Eclipse / Aptana and for other useful Drupal-related articles. An article expanding on this presentation has now been posted: http://drupal.cocomore.com/blog/using-eclipse-pdt-drupal-development

Thursday, March 8, 2012