New in Drupal7

65
!"#$%& ()* +, -./0#1 2 3#.4 56.76, 8") 3")..4 9+11 36:0#,4 ";0<==>"+11>6?>6:

Transcript of New in Drupal7

Page 1: New in Drupal7

!"#$%&'()*'+,'-./0#1'2'

3#.4'56.76,'8")'3")..4'9+11'36:0#,4'

";0<==>"+11>6?>6:''

Page 2: New in Drupal7

!"6':#@)&'-./0#1'

•! A.6B)>$'1)#7'–!-.+)&'C/4$#).$'

•! C.#,>"':#+,$#+,).'–!D,E)1#'C4.6,'F-./0#1'2G'–!5HI6.'96B$&4'F-./0#1'JG'–!()+11'-./::'F-./0#1'KG'

•! 36,$.+I/$6.&'

Committers

Page 3: New in Drupal7
Page 4: New in Drupal7

Changes for Users

Page 5: New in Drupal7

-2LM'

http://www.d7ux.org/

Page 6: New in Drupal7

()*'N,O6.:#P6,'D.>"+$)>$/.)'

•! ()*'ND'&)0#.#$)&'#7:+,+&$.#PQ)'$#&@&'+,$6'R>6,$)S$&T<'–! N%:'7)#1+,E'*+$"'>6,$),$?'–! N%:'I/+17+,E'6/$'&+$)'&$./>$/.)?'–! N%:'>"#,E+,E':4'&+$)%&'#00)#.#,>)?'

–! N%:':#,#E+,E'$")'0)601)'*"6'>6:)'$6':4'&+$)?'

–! N%:'>6,UE/.+,E':67/1)&'#,7'&)V,E&?'

Page 7: New in Drupal7

-)O#/1$'O.6,$'0#E)'Drupal 6

Drupal 7

Page 8: New in Drupal7

9)10'

Page 9: New in Drupal7

L&).&'>#,'>#,>)1'6*,'#>>6/,$&'

Page 10: New in Drupal7

W7+$'+,'01#>)'

Page 11: New in Drupal7

D7:+,'8"):)<'RX)Q),T'

Page 12: New in Drupal7

8661I#.'Y'X"6.$>/$&'

Toolbar shows new IA along the top

User specific admin shortcuts

User account-related info easily accessible

Page 13: New in Drupal7

D7:+,+&$.#PQ)'-#&"I6#.7'

Page 14: New in Drupal7

ZQ).1#4&'

Page 15: New in Drupal7

[).P>#1'$#I&'

Drupal 6

Drupal 7

Page 16: New in Drupal7

\67/1)'&>.)),'

Page 17: New in Drupal7

A).:+&&+6,'&>.)),'

Page 18: New in Drupal7

-)O#/1$=\+,+:#1'A.6U1)'

Page 19: New in Drupal7

8+:)]6,)'#,7'36/,$.4'&/006.$'

Page 20: New in Drupal7

5.2

5.0

8.3

New Minimum Requirements

Page 21: New in Drupal7

Changes for site builders

Page 22: New in Drupal7

\+S'#,7'\#$>"'A/I1+>'#,7'A.+Q#$)'U1)&'

Page 23: New in Drupal7

N,$).,#P6,#1+]#P6,'

•! ()*'$.#,&1#P6,'+,$).O#>)'•! X)#.>"':67/1)'&/006.$&'1#,E/#E)^#*#.)'&)#.>")&'

•! N,7+Q+7/#1'U)17&'>#,'I)':#.@)7'$.#,&1#$#I1)=/,$.#,&1#$#I1)'

•! X/006.$'O6.':)&&#E)'>6,$)S$&'F:&E>$S$G'$6':#@)'$.#,&1#P6,'6O'&"6.$'*6.7&'1+@)'R[+)*T':/>"')#&+).?'

Page 24: New in Drupal7

()*'$.#,&1#P6,'+,$).O#>)'

Page 25: New in Drupal7

(#PQ)'+:#E)'"#,71+,E'

Page 26: New in Drupal7

X)>/.+$4'

•! A.6:0$)7'O6.')^:#+1',6PU>#P6,&'6O'&)>/.+$4'/07#$)&'/06,'+,&$#11#P6,?'

•! A9A'U1$).':67/1)',6*'E16I#1'R@+11^&*+$>"T'O6.'R),$).'&6:)'A9A'").)T'O/,>P6,#1+$4?'

•! 3.6,?0"0'.)_/+.)&'@)4'+,'L`a'$6'I)'./,?'•! ()*'0).:+&&+6,'O6.'./,,+,E'&+$)'/07#$)&?''

•! a+:+$'16E+,'#;):0$&b'I);).'c667'>6,$.61?'

•! X$.6,E).b'01/EE#I1)'0#&&*6.7'"#&"+,E'#1E6.+$":?'

Page 27: New in Drupal7

d+)17'LN'F,))'33eG'

Page 28: New in Drupal7

d+)17'840)&'+,'36.)'

•! C661)#,'•! -)>+:#1=d16#$=N,$)E).'•! d+1)'•! N:#E)'•! a+&$'•! 8)S$=8)S$#.)#'•! 8#S6,6:4'$).:'•! (67)'C674'F16,E'$)S$'#,7'&/::#.4G'

Page 29: New in Drupal7

d+)17&'#0014'$6<'

•! (67)&'•! L&).&'F.)P.)&'36,$),$'A.6U1)G'•! 36::),$&'F.)P.)&'(67)'36::),$'Y'36::),$'L016#7G'

•! 8#S6,6:4'$).:&'F.)P.)&'8#S6,6:4'N:#E)G'

•! ZIB)>$&'O.6:'>6,$.+I/$)7':67/1)&'

Page 30: New in Drupal7

L07#$)'\#,#E).'

Install and update modules and themes from drupal.org!

Page 31: New in Drupal7

Changes for designers and front-end developers

Page 32: New in Drupal7

Z17'$#I1)^I#&)7'$"):)&'.):6Q)7'O.6:'>6.)'

Page 33: New in Drupal7

\#,4'0#E)')1):),$&'#&&+E,#I1)'

Page 34: New in Drupal7

`)^Q#:0)7'f?$01?0"0'

Page 35: New in Drupal7

`)^Q#:0)7'f?$01?0"0'

Page 36: New in Drupal7

`)^Q#:0)7'f?$01?0"0'

•! Re-engineered XHTML structure to facilitate CSS-only design.

•! Standard, semantic class/ID names (.section, #navigation, etc.)

•! Improved consistency throughout

•! Enables designers to create CSS-only themes without touching PHP

•! No more box.tpl.php

Page 37: New in Drupal7

X$#.@<'(#@)7'-./0#1'

Page 38: New in Drupal7

5.#,/1#.'$"):+,E'6O'>6,$),$'

•! g>6,$),$'*#&'#'I+E'&$.+,E'6O'M98\a'•! d+,)^E.#+,)7'>6,$.61'6Q).'*").)'f6,)f'0#.$'6O'>6,$),$'E6)&':)#,&'I)+,E'.)&06,&+I1)'O6.'f#11f'0#.$&'6O'>6,$),$'

•! X)>/.+$4'#Q).&)'•! WQ),'>6::),$&'#.)'+,'$"+&':+S'

Drupal 6

Page 39: New in Drupal7

•! g>6,$),$'+&',6*'#,'#..#4'6O'0#E)'0.60).P)&'$"#$'@))0&'$.#>@'6O'*"#$%&'I)),'0.+,$)7'&6'O#.?'

•! X)1)>PQ)14'"+7)'0#.$&'/,P1'46/%.)'.)#74'$6'0.+,$'$"):'*").)'hZL'*#,$?'

Drupal 7

...

5.#,/1#.'$"):+,E'6O'>6,$),$'

Page 40: New in Drupal7

`-d#'

Default mapping for nodes:

<?php $type->rdf_mapping = array( 'rdftype' => array('sioc:Item', 'foaf:Document'), 'title' => array('dc:title'), 'created' => 'dc:created', 'changed' => 'dc:modified', 'body' => 'content:encoded', 'uid' => 'sioc:has_creator', 'name' => 'foaf:name', ); ?>

Page 41: New in Drupal7

i#Q#X>.+0$'+:0.6Q):),$&'•! Bj/).4'k?lb'Bj/).4'd6.:&'m?mb'Bj/).4'LN'k?2'•! 7./0#1n#77n1+I.#.4FG'O6.'#77+,E'.)1#$)7'B&=>&&'U1)&'

•! ()*'DiDM'O.#:)*6.@'FO.6:'>8661&G'+,'>6.)'

•! 7./0#1n#77nB&=>&&FG'+:0.6Q)7'

•! L&)'Bj/).4'#16,E&+7)'6$").'iX'O.#:)*6.@&''

•! d6.:'DAN'7)0),7),>+)&'F&"6*'I6S'C'*"),'I6S'D'+&'>")>@)7G'

Page 42: New in Drupal7

Changes for coders

Page 43: New in Drupal7

X+:01)8)&$'

Page 44: New in Drupal7

$)&P,E?7./0#1?6.E'

•! RA#$>"'F>67)',))7&'.)Q+)*GT'#,7'RA#$>"'F.)Q+)*)7'Y'$)&$)7'I4'>6::/,+$4GT'&$#$/&)&'>#,',6*'I)'$./&$)7?'

•! `)Q+)*).&',6'16,E).'E)V,E'>#.0#1'$/,,)1'>1+>@+,E'$".6/E"'#11'$")'I#&+>'&$/o?'

•! `/,,+,E'$")'O/11'$)&$'&/+$)'$#@)&'#'16,E'P:)p'1)$'#'>6:0/$).'76'+$'O6.'46/q'

•! (6PU)&'#/$"6.'*+$"+,'mr'"6/.&'+O'0#$>"',6'16,E).'#001+)&'6.'I.)#@&'$)&$&?'

Page 45: New in Drupal7

Database The next genration

Page 46: New in Drupal7

8")'*"6'+,'$")'*"#$',6*s'

•! -#$#I#&)'#I&$.#>P6,'1#4).'/P1+]+,E'A9A%&'-#$#'ZIB)>$&'FA-ZG'

•! 8")6.)P>#1'&/006.$'O6.'#,4'A9A'&/006.$)7'7#$#I#&)'

•! :4&_1b'&_1+$)b'#,7'0E&_1'7.+Q).&'+,>1/7)7'

•! X/006.$'O6.':#&$).=&1#Q)'.)01+>#P6,b'$.#,&#>P6,&b':/1P^+,&).$'_/).+)&b'7)1#4)7'+,&).$&b'#,7'6$").'O)#$/.)&'

Page 47: New in Drupal7

X$#P>'X)1)>$'j/).+)&'

Drupal 6:

Drupal 7:

$result = db_query("SELECT nid, title FROM {node} !WHERE type = '%s' AND nid = %d", array($type, $nid));"$node = db_fetch_object($result);"

$node = db_query('SELECT nid, title FROM {node} !WHERE type = :type AND nid = :nid', array(':type' => $type, ':nid' => $nid))->fetchObject();"

Page 48: New in Drupal7

-4,#:+>'X)1)>$'j/).+)&'Drupal 6:

$result = pager_query(db_rewrite_sql('SELECT n.nid FROM {node} n WHERE n.promote = 1 AND n.status = 1 ORDER BY n.sticky DESC, n.created DESC'), variable_get('default_nodes_main', 10));"

Drupal 7:

$select = db_select('node', 'n')" ->fields('n', array('nid'))" ->condition('promote', 1)" ->condition('status', 1)" ->orderBy('sticky', 'DESC')" ->orderBy('created', 'DESC')" ->extend('PagerDefault')" ->limit(variable_get('default_nodes_main', 10))" ->addTag('node_access');"

Page 49: New in Drupal7

"66@n_/).4n#1$).FG'function hook_db_rewrite_sql($query, $primary_table, $primary_field, $args) {! switch ($primary_field) {! case 'nid':! $return = array();! if ($primary_table != 'n') {! $return['join'] = "LEFT JOIN {node} n ON $primary_table.nid = n.nid";! }! $return['where'] = 'created >' . time() - 3600;! return $return;! break;!}!

function hook_query_alter(&$query) {! if ($query->hasTag(‘node_access’)) {! $query->condition(‘created’, time() - 3600, ‘>’);! }!}!

Drupal 6:

Drupal 7:

Page 50: New in Drupal7

d+1)'X4&$):'

http

://fli

ckr.c

om/p

hoto

s/bu

nny/

Page 51: New in Drupal7

d+1)'DAN'+:0.6Q):),$&'

•! d+1)&'#.)',6*'U.&$^>1#&&'6IB)>$&'•! "66@nU1)n16#7FGb'"66@nU1)n&#Q)FGb'"66@nU1)n:6Q)FGb')$>?'

•! d+1)&'#.)':#,#E)7'#/$6:#P>#114p',6',))7'$6'7)#1'*+$"'tU1)&u'$#I1)'46/.&)1O'

•! "66@nU1)n/.1n#1$).FG'O6.'3-('&/006.$'

Page 52: New in Drupal7

X$.)#:'*.#00).'&/006.$'

•! `#$").'$"#,'.)O).),>+,E'U1)&'I4'0#$"b'46/',6*'.)O).),>)'$"):'I4'L`N<''&>"):#<==U1)=0#$"=U1)?)S$'

•! D116*&'46/'$6'>"#,E)'16>#P6,'6O'U1)&'7+.)>$6.4'*+$"6/$'#'7#$#I#&)'/07#$)?'

•! 0/I1+><==b'0.+Q#$)<==b'$):0<=='&/006.$)7'+,'>6.)?'

•! 36,$.+I/$)7':67/1)&'>#,'#1&6'>.)#$)'&l<==b'c+>@.<==b')$>?'

Page 53: New in Drupal7

APIs

Page 54: New in Drupal7

DAN&'

•! `61)&=A).:+&&+6,&'DAN'•! d+1$).=d6.:#$'DAN'

•! 3),$.#1+])7'&$#P>'>#>"+,E':)>"#,+&:'

•! a6>@+,E'O.#:)*6.@'

•! i6I'_/)/)'

Page 55: New in Drupal7

d+)17'DAN'

•! (6$',67)^&0)>+U>'•! -)>1#.)'#,4'),P$4'+,'-./0#1'#&'RU)17#I1)T'•! X*#00#I1)'&$6.#E)'I#>@^),7&'F>/..),$14b'Xja'I/$'06$),P#114'*)I'&).Q+>)&b')$>?G'

•! X/006.$&'$.#,&1#$#I1)'>6,$),$?'

Page 56: New in Drupal7

N:#E)'DAN'

•! N:#E)'$661@+$&',6*'+:01):),$)7'#&':67/1)&b'.#$").'$"#,'?+,>'U1)&'$"#$'/&).&',))7'$6'>604'6Q).?'

•! X/006.$&'+:#E)':#,+0/1#P6,')o)>$&<'&>#1)b'>.60b'.)&+])b'.6$#$)???'

•! 3#,'>6:I+,)'$")&)'+,$6'R+:#E)'&$41)&T'$"#$'>#,'I)'#001+)7'$6'#,4'+:#E)'F/&).'0+>$/.)&b'U1)'/016#7&???G'

Page 57: New in Drupal7

`)E+&$.4'

•! D/$6^0#.&)&'#,7'>#>")&'1+&$'6O'#11'O/,>P6,&b'>1#&&)&b'#,7'+,$).O#>)&'+,'#11'U1)&'

•! d#>+1+$#$)&'O#&$).'"66@'>#11&p'6,14'1660'$".6/E"':67/1)&'$"#$'+:01):),$'#'"66@'

Page 58: New in Drupal7

31#&&'.)E+&$.4'

•! D/$6^0#.&)&'#,7'>#>")&'1+&$'6O'#11'>1#&&)&''#,7'+,$).O#>)&'+,'#11'U1)&'

•! D116*&'46/'$6'76<'

•! ???O.6:'#,4*").)'$foo = new Foo;

Page 59: New in Drupal7

X0))7'#,7'&>#1#I1+$4'

•! A.6S4'#,7'.)Q).&)^0.6S4'&/006.$<'&).Q)'#,6,4:6/&'0#E)'.)_/)&$&'),P.)14'Q+#'0.6S4'

•! \#,4':+>.6^60P:+]#P6,&'$".6/E"'M-)I/E'0.6U1+,E'

•! X:#.$).'166@^#")#7'&4&$):'O6.'E.#II+,E'0#$"'#1+#&)&'

•! N,,6-C'7)O#/1$'&$6.#E)'&4&$):'F\4XjaG'•! 3-('&/006.$'O6.'U1)&'

Page 60: New in Drupal7

(67)'D>>)&&'N:0.6Q):),$&'

•! R#7:+,+&$).',67)&T'#,7'RI40#&&',67)'#>>)&&T'$*6'&)0#.#$)'0).:+&&+6,&'

•! D1$).'"66@n,67)nE.#,$&'#,7'"66@n,67)n#>>)&&n.)>6.7&'

•! (67)'#>>)&&'#001+)&'$6'/,0/I1+&")7',67)&'

•! "66@n,67)n#>>)&&FG'#116*&':67/1)&'$6'+,c/),>)'#>>)&&'6,',67)&'7)U,)7'I4'6$").':67/1)&'

Page 61: New in Drupal7

N,&$#11'A.6U1)&'Drupal 6

default.info

default.install

default.profile

Drupal 7 default.profile

Page 62: New in Drupal7

#D7CX

Page 63: New in Drupal7

8")'I6;6:'1+,)'•! W#&+).'$6'E)$'&$#.$)7'

–! 3")>@'.)_/+.):),$&'–!-6*,16#7'-./0#1'2'–! 3.)#$)'7#$#I#&)'–! N,&$#11'–!D77'$"):)&'Y':67/1)&'O.6:'+,$).O#>)'

•! W#&+).'$6'I/+17'6/$'–! N:0.6Q)7'#7:+,+&$.#P6,'–! 8"):).'O.+),714'

•! W#&+).'$6'7)Q)160'–!\6.)'>6,&+&$),$'#,7'c)S+I1)'

•! W#&+).'$6'+,$)E.#$)'–! `-d#'

Page 64: New in Drupal7

8"#,@&'$6T'

D,E)1#'R*)I>"+>@T'C4.6,'

O6.':#,4'6O'$")'&1+7)&q'

Page 65: New in Drupal7

3#.4'56.76,'

8")'3")..4'9+11'36:0#,4'

a6&'D,E)1)&b'3#1+O6.,+#'

";0<==>"+11>6?>6:'

>E6.76,v>"+11>6?>6:'

FlkwG'lx2^mxxx'