Drupal Notes
Notes: 1 | 2 | 3 | 99 |
Drupal DBUG meetup, 2/9/11: Photo Gallery
Use for SMMTC Photos!!
Fyi
- Meeting was held at Applied Trust
- plugging cheap hosting: AN Hosting - $5/month
More Photo Galleries - see
- Lullabot - more complicated but more powerful
- Karen's module views gallery also
Preliminaries
- starting with Garland theme, clean install
- content type = front page
- not doing coding for this demo - only using available modules
Steps
- Set PHP memory limit - increase e.g. to 96 M or 128 M. Default is often 32 M. (this page looks a bit like PHP Info page)
- Install modules - go to admin menu
- CCK module (Content Construction Kit) - really important module - content, content copy, content permissions, field group, file field, file field sources, image, imagefield, node ref, number, options etc.
- Features module - allows you to export and install on another site
- *Image cache, Image API - Image cache actions used to add borders and rotate
- IMCE - way to browse image
- *Lightbox2
- Views and Views UI
- Create content type
- set name, type = photo album. Used CCK to define 3 custom fields:
- CCK - manage fields: added, album cover, sort, photo... permitted file types, other settings. min/max resolution. file sources from filefield sources: IMCE browser = already on the server; or file attach from server directly. IMCE needs to work with files field in the database or use file-attach module - then IMCE can see it. (you say how you want this module to work)
- Sort field
- Photo field - # values = # photos. where to look.. move to final location? (this stuff sounds a lot like PHP). Keep arbitrarily uploaded files separate from others.
- Multisite = single codebase but multiple sites. site choices: all, default.. they can have separate modules, images etc. Default has settings.php, js, css, database stuff, etc. provides separation between core and modules. DON'T HACK THE CORE. everything s/b under sites somewhere.
- Note every content type you define is a node in Drupal. Node = parent, content type = child
- Drupal 7 is more optimized for performance (Kevin). Drupal 6: looks from R and L and if not found, looks in sites / default.
- If you have several galleries and want same background theme: put it in sites-all-themes. Each site can enable that theme.
- photo album, 3 fields - don't show label (hidden). teaser = for album core only. short - don't show, exclude. photos: full node view only. lightbox: thumbnail => original (image cache presets)
- Configure lightbox
- admin menu - site config - lightbox setup
- video setting?? or:
- Note there is a module called 'views caroussel' - has video setting too, and more
- tabs - slideshow (disable), html content - sizing (w and h), automatic image handling
- Configure image cache
- image cache actions stuff goes here too
- site building - image cache - list
- setup 2 presets: album cover (scale, put border around), thumbnail
- all content goes into Drupal in raw form
- for display, things also get stored in other ways - goes into the image cache, then can pull from the cache for speed subsequently
- can scale - 100; crop 100x100 square, xoffset yoffset center, etc.
- Define the view
- sitebuilding - views
- views = a way to pull info from db and present to the user = an sql builder really
- views does not work in a number of implementations though, e.g. Mongo db.
- 9 of 10 sites works great; 1/10 no optimized way, complex sites.
- if performance becomes an issue, try not using views.
- you can write sql instead of using views
- 4 stylings of views: grid, html list, table, unformatted (Neat!!)
- other views plugins have even more, e.g. calendar.
- Google Maps too
- Style the Album
- file field sources adds: file browser, file attach - in addition to upload, file dir on the IMCE / server
- NOTES TO SELF: maybe could build something to just upload photos, then I could edit it? Not sure - my process may still be better. I can probably do better than this?
- file field source - file attach - may have error, then need to patch.
- note e.g. if image cache to 100px x 100px, then cnage it to 50x50, this is a load on teh image cache and the server in general
- at some point you could need to flush your cache (site config - performance - clear cached data??)
Drupal DBUG meetup, 3/9/11: Drupal 7
Config
- XAMPP for local install, MAMP for Mac. XAMPP has Filezilla.
- In Drupal documentation, look under 'develop'
- for v7 on local, see drupal.org/project/drupal
- tar stands for tape-archive
- XAMPP uses htdocs. unzip into your web director, e.g. htdocs/dbug7 (for illustration)
- for ftp: upload zipped file (because hidden files not included e.g. .htaccess unless zipped), then unzip on server
- once files over - now create user, db, tell drupal
- in phpMyAdmin: one step in privileges: sites/default/default.settings.php - copy this file and call it settings.php. Don't need to change it though.
- If you're doing this local, there's a file to tell the name of the local so if you type that in browser, ti looks local and it doesn't look out on the internet.
- next re-start Apache server
- also edit xamp/apache/config/extra - vhosts file (for local
- restart paache again
- remember: shared hosts usually prefix e.g. with lizbauma
- so now finally putting it up in browser: no index.php so goes to install file instead. do standard choices. advanced options: host - something long probably; port, prefix .. these for shared webhost
- with this info, it goes to settings.php for you
- also creates tables e.g. 73 tables in DBUG db
- update notifications? good to do. will need some cron job on server running.
- now it is installed!
- folders: don't touch most folders (because if upgrades...) except DO play with sites, all, default folders. in /all, D6, may need to create subfolders /modules and /themes
- note user0 = anonymous user
- note you can change password in phpMyAdmin with sql commands
- local phpMyAdmin address: http://localhost/phpmyadmin
- can get mail server - Mark had one - maybe should look into this?
- if permissions get you down, try suphp = super user php - especially with shared host. move up to a VPS if a problem. default has a myriad of things but usually you won't put stuff there.
- see drupalmodules.com
- note WP is pretty easy to hack...
Upgrade to 7 or not? From modules perspective:
- look at author's longevity
- look at issue queue for a module
- look at usage statistics (how many sites using it)
- there's a mod you can install on 6 to give you a report on 7 modules
- have staging and or dev environment
- RSS feeds from security team
Must-have Modules
- Views (an sql builder)
- Path Auto (enable path, enable path auto)
- there may be a module for converting WP to Drupal...?
- CCK Content construction kit (v7 is part of core) - standard install gives you 2 content types: article, basic page. CCK allows you to add new fields to this... [looks interesting]
Drupal DBUG meetup, 4/13/11:
Basics
- a node is a unit of info i.e. content - like a blog post; images nodes can be a child of an article node, etc.
- nodes have a type. by default they have a title and body. if you want to have a field for e.g. product, price, etc. use CCK - lets you add fields to nodes.
- comments are always associated with some node, and there's parent/child thing there. comments have titles and content too. in D7 can give them fields too.
- tip: download and try stuff. See drupaldojo.com if you want videos. drupal.org/planet - series of posts on a particular topic
Modules
- feeds - for RSS feeds
- services - rest, json, xml...
Misc
- Databases - node table has content. nid = node id, vid = version id (see node revisions table)
- Drupal 7 needs PHP 5, Apache 2
- Drupal QuickStart
- Multisite - same server, 2 different databases... copy from default first... all is all sites... new dir: copy files folder and settings.php; if you put new db in settings then it will prompt for new db setup when you go there. or you may want to clone if similar to another.
- There is a Drupal plugin for Dreamweaver... might have problems in general with DW like with CSS
- komodoedit is another good code editor
Misc Drupal Notes, Tips
Notes and Tips
- prominent members / presenters: John (jcfiala - usual presenter), Mark Isaacson, Kevin Bridges (cyberswat)
- Firebug - there is a Drupal for Firebug plugin.
- groups.drupal.org/denver - can post Qs here and get valuable feedback.
- IRC a little more complicated (drupal.org/irc) - use Chatzilla.
- Look for Getting Started section on Drupal
- Drupal Camp Colorado, June 11-12
- cron: url/admin/cron.php -- run for efficiency
- site config - performance - clear cached data
- Drupalcon Chicago 2011 was recorded - can view sessions
Modules
- > 6000 modules in Drupal 6