Author: Rui

  • Drupal 7: Using Views function to create an “Our Team” page

    Drupal 7: Using Views function to create an “Our Team” page

    Views function (actually it is a module) is very powerful in Drupal. Many data visualization effects can be achieved with this function. So here is how I used Views function with the Grid format to create an “Our Team” page as shown below:

    Screen Shot 2014-04-25 at 9.16.09 AM

     

    From above you can see that every member has their name, photo and position. Click on the name it will bring you to each member’s web bio page, as shown here.

    Based on your own needs, you can add more items, such as email, phone number, etc.  The following is how we are going to do this:

    Step 1: create a new content type called “Team Profile” and add different fields as needed.

    To create a new content type, go to Structure -> Content Types. In this new content type, you want to have the title as people’s full names. Then you want to add an image field “Photo” and set its type as image. After this you want to add other text fields, based on your website needs. In this case, I only added three more text fields: Last Name, Position, and About.  I set Last Name and Position as short text, and About as Long text, since About will be a short web bio for each person. I also deleted the body field.

    Step 2: set display options for the new content type “People Profile”.

    Click on “Manage Display” tab for this content type of “People Profile”, you will see there are dropdown lists for each label and format. Select “Hidden” for the labels of Photo and Last Name. Select “Inline” for the label of Position. Select “Hidden” for the format of Last Name. Leave all other settings as is.

    Step 3: fill in each member’s information. 

    Go to Content -> Add Content, click on “People Profile” and you will see a blank member’s profile for you to fill in. Type in the name, position and bio. Upload the member’s photo. Click on Save.

    Step 4: create a new View for the “Our Team” Page. 

    Go to Structure -> Views -> Add new view. Type in “Our Team” as the view name. For Machine readable name, type in the same words but without spaces ( a machine readable name must only contain lowercase letters, numbers, and underscores.).

    Check “Create a page”. You can now give a page tile to this view page. Here we give it the name of “Our Team”. You will see the path to this page is http://yourdrupalsite.com/ourteam. Change the value for “Items to display” as 0 if you want all members to be displayed on the same page.

    Check “Create a menu link”.

    We don’t need to check “Create a block” since we are not creating a views block here.

    Click on “Continue and edit”.

    Step 5: set up the view.

    On the next page, under Format, choose Show: Fields, then choose “Grid”.

    Screen Shot 2014-04-25 at 11.31.28 AM

    Click on Settings to set the “Number of Columns” for this grid view as 3. You can change it to other numbers depending on your needs of the page.

    Screen Shot 2014-04-25 at 11.30.38 AM

     

    After that, click on “Filter Criteria”, then search for “type” to find “Content: Type”. Select “Content: Type” then click on “Apply”. Then on the next page, choose Operator as “Is one of”. Choose Content types as “Team Profile”. Click on “Apply (this display)”.

    Screen Shot 2014-04-25 at 11.33.41 AM

    On the edit views page, on the right of “Fields”, click on “Add”. Add fields of “Content: Title”, “Content: Photo” and “Content: Position”. Uncheck “Create a label” for content: Title and Content: Photo.

    To list all members alphabetically by their last names, click on “Add” next to “Sort criteria”. Search “Content: Last Name”. Select Content: Last Name (field_profilename) and click on “Apply (this display)”. On the next page, you can choose either ascending or descending. Click on “Apply (all displays)”.

    Screen Shot 2014-04-25 at 11.34.04 AM

    Click on “Save” to save the new view page.

    Step 6: styling the grid view. 

    Now you have the Our Team page with every member’s information. But you find it has the table borders. Also the columns are not evenly distributed. We need to get rid of the borders of the grid and set the table columns as evenly distributed- because the grid view is basically a table. To solve these problems, we need to add CSS styles for this view grid. The way to do it, is to add several lines of css in the css file under your theme folder:

    .views-view-grid  {

    border:0 !important;

    width:100%;

    }

    .views-view-grid tr, .views-view-grid td {

    border:0;

    }

    .views-view-grid td{

    width: 33%;

    }

     Note: here I defined the table width as 100% and each column width as 33% because I set the grid as 3 item per row. 

    Step 7: configure where you want this new views page to be linked. 

    Now you have already created the new views page of “Our Team”. You have also created a menu link for this page. The next step is to go to Structure -> menus -> main menu, and move this Our Team menu link to wherever you want.

    Now you have a dynamic auto-generated “Our Team” page on your site. Any time when you need to add, edit, or delete a member’s profile, you only need to go to that member’s profile page and make the changes there. The changes will automatically appear on your “Our Team” page.

     

  • International Association of Accessibility Professionals Offers free membership through march 2015

    Screen Shot 2014-04-01 at 4.03.27 PM

     

    Membership fee after march 2015 would be $185. The registration process doesn’t ask for credit card info, so no worries about auto-renewing. (This is not an April 1st joke.)

    Link is here: http://www.accessibilityassociation.org/

     

  • Using Font Awesome in Drupal Pages

    Using Font Awesome in Drupal Pages

    Font awesome allows you to add html based icons to your website. The icons are vector so you don’t have to worry about it changes shape, gets blurry, etc. I am using it in the SLIDER curriculum website and it works great. I only had to install the font awesome module to the drupal site in order to use it!

    FontAwesome

     

  • Reinstalled and set up Drupal site

    On the night of Mar 16, the site I am working on crashed.

    On the night of Mar 17th, I backed up all local and remote website files in the folder of “firstversion” and then reinstalled Drupal, in the hope of reducing page loading time and fix some admin page problems.

    Step 1: create a new database:

    Step 2: download and upload the drupal 7.26 version.

    Step 3: ssh into the site and bash install the script – to install the modules and themes

    Now I am rebuilding everything I have done since Feb 7.

    The following are things need to be done:

    1. customize the looking:

       a. strip out the header and footer

       b. gt_slider info file

           i. change everything in gt_subtheme into gt_slider: gt_slider.info, gt_slider.css

           ii. Flush cache

           iii. enable gt_slider theme and set as default

       c. change the background of header:

    Changed the css of #masthead, #identity, #primary-menus, #gt-logo;

    added#slider-logo;

    got rid of <div id=”identity-wrapper class=clearfix”>

    changed images for gt-logo

    added image for slider-logo

    note: accidentally deleted “<div id=”main-menu-wrapper”>” and caused some problems.note: turned off configuration -> performance -” Aggregate and compress CSS files.”

    2. install nice menus module. configure nice menus:

       a. install nice menus

       b. create all main menu pages and menu level — changed the basic page publish option to immediate publish

      Note: Installed module special menu items

    http://ftp.drupal.org/files/projects/special_menu_items-7.x-2.0.tar.gz

    Purpose: to make certain level of menu item not clickable

    How to use it: go to structure->menu->main menu-> edit-> add link, type in “<nolink>” in path.

      After installation, go to page.tpl.php, and replace the code lines after “<?php if ($main_menu) : ?>” to the following:

    <?php

    $vars = array (

    ‘direction’=> ‘down’,

    ‘depth’=> -1,

    );

    print theme(‘nice_menus_main_menu’, $vars);

    See youtube video: http://www.youtube.com/watch?v=oPP6LNLeGcg

     

    3. create pages and menu links: done

     

    4. customize nice menus — need to be polished

     

    5. add login|sign up link:

        step 1: enable CAS

        step 2: add login|sign link to main menu, URL to “/user”

     

    4. homepage slideshow video slide show: done but need to figure out how to advance by clicking instead of auto

     

    5. homepage introduction block — set up as node block and then added to the homepage row

     

    6. set up the registration form: enabled two modules: field group and list. To add fields and field set, go to configuration -> people -> account settings. Check “include in registration” to include the questions in registration form.

     

  • united states state name abbreviations only

    I am making this SLIDER curriculum website for the NSF funded SLIDER project. For the Screen Shot 2014-04-04 at 1.55.07 PMregistration form, one item is to choose state from a dropdown list. Obviously, I need to add all the 50 state abbreviations manually. I didn’t want to type in all 50 abbreviations one by one, so I tried to google to see if there is any ready to use list so that I can just copy and paste. Unfortunately, most google results show a table including both the state full names and then the abbreviations — this makes solely copying the abbreviations difficult. After flipping several pages of google results, I finally I found one. In order for more people like me to find it, here it is – they are in plain text so to be easily copy and paste.

    AL
    AK
    AZ
    AR
    CA
    CO
    CT
    DE
    FL
    GA
    HI
    ID
    IL
    IN
    IA
    KS
    KY
    LA
    ME
    MD
    MA
    MI
    MN
    MS
    MO
    MT
    NE
    NV
    NH
    NJ
    NM
    NY
    NC
    ND
    OH
    OK
    OR
    PA
    RI
    SC
    SD
    TN
    TX
    UT
    VT
    VA
    WA
    WV
    WI
    WY

  • ebook vs. web app

    The SLIDER project I currently work on may want to publish their curriculum as an “eBOOK”. However, what my customer wants seem more than just a regular eBook like those you see on kindle or nook.
    What is the difference between a traditional ebook (published with epub 3 etc.) and a web app? Shouldn’t that be much easier to just wrap a html(5) based website and publish it as an app then use it as an eBook? I decide to do some digging.
    An interesting article read about it is: http://toc.oreilly.com/2012/10/ebooks-as-native-apps-vs-web-apps.html
    More results will be reported and discussed here later.

  • Question Banks for Math Grade 6-12

    Question Banks for Math Grade 6-12

    Image licensed under Public Domain CC0. Retrieved from http://pixabay.com/it/computer-piatto-questione-azione-27084/?oq=question%20bank
    Image licensed under Public Domain CC0. Retrieved from http://pixabay.com/it/computer-piatto-questione-azione-27084/?oq=question%20bank

    Many middle and high school classrooms already have clickers. It is a great system to collect students data and get instant feedback on the results of teaching. Teachers may write their clicker questions from scratch. However, what are other places that we can find questions? I have collected some free (or paid for a small fee) questions banks. Please contribute to this shared Google document if you know anything that is not here:

  • Protected: TTK Math Unit 3 Geometry (v.1.0)

    This content is password-protected. To view it, please enter the password below.

  • Protected: TTK Math Unit 3 Statistics (v.1.0)

    This content is password-protected. To view it, please enter the password below.

  • Protected: TTK Math Unit 3 Calculus (v.1.0)

    This content is password-protected. To view it, please enter the password below.