Szkolenie drupal-podstawy 2

download Szkolenie drupal-podstawy 2

If you can't read please download the document

Transcript of Szkolenie drupal-podstawy 2

  • 1. Drupal basics Part 2

2. Training plan Taxonomy Users management Creating new content types with field Image management (image style, galleries) 3. Taxonomy The taxonomy module allows you to categorize your contentusing both tags and administrator defined terms. It is a flexibletool for classifying content with many advanced features. Taxonomy administration page: admin/content/taxonomyCreate newvocabularyList of vocabularies 4. Add term to vocabulary Add termTerm nameAdvanced options:parents, synonims,related terms 5. Add vocabulary to content type 6. Create vocabularyVocabulary name: Brand 7. Add vocabulary to content type 2Advancedsettings ofvocabulary(field) 8. Create content with taxonomyTaxonomy options:Car brand 9. Create content with taxonomyTaxonomy options:Car brand 10. Taxonomy term pageTerm nameNodes assignedto term Page: taxonomy/term/1 11. PracticeCreate vocabulary Color for content type Car andadd some terms (black, red, blue, silver, etc...).User must select one option.Create vocabulary Body type for content type Carand add some terms (hatchback, coupe, etc...).User must select one option.Create vocabulary Car Equipment for content typeCar and add some terms (ABS, Alarm, ElectricWindows, Traction Control, etc...). User can selectone or more options.Add some Cars (nodes) and assign taxonomyoptions 12. More practiceCreate content type News: enabled comments,published on front pageCreate vocabulary News category and add someterms (Business, Sport, Technology, etc...). Usercan select one optionCreate vocabulary News tags and enable optionTagsCreate 5 news nodes, assign News category andad tags 13. Page taxonomy/term/TIDtaxonomy/term/[TID] display nodes assigned toterm [TID]taxonomy/term/[TID1]+[TID2]+[TID3] displaynodes assigned to term [TID1] or [TID2] or [TID3]taxonomy/term/[TID1],[TID2] display nodesassigned to term [TID1] and [TID2] 14. Term hierarchy (1)Terms can have hierarchy (parent - children)Select parentwith drag anddrop UI 15. Users basic informationsIn Drupal you can create users accountsEach user has name and numeric identificator(uid)After installation Drupal has one user administrator (uid = 1)Administrator has access to all optionsYou can assign roles to userYou can assign permissions to roles 16. Users roles - permissions Roles(anonymous, authenticated,moderator, editor)PermissionUsers(access user profiles,(admin, joe, steve) create story content,access comments) 17. RolesDefault roles after installation anonymous user all not logged in users authenticated user all logged in usersYou cant delete default rolesYou can create unlimited number of new roles 18. Create new roleNew role namePage: admin/people/permissions/roles 19. Role permissions Set permission to role: create page, story, car delete any page,story, car edit any page, story, carPage: admin/people/permissions 20. Inheritance permissions Inheritance of logged-on user permissions.No need to select if permissions are assignedto the role authenticated userPage: admin/people/permissions 21. Users management Add new userFilter optionsUpdate optionsUsers list Page: admin/people 22. Create new user Username, e-mail and password Status if blocked user cant log in Assigned rolesPage: admin/people/create 23. Users list User nameAssigned rolesEdit linkPage: admin/people/create 24. PracticeCreate roles and assign permissions: car editor, permissions: create, edit and delete car story editor, permissions: create, edit and delete storyCreate users: user2 role car editor user3 role story editorLog in as user2 and user3 and checkpermissions 25. Field (CCK in D6)CCK Content Construction Kithttp://drupal.org/project/cck (Drupal 7 has thismodule in core with names Fields)Default node has title and bodyFields allow to create additional fields for nodes(text fields, files upload, select lists, checkboxes, references to other nodes and users) 26. Using FieldsGo to edit content type Car: admin/structure/types/manage/car/fieldsManage fields andManege display 27. Manage fieldsCurrent node fields(defaults). You canchange order of fields.Create new fieldUse existing fieldCreate new group of fields(http://drupal.org/project/field_group) 28. Creating new field (1)Label Field name (stored in database asField type and fieldidentificator). Best practice: always insert widgetnode type as field name prefix, example:field_story_author, field_page_information (like in Taxonomy term) 29. Creating new field (2)RequiredHelp text, displayed under fieldon node add formFormat of text fieldDefault valueNumber of allowed valuesMinimum and maximum value 30. Creating new field (3)New fieldConfigure and Remove linksPage: admin/structure/types/manage/car/fields 31. Creating new field (4)New field on node add pagePage: node/add/car 32. Creating new field (5)Node view page: node/[nid]Node titleFile fieldNew field Taxonomy terms 33. Display fields (1) Label optionsDisplay formatPage: admin/structure/types/manage/car/display 34. Display fields (2)Display options: Label above Decimal marker: Decimal point Scale: 2 35. PracticeCreate new fields for Car node type: Gears integer, select list (options 4, 5, 6) Gearbox: - select list (options: manual,automatic) Kerb weight integer, suffix kg Door count integer, select list (options 3, 4, 5) 36. Other type of Field Add new field type: file upload Go to admin/modules and enable File moduleFile module 37. File module (1)Go to admin/structure/types/manage/car/fieldsand add new fieldField type: File 38. File module (2)Allowed files extensions File size restrictions Number of values: set to unlimited 39. File module (3) Go to node/add/car and add content with filesFile upload options 40. File module (4)Node view page Uploaded files 41. PracticeCreate new field: Documents field type: file upload, unlimited number of valuesCreate new group of fields, label: Files, name group_car_filesInsert fields Manuals and Documents into group FilesNode add pageField group: Files 42. PracticeCreate new group of fields, label: Details, name group_car_detailsInsert fields Engine size, Gears, Gearbox, Kerb weight,Door count into group DetailsGroup: Details 43. Fields: Image Image module provides an image upload field for Fields. Go to admin/modules and enable module ImageImage module 44. Image (1)Go to Content management Content types Edit Car Manage fieldsCreate new field: Photos, field_car_photos Field type: File - ImageField type: File - Image 45. Image (2)Allowed image extensionsImage options: ALT, Title,Default image 46. Image (3)Go to Content management Create content CarPhotos upload options 47. Image (4)Node view page:Uploaded photos 48. Image style Image style page: admin/config/media/image-styles 49. Image styles (1)Go to Site config Image styleAdd new styleAdd action: ScaleAction: Scale 50. Image styles (2) Preset edit options NameActionsNew actionsConfigure or delete action 51. Using Image style in Image field (1)Go to Content management Content types Edit Car ManageDisplaySet options for Photos field: Teaser: hidden Full node: width400px image linked to node ImageCache preset 52. Using ImageCache presets in CCK (2)Create Car node and add some photos larger than 400pxNow all imageshas the samewidth 53. PracticeCreate new ImageCache preset and assign itfor field Photos in Car node typeCreate new field in Story node type: Photos(field_story_photos)Create new Car node and test presetCreate new ImageCache presetAssign new preset for field Photosfield_story_photosCreate new Story node and test preset 54. Summary What you should know after this stage?TaxonomyUser managementCreate custom fields for contentCreate ImageCache preset and use it in CCKfields 55. Thank you for your attentionContact:Karol Bryksa Email: [email protected]: +48 517 767 205 Grzegorz Bartman E-mail: [email protected]: +48 882 515 514