March Meetup

Events happening in the community are now at Drupal community events on www.drupal.org.
dalin's picture
Start: 
2009-03-26 19:00 - 21:00 Asia/Hong_Kong
Organizers: 
Event type: 
User group meeting

Our March meetup is just around the corner.

This month Caphun will be giving an introduction to jQuery. jQuery is the JavaScript library that comes bundled with Drupal. It's what powers the flashy things like drag-n-drop lists, and collapsible fieldsets. But it also does a lot of subtle things that you might not always notice. Soon we'll all be able to add dynamic events to our sites.

Karim will be presenting on a topic that he hasn't yet revealed.

And, after hearing last time that Jay had gone in and evaluated each of the 3000+ modules in an attempt to figure out what to use on his site, I've decided to give a series of lightning talks on common modules. Having so many modules to choose from, it's difficult to know where to start. But 90% of the sites that I do all pull from the same few dozen modules. I think this will be a bit of an ongoing series where each time I pick a module category and spend 5 minutes on each important module in the category. I think this month I'll be talking about common CCK fields.

If you've got questions that you want answered, or there's a topic that you'd like to learn about, leave a comment below and we'll fit it in.

Also are there any thoughts on how to handle the food better? Comment below.

We'll again be meeting at SOHO Life
148 Connaught Road Central, Hong Kong Island
GMap

Please RSVP so we know what size room to book

Comments

drupal beginner

gemini150's picture

hi dave,

i have made a drupal site to help me organise teaching materials. you can take a look www.jidoku.com
i have put together a few modules to make it work and would be glad to share my beginners experience with anyone who may gain from it.

kevin

Sorry I can't make it (again)

anewty's picture

Sorry Dave and Cloneofsnake,

But won't be able to make it this time round as am in Beijing for work.

Third time lucky I hope! :-)

Andy

drupal ads

rgucci's picture

Anyone has any experience in implementing ads in drupal sites? I know about the ads module, I am after some more practical experience (or other alternatives to the advertising module), such as tiered advertising.

Thanks!

Russell JVM Gutierrez
Hong Kong Projects
flippingNORMALS
Web | Social Media | Mobile

Russell JVM Gutierrez

Good idea on sharing your

cloneofsnake's picture

Good idea on sharing your most used modules. Newbie can also try looking at http://drupalmodules.com/top-downloads - I like to check Firefox's "Most Popular" add-ons to see what other people are using... it would be nice if Drupal.org can have the same statistics opened for us to see.

Kevin - jidoku? As in 自読 "read by yourself" in Japanese? (Funny on Mac, jidoku comes up as 字毒 "word poison" by default! Quite a big difference in meaning huh?)

I got the Leveraging Drupal book and am blowing through the 1st few chapters, which are on setting up the dev / test / production environment "correctly" with CVS, SVN and Trac. I guess I will bring some of the "best practices" to discuss with the experts (Dave & Karim).

Only local images are allowed.

About Food, let's do this. We will order Pizza or other take out by 7:20, before starting the 1st session, then when food comes we can take a break.

@anewty we'll miss

dalin's picture

@anewty we'll miss you

@rgucci I don't personally have any ad experience. Here's a list of some common ad modules:
http://drupal.org/project/ad
http://drupal.org/project/ad_geoip
http://drupal.org/project/google_admanager
http://drupal.org/project/adsense
http://drupal.org/project/adsense_injector
http://drupal.org/project/adbard
http://drupal.org/project/shoppingads

@cloneofsnake there are module usage stats on Drupal.org:
http://drupal.org/project/usage

Also ordering by 7:20 sounds good. Should we order from the place that we went to last time? It was pretty good.

Also I think that we should skip the netcast unless someone specifically wants to view it.

@lilumi2008 Hearing about new people's experiences is always great. We'd definitely love to see what you're doing.

--
Dave Hansen-Lange
Web Developer
Advomatic LLC
East Asia Office
Hong Kong

--


Dave Hansen-Lange
Director of Technical Strategy, Advomatic.com
Pronouns: he/him/his

@cloneofsnake I was browsing

dalin's picture

@cloneofsnake I was browsing through the lists of top modules. The problem being that there's some modules in there that for various reasons have some pretty serious drawbacks and you may not want to use them (TinyMCE, Administration Menu, Poorman's Cron, CAPTCHA, MetaTags, XML Sitemap, Contemplate...).

--
Dave Hansen-Lange
Web Developer
Advomatic LLC
East Asia Office
Hong Kong

--


Dave Hansen-Lange
Director of Technical Strategy, Advomatic.com
Pronouns: he/him/his

cloneofsnake's picture

Dave gave us a really good tutorial before, now I'm reading the Leveraging Drupal book and the author, Victor Kane, has shared his very own best practice on setting up Drupal with CVS + SVN + Trac. Karim and I were talking about it on Friday and we thought we could spend some time to discuss about this and our own best practices on Thursday meeting.

Here's we Victor has in his book, first of all, he recommends using a dedicated server or VPS so you have total control of the server.

  1. MySQL (p.27)
  • make sure root user has password - # mysql -u root
  • login as root user, create Drupal user and database.
  • Installing Drupal 5
    • Use CVS - review HKDUG's previous CVS tutorials for details on commands - Dave's Version Control tutorial from HKDUG's 2nd official meeting and Nick's Drupal install through CVS wiki.
    • Move all files into web root, do not forget the .htaccess file - cp /tmp/drupal-5.7/.htaccess .
    • Set permission of settings.php file to 666 for installation wizard, change it back to 644 afterwards.
    • Choose mysqli if you have PHP5
    • Create user/1 admin - most experienced Drupal users only use this user on rare occasions, for upgrading and other superuser actions, to protect the session from being hijacked.
    • Consult Drupal.org's Configure Your Website to create a special admin role and everyday admin user.
    • "filesystem not writeable" error - create "files" folder in web root(?!) (eg: /var/www/hkdug is the web root, and www-data is the HTTP server user and group.) (p.37)
      # cd /var/www/hkdug
      # mkdir files
      # chown www-data:www-data files
  • CCK
    • Don't use the depreciated content type field Body, if you want a text area, you should add it yourself so that it gets treated the same as all your other fields.
    • Always use a prefix with all machine-readable field names, so that they may be easily identified in long selection lists while creating views. The prefix should identify the content type at a glance.
  • Subversion and Trac (Chapter 3)
    • Victor uses a Trac instance to visually review his repository and the commits, & to document the project milestone planning and tracking. (Bugzilla is an alternative - that is what Yahoo! uses internally, along with some smaller / lighter in house developed ticketing / issues tracking system.)
    • The sites directory is the ONLY directory you need to version, because all the rest comes straight out of a fresh Drupal release tarball.
    • Do you version your content assets?? (images, audio & video files, downloaded documents... etc) (p.58)
    • Moving the files directory under the sites directory is an efficient way to easily place images & doc file assets under version control -
      # mkdir sites/all/files
      # chown -R www-data:www-data sites/all/files
    • (Personally, I remember reading somewhere about using symlink to place files outside of drupal's directory structure for multisite or for easy upgrade. Is that a good idea? eg: http://acquia.com/node/42925)
    • When you make a commit, how do you version the state of the Drupal database??
    • Place SQL database dump inside sites directory to be included when making a commit to SVN - eg: ./sites/all/backup/db/hkdug_db_backup.sql
      # mkdir sites/all/backup
      # mkdir sites/all/backup/db
      # cd sites/all/backup/db
      # mysqldump -u db_username -p db_name > hkdug_db_backup.sql
      Enter password:
      #
    • (for more info on mysqldump, see http://dev.mysql.com/doc/refman/5.1/en/mysqldump.html
    • (I used to use the Backup and Migrate module & it excludes the data in a few tables including cache_* & watchdog, does any of you have a script or a stored procedure to accomplish the same in command line?)
    • Later on when you check out from the repository to make a working copy of your test site, you insert the SQL file back into the database - command:
      # mysql -u db_username -p db_name < hkdug_db_backup.sql
    • Holy crap... firefox just crashed!!! I almost had a heart attack!!!! Thank god when I restore the session it kept 100% everything I typed so far!!!!!!!! I'm totally amazed!!!!!!!!!!!!!!!!!!!!! But I need to stop now, I'll continue to type more tomorrow. There's no need to reply right now, although you could. We'll talk about these on Thursday!

    • OK, continue... so one of the questions I have is how do you combine the databases when multiple devs are working on the same Drupal site?
    • Before importing your sites directory into SVN for the 1st time, temporarily remove the ./sites/default/settings.php file because it is not convenient to place this site-specific file under version control. SVN will omit the file in future commits, or, to be sure, you can use the SVN propset ignore command:
      # cd sites/default
      # svn propset svn:ignore settings.php .
      (the trailing dot means the current folder.)
  • Using a Dedicated Server or VPS
    • You should create a system user with the same name as the application, so your client & staff can have secure shell & sftp access to the application, also without having to have root access to your server.
    • Same as creating the initial environment earlier, log in as root, create a system user and set of user directories:
      root@example.com:~ # adduser hkdugster
      Adding user 'hkdugster'
      Adding new group 'hkdugster' (1006) ...
      Adding new user 'hkdugster' (1006) with group 'hkdugster' ...
      Creating home directory '/home/hkdugster' ...
      ...
      Is the information correct? [y/N] y
      root@example.com:~ #
    • Still in root, navigate to the new user's directory /home/hkdugster, check out a copy of Drupal from CVS into /home/hkdugster/public_html, then issue:
      # chown -R hkdugster:hkdugster public_html/

      Now the public_html folder is owned by hkdugster user & hkdugster group. Next, issue:
      # mkdir public_html/files
      # chown www-data:www-data public_html/files/

      That's it, you don't have to log on as root anymore, do a # su - hkdugster

    WYSIWYG editing and image uploads

    rgucci's picture

    I'm working on club/bar site that has a couple of blogs where some authors post reviews of magazines, videos, movies, cds, fashion trends, etc. Basic formatting like bold, italics, justification have to be enabled, taking into account that the authors do not know HTML, but are familiar with sites like blogger.com. They should also be able to easily upload images (like movie flyers, CD album art, pictures of random people on the street in really bad outfits, etc.) and incorporate them anywhere into the review or news article that they are writing.

    So far, YUI seems to be the easiest to set up and configure, and image uploading works. I'm having a little trouble with the image pre-sets though. The site is already using ImageCache (the site is also selling music so using Ubercart) and it seems that the presets of ImageAssist and ImageCache are just duplicating functionality?

    What are other developers thoughts on this?

    How do you handle
    1. WYSIWYG editing
    2. Easy image uploads?

    Russell JVM Gutierrez
    Manager, Hong Kong Projects
    flippingNORMALS
    Web | Social Media | Mobile

    Russell JVM Gutierrez

    WYSIWYG is one of the areas

    cloneofsnake's picture

    WYSIWYG is one of the areas where people are having trouble with 'coz WYS I"NOT" WYG...

    I use FCKeditor, and if you check out the stats link Dave posted above, you can see that it is the top WYSIWYG editor for Drupal.

    As for easy image uploads, ideally users should be have to do with within the editor, right? FCKeditor has a built-in uploader AND you can opt for using plug-ins with FCKeditor, like the IMCE plugin, which will allow users to upload, browse whatever images already on the server, and even re-size them!

    Image Upload Woes

    rgucci's picture

    @cloneofsnake Thanks, I have just looked at FCKeditor as you suggested and yes, it allows easy upload of new images and to browse previously uploaded images, which though not crucial in the site I'm working on, is still a good feature. When you say resize, does it actually resize the image or just the height and width attributes of the image tag?
    What I am looking for in particular is:
    1. User writes the blog post, and uploads the image and positions it within the post
    2. System automatically creates a "preview" size for the image (similar to how ImageCache does presets) which is used in the src attribute of the IMG tag
    3. System links the image to the original (or again, another preset size), preferably with lightbox integration.

    So far, YUI, FCKEditor, TinyMCE can't handle this, or am I missing something?

    Russell JVM Gutierrez
    Manager, Hong Kong Projects
    flippingNORMALS
    Web | Social Media | Mobile

    Russell JVM Gutierrez

    Ah... the images within a

    cloneofsnake's picture

    Ah... the images within a blog post problem... I've been there.

    I don't exactly remember what I did, but I used FCKeditor, IMCE and ImageCache to solve that problem. Haven't used Lighbox myself but had seen it in action in many places, I don't think it'll be too hard to integrate that once you have the "images within a blog" problem solved.

    IMCE has built-in image manipulation functions like resize, crop and create thumbnails... I think I allowed users to mess with the images uploaded that way, but also had ImageCache presets to automatically resize a "medium" sized file that is limited to 500px or something (a shorter width than the max allowed content width size. Use CSS to center the images, so the default will work well within the blog content area.

    Check out IMCE to see if it can help you: http://drupal.org/project/imce

    Probably best not to hijack this thread any longer as it's for the March HKDUG meetup tonight. :)

    invit anonymous user ??? :)

    jdidelet's picture

    Hello,

    Can I arrive with an other french guy for the meetup of this thursday even if he's not subscribe in this group? He's fan of Drupal of course :)

    Julien Didelet


    Julien Didelet
    Founder
    Weblaa.com

    Sure, the more the merrier!

    cloneofsnake's picture

    Sure, the more the merrier!

    Greetings from newbies

    richardchui's picture

    I will be joining with my colleague (Joshua) tonite. We are completely new to Drupal but heard that the food would be great.....lol

    What a pain...

    jyhliu's picture

    ... i'm afraid i can't make i tonight as I've done my back in!

    Hope you have a fun and productive evening.

    Jay

    ps. Owwww.

    Thanks

    jdidelet's picture

    Thanks again for the meetup. It was really glad to meet you. I hope to continue sharing my experience with you and learning more about Drupal, pratise and increase my english and learn how we can order pizzas in cantonese :) :).

    Thanks you too of course about the presentation of JQuery. I thinks that it's a really nice solution to create a rich interface. For the futur, my question is : "Flex or JQuery when you want to create a rich interface ??". What do you thing ?

    I hope to see you again quickly. A suggestion for the next time. Can we do a presentation about the teaming (page, bloc...), or the best practise to implement and deploy Drupal with cvs or how you can deploy Drupal in a complex architecture (with multi-server (cache-server, application-server, db-server...)) and how can optimse the performance in Drupal. An other idea : the best practice for the multi-language website (for exemple in chinese and english :)).

    And sorry for my bad level in english and my french accent :)

    Julien Didelet


    Julien Didelet
    Founder
    Weblaa.com

    slightly advanced Views question

    spyderboy's picture

    Hi there... I am flummoxed by a Multi Views Multi Pagers (one view embedded in the other) problem (Views 2, Drupal 6):

    I am working on a magazine site. We have Issues, and Issues have Articles. I have created a view that lists Articles based on the related Issue (one at a time, with a pager). I have created another View that lists Issue's Covers (one at a time, with a pager), and used a .tpl file to embed the list_articles view.

    The end result is one Issue Cover, and one related Article. When I click the pager for the Article (I have changed Pager Element so there is no conflict with multiple pagers), it displays (using AJAX) the expected Article in place of the existing one. So far so good.

    When I click the pager for the Issue Cover, the Issue Cover and related Article change as expected, sort of.

    The problem is, if I was last looking at Article Pager 3 on Issue 1, when I click the Issue Cover Pager the Article Pager remains on '3'. Is there any way to force the child view to reset the pager value to '0'?

    One workaround I am considering if I can't get the child view's pager to reset is to use Views Carousel to display my Issue Covers, which also has it's limitations but will get me most of the way there (kinda works in my tests, just needs styling). Maybe JQuery Carousel has a way of adding a pager.

    Thanks!

    Pain in life is necessary. Suffering is optional.

    re: slightly advanced Views question

    dalin's picture

    Ok, that's hardcore, but I think I've got a method to do it. You can do it all with a few theme overrides of theme_pager and theme_pager_link. It'll look something like this:

    <?php
    /**
    * Implementation of theme_pager_link()
    *
    * @see http://api.drupal.org/api/function/theme_pager_link/6
    */
    function my_theme_pager_link($text, $page_new, $element, $parameters = array(), $attributes = array()) {
     
    // copy the first part of the original function
    $query = array();
      if (
    $element == 'my_issue_pager_element') {
       
    // Add a GET parameter onto the end of the pager URL, we'll look for this in my_theme_pager().
       
    $query['reset_article_pager'] = TRUE;
      }
     
    // copy the last part of the original function
    }

    /**
    * Implementation of theme_pager()
    *
    * @see http://api.drupal.org/api/function/theme_pager/6
    */
    function  my_theme_pager($tags = array(), $limit = 10, $element = 0, $parameters = array(), $quantity = 9) {
      global
    $pager_page_array, $pager_total;

     
    // If we are changing the page of the issue view, reset the page of the article view.
     
    if ($element == 'my_article_pager_element' && $_GET['reset_article_pager'] ) {
       
    $pager_page_array[$element] = 0;
      }

     
    // Call the original theme function to do the rest.
     
    return theme_pager($tags, $limit, $element, $parameters = array(), $quantity);
    }
    ?>

    I *think* that'll work. Hopefully the AJAX won't screw up my idea.

    --
    Dave Hansen-Lange
    Web Developer
    Advomatic LLC
    East Asia Office
    Hong Kong

    --


    Dave Hansen-Lange
    Director of Technical Strategy, Advomatic.com
    Pronouns: he/him/his

    exactly what I was looking for!

    spyderboy's picture

    Thanks Dave! Exactly what I was looking for. I will try it out and let you know how it goes.

    Apologies for the totally misplaced post! :)

    Cheers!

    Antonio

    Pain in life is necessary. Suffering is optional.

    follow up on my crosspost :P

    spyderboy's picture

    Just wanted to follow up on my cross posting. I made a proper posting (I think) on the Drupal forums, and also posted my solution. Those interersted should go here:
    http://drupal.org/node/422502

    Cheers Dave for the support!

    Antonio

    Pain in life is necessary. Suffering is optional.

    DrupalHK

    Group categories

    HKDUG Vocabulary

    Group notifications

    This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: