Difference between revisions of "Zack WIP Journal"

From Stadm
Jump to navigationJump to search
 
(36 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
Notes on current projects that are in progress
 
Notes on current projects that are in progress
 +
==Useful Links==
 +
*Cross-Browser Compatibility Tester: https://browserlab.adobe.com/en-us/index.html
 +
*Crustal Admin Site: http://eri.crustal.ucsb.edu/
 +
*Shift + Command + N for incognito mode
 +
 +
==Setting Up Organic Groups==
 +
*Enable Organic Groups, Organic Groups Access Control, Organic Groups field access and Organic Groups UI
 +
*Create new content type called Groups and in the "Group" tab, click the option "Group Type" under "Group"
 +
*Save the group
 +
*Go to Configuration->Organic groups->Organic groups field settings
 +
**Select Group under Bundle, Group visibility under Field and then click Add Field
 +
**Select User under Bundle and Group Audience under Fields.
 +
*Set up a group using the content type you just created.
 +
**Select private under visibility.
 +
===Content Types===
 +
* You can create a field for linking a node to the new group on a content type by going to the content type configuration and choosing group content type under the Group tab.
 +
*Go back to the Organic groups fields settings and for the bundle Node->(content type), choose the field "Group content visibility."
 +
===Views===
 +
*Note: This requres og_views module, which is not yet stable for Drupal 7.
 +
*To set up a view that displays all nodes of a group, go to Organic groups fields settings
 +
*Add "Group Views" to the Group bundle.
 +
*Return to Group content type settings and under Manage fields, next to the og_views field, click edit
 +
**Select og_nodes(Default) under Default Values.
 +
*Under Manage Display, choose Group Views as Format for Group Views field.
 +
*If you created your group before this step, go to the group you wish to add group views to and select og_nodes(Default)
 +
===Removing Groups===
 +
*In addition to removing the group and all nodes associated, to completely remove a group you must remove it from the 'og' table from in the Drupal database using drush.
  
 
==Wiki Pages==
 
==Wiki Pages==
Line 6: Line 33:
 
*[[Drupal Wiki]]
 
*[[Drupal Wiki]]
  
==ERI Migration to D7==
+
==IT ERI Site==
===Unavailable modules for D7===
+
 
*BlogAPI
+
===Account Request Form===
*ImageFUpload
+
====JQuery/Ajax====
*Image Module (different image module in core)
+
*A JQuery and Ajax script within the webform-form-21.tpl.php file reads in the output of the php file get_groups.php and uses that as a json array in the jQuery autocomplete function
*ImageAPI (in dev)
+
**In the PHP snippet at the top of the template file, fields that should have drop-down functionality are given onfocus attributes that send the field id and vocabulary id (vid) that should be pulled from on the ERI site
*ImageCache
+
***The vocabulary id can be found by getting the machine id of the vocabulary on the ERI site, uncommenting the code at the bottom of the get_groups.php script, inputting the machine code into the function taxonomy_vocabulary_machine_name_load and running the file from the browser.
*URLAlter
+
****Note that "$vid = $_GET['field'];
*Trigger (user rules)
+
$term_array = taxonomy_get_tree($vid) or die("Could not load");
*Views Exporter?
+
$nlen = strlen($n);
*Sub-path URL Aliasing
+
foreach($term_array as $term)
 +
{
 +
$tojson[] = $term->name;
 +
}
 +
print drupal_json_output($tojson);" must be commented out for the script to load.
 +
*get_groups.php connects to the ERI database and pulls all the terms related to the vocabulary id given by the AJAX function depending on which field data is being requested for
 +
====Template====
 +
*The template for the webform (webform-form-21.tpl.php) sorts each field in the form by it's heading.
 +
**To do this, the associative array of the fields is converted to an indexed array and then filtered by the sequence that it falls into (e.g. the the arrays at index 1 and 2 -- the policy acceptance fields -- are put into a new array for policies, $form_policies)
 +
**Each of these new, filtered field arrays is printed out within its own div tag, preceeded by a header (eg. Policy Acceptance and Permissions).
 +
*The template file also contains the JQuery and AJAX code for creating autocomplete functionality on various fields (see JQuery/AJAX above).
 +
 
 +
===To Do===
 +
*Ask Aaron about the Scheduled Outage announcement form -- whether we want it to be included in announcements? Should it generate HTML or go straight to DB?
  
===Pages needed in new site===
+
===Announcements===
*Events/News (which should also contain seminars)
+
*Need to fix scheduled outage form -- the form action leads to nonexistent page
*Anual Reports
 
*Research (Connected to people?)
 
**->SpotData?
 
**What do we do with Awards?
 
*People
 
*Outreach?
 
**Links broken
 
**Should some of it become a 'links' page?
 
**No need for Lesson Plans Dropdown
 
*Administrative
 
**Do we need ERI Graphics?
 
*Contact
 
**Can pretty much get rid of submenus
 
**Mission is on front page already
 
*External Links
 
  
===Front Page===
+
===Wiki===
<strike>Made from Two Column Panel</strike>
+
*Flexifilter can be used for parsing mediawiki text.
*Where are people located?
 
**AM Module 1
 
**Not really able to edit anything
 
*Aaron's test module
 
**Location: http://eri.ucsb.edu/admin/settings/mission_block
 
**Could just export module
 
**Rename, or do we want to do it with panels and a module?
 
*Image Gallery is View Template from Image module?
 
  
===Paths===
+
===Modules===
*Must export paths from URL aliases module
+
Install Views Accordion for FAQ
**Might have to set them manually
 
**In future,
 
  
===Content Types===
+
==ERI Migration to D7==
'''Note: Can't currently import content types on some installations. Need to figure out which module adds this option.'''
 
====News ('news')====
 
*Doesn't seem like we need "news:" field.
 
*Elements
 
**Title
 
**Date ('field_news_date')
 
**PI ('field_news_pi')
 
**URL ('field_news_url')
 
**Body (doesn't seem to be a field)
 
  
 
====People====
 
====People====
Line 98: Line 104:
 
**Research Page
 
**Research Page
 
***View automatically generates table of content type research
 
***View automatically generates table of content type research
 
===Export/Import Workflow===
 
*It seems like this process can be automated using "Features"
 
**Still must test
 
#Export Content Type on Old Installation
 
#Import Content Type on Upgraded Installation
 
#Export View on Old Installation
 
#Import View on Upgraded Installation
 
#Export Content of Content Type on Old Installation
 
#import Content of Content Type on Upgraded Installation
 
 
===Ask Aaron===
 
*<strike>Install Features on eri</strike>
 
*<strike>Where is the panel on the home page?</strike>
 
**<strike>Or is that its own module?</strike>
 
*Computer Account Request Form was never used -- still form from old icess website
 
*Reason we can't just upgrade directly
 
*What is the difference between current eri-dev and live eri site? Which came first?
 
  
 
===Theming===
 
===Theming===
Line 168: Line 156:
 
**Made variable $linked_logo_img equal to an image map link of the header image located at http://www-dev.eri.ucsb.edu/sites/default/files/jpeg.jpeg.
 
**Made variable $linked_logo_img equal to an image map link of the header image located at http://www-dev.eri.ucsb.edu/sites/default/files/jpeg.jpeg.
 
**This location can be changed by editing the variable
 
**This location can be changed by editing the variable
*Set map to cover only the ERI logo
+
*Set map to cover <strike>only the ERI logo</strike> main part of header
  
 
====Forms====
 
====Forms====
Line 180: Line 168:
 
*There are four separate views formatted the same way, which appear in the "content" region
 
*There are four separate views formatted the same way, which appear in the "content" region
 
**Each filtered by its own term (i.e. "Travel," "Personnel," "Workers' Compensation Forms & Liability Information," and "Miscellaneous Forms")
 
**Each filtered by its own term (i.e. "Travel," "Personnel," "Workers' Compensation Forms & Liability Information," and "Miscellaneous Forms")
 +
*URL shortened using the trim option on rewriting
 +
*trimmed to 50 char
 +
 
====Outreach & Education====
 
====Outreach & Education====
 
*Added taxonomy vocab "Outreach"
 
*Added taxonomy vocab "Outreach"
Line 238: Line 229:
  
 
===To Do===
 
===To Do===
*<strike>Fix titles so they are displayed on all pages other than home</strike>
+
*Some peoples profile photos are listed, but are not in the images folder
*<strike>Add gallery and upload image</strike>
+
*Linking PI profile to research
*<strike>Get migrate module and get Aaron to help migrate features</strike>
+
:*Could create a taxonomy let them share a term
**<strike>We can later export the features for this site, but to keep this clean I'm going to bild fresh versions of the views that I tested on the other sites.</strike>
+
::*What about overlaps, if people title their project the same thing
*<strike>Full menu</strike>
+
::*Requires multistep process (editing both nodes)
*<strike>What are we going to do with annual reports?</strike>
+
::*Autogenerate term from every new bio? Then use that term for every research project that researcher is associated with
*<strike>Need calendar module, display suite, multiple file upload module and "Shorten URLs?" -- we should also get a better text input module... how does CKEditor get integrated into content forms?</strike>
+
:*Search Autocomplete module
**<strike>http://ftp.drupal.org/files/projects/ds-7.x-1.5.tar.gz -- display suite</strike>
 
*<strike>Remove link from bottom portion of site (caused by obtrusive header)</strike>
 
**<strike>Edit region -- branding</strike>
 
*<strike>Do styling for Profiles with Templates?</strike>
 
**<strike>CSS styling doesn't show up when not logged in!</strike>
 
*http://ftp.drupal.org/files/projects/shorten-7.x-1.1.tar.gz -- shorten URL
 
*What should we do with search function?
 
**As of now it just takes you to unformatted node pages
 
**Should we do some styling to make them look better, or is there an easier way?
 
*Fix for people
 
#<strike>Add edit link for profiles</strike>
 
#First name, last name fix
 
#<strike>Yes/no boolean fix</strike>
 
*Fix all institutions
 
 
 
===Activated Modules===
 
*Quicktabs ------------------------------Needed for People/Research
 
**Quicktabs Style module activated, but do we need it?
 
*<strike>CKEditor</strike>---------------Couldn't figure out how to use it...leaving it out for now.
 
*<strike>Admin----------------------------------Testing to see if it allows rearranging items</strike>
 
**You can rearrange by hiding 'weights'
 
*Dates
 
**All except Date Context, Date Migration, and Date Tools
 
  
 
===Module Template Editing===
 
===Module Template Editing===

Latest revision as of 10:30, 15 November 2012

Notes on current projects that are in progress

Useful Links

Setting Up Organic Groups

  • Enable Organic Groups, Organic Groups Access Control, Organic Groups field access and Organic Groups UI
  • Create new content type called Groups and in the "Group" tab, click the option "Group Type" under "Group"
  • Save the group
  • Go to Configuration->Organic groups->Organic groups field settings
    • Select Group under Bundle, Group visibility under Field and then click Add Field
    • Select User under Bundle and Group Audience under Fields.
  • Set up a group using the content type you just created.
    • Select private under visibility.

Content Types

  • You can create a field for linking a node to the new group on a content type by going to the content type configuration and choosing group content type under the Group tab.
  • Go back to the Organic groups fields settings and for the bundle Node->(content type), choose the field "Group content visibility."

Views

  • Note: This requres og_views module, which is not yet stable for Drupal 7.
  • To set up a view that displays all nodes of a group, go to Organic groups fields settings
  • Add "Group Views" to the Group bundle.
  • Return to Group content type settings and under Manage fields, next to the og_views field, click edit
    • Select og_nodes(Default) under Default Values.
  • Under Manage Display, choose Group Views as Format for Group Views field.
  • If you created your group before this step, go to the group you wish to add group views to and select og_nodes(Default)

Removing Groups

  • In addition to removing the group and all nodes associated, to completely remove a group you must remove it from the 'og' table from in the Drupal database using drush.

Wiki Pages

IT ERI Site

Account Request Form

JQuery/Ajax

  • A JQuery and Ajax script within the webform-form-21.tpl.php file reads in the output of the php file get_groups.php and uses that as a json array in the jQuery autocomplete function
    • In the PHP snippet at the top of the template file, fields that should have drop-down functionality are given onfocus attributes that send the field id and vocabulary id (vid) that should be pulled from on the ERI site
      • The vocabulary id can be found by getting the machine id of the vocabulary on the ERI site, uncommenting the code at the bottom of the get_groups.php script, inputting the machine code into the function taxonomy_vocabulary_machine_name_load and running the file from the browser.
        • Note that "$vid = $_GET['field'];

$term_array = taxonomy_get_tree($vid) or die("Could not load"); $nlen = strlen($n); foreach($term_array as $term) { $tojson[] = $term->name; } print drupal_json_output($tojson);" must be commented out for the script to load.

  • get_groups.php connects to the ERI database and pulls all the terms related to the vocabulary id given by the AJAX function depending on which field data is being requested for

Template

  • The template for the webform (webform-form-21.tpl.php) sorts each field in the form by it's heading.
    • To do this, the associative array of the fields is converted to an indexed array and then filtered by the sequence that it falls into (e.g. the the arrays at index 1 and 2 -- the policy acceptance fields -- are put into a new array for policies, $form_policies)
    • Each of these new, filtered field arrays is printed out within its own div tag, preceeded by a header (eg. Policy Acceptance and Permissions).
  • The template file also contains the JQuery and AJAX code for creating autocomplete functionality on various fields (see JQuery/AJAX above).

To Do

  • Ask Aaron about the Scheduled Outage announcement form -- whether we want it to be included in announcements? Should it generate HTML or go straight to DB?

Announcements

  • Need to fix scheduled outage form -- the form action leads to nonexistent page

Wiki

  • Flexifilter can be used for parsing mediawiki text.

Modules

Install Views Accordion for FAQ

ERI Migration to D7

People

  • Current "People" view is Aarons test module
    • People aren't in content type, so cant be exported
  • Need fields:
    • Name
    • Title
    • Department
    • Image
    • Office
    • Phone
    • Fax
    • Email
  • Integration of People and Research
    • Quicktabs
      • Compute
        • Person
        • Address
        • Sites
      • Admin
        • Person
        • Address
      • Researchers
        • Person
        • Department
          • Main
          • Sub
        • Address
        • Research
          • Research Page
            • Link to dept
            • Link to Research tagged with taxonomy person
              • Use "Custom Text" field, and add var to address of view module
          • Dept. Funding Page
    • Research Page
      • View automatically generates table of content type research

Theming

All CSS theming is fully commented in the global.css document in the eriomega theme

  • Added bg.jpg, wrapper_bg.jpg, and transparent_header.png to /var/www/vhosts/www.eri.ucsb.edu/sites/all/themes/eriomega/images/
    • For header images and background
    • Wrapper background was uploaded through eriomega theme settings
  • Hid site title slogan in "eriomega/css/global.css"
    • Unchecked site name and site slogan in eriomega -> Toggle Libraries
    • Unchecked Menu and Secondary menu also
  • moved id zone-menu-wrapper up in global.css
    • using margins
    • otherwise, header image pushes everything down
  • Had to make padding-left on #zone-content 30px to push it inside wrapper located in global.css
  • Set width and height of background in global.css to make it match up with wrapper background
    • In body
  • Disabled page title
  • Tried multiple methods of changing list styling
    • Edited global.css to make .menu and all li styling a disc
    • Created omega-menu.css and variants as well
  • Issue with large text in node lists fixed in global.css
    • Original text size of 28px set by omega-text.css, but when I copied it to the eriomega css folder, drupal did not register any changes I made to the stylesheet.

Structure

  • Home is content type Basic Page with alias "home"
  • Mini panel on front page that displays two columns
  • Text content below that that displays links to previous site
  • Turned off Main Page Content block
    • Needed for some content -- like in ERI Links menu
    • All content should become its own page, or a block on an existing or new page
  • Footer block at bottom
    • Pushed down 50px in CSS code
  • Title on front page hidden in global.css
    • .front h1.title {}

People Quicktabs

  • Quicktabs of vocabulary "Employee Categorization"
    • Administrative Staff=term ID 6
    • Compute Staff====term ID 7
    • Research Staff====term ID 8
  • Page View = 'people'
    • Filtered by
      • Content type = Bio
    • Contextual Filters
      • Content: Has taxonomy term ID ------> Specify validation criteria -------> Categories ---------> Employee Categorization
      • ------------------------------------------------------------------------------------------------------>Filter Term Type ----> Term ID
    • path = people/%
      •  % shows that it is getting a variable passed from quicktabs equal to the term ID of the category of the employee

Header

  • The image header is not set with the default drupal image upload
  • Set map to cover only the ERI logo main part of header

Forms

  • Categorized by taxonomy "Form Type"
  1. Travel
  2. Personnel
  3. Workers' Compensation Forms & Liability Information
  4. Miscellaneous Forms
  • Content type "Administrative Form" allows Title of form, body (for links to form), file and term (only one of which can be selected to avoid redundant links on the forms page)
    • File should have multiple upload option -- need new module for this
  • There are four separate views formatted the same way, which appear in the "content" region
    • Each filtered by its own term (i.e. "Travel," "Personnel," "Workers' Compensation Forms & Liability Information," and "Miscellaneous Forms")
  • URL shortened using the trim option on rewriting
  • trimmed to 50 char

Outreach & Education

  • Added taxonomy vocab "Outreach"
  1. Outreach
  2. Education
  3. Lesson Plan
  • Added content type "Outreach"
    • Can be used to add any type of Outreach... even education
      • If adding education, user should add body of text. If other term, a link field is incorporated into the form
  • Page "outreach" will contain view of Outreach and Education tables
    • Max number displayed in outreach view will be 20, but there is a pager that will allow user to view more.
    • Educational Components block placed under outreach block in "Outreach & Education" page
  • Migrated content from outreach on old eri site to www-eri

Lesson Plans

  • Trying to copy structure from old eri site, except want to make list more dynamic
    • How can we make the view register the term id for each new Lesson Plan as an argument?
  1. Field added for NID
  2. NID rewritten with text "http://www.eri.ucsb.edu/outreach/lesson-plans/plan/[nid]" and link "http://www.eri.ucsb.edu/outreach/lesson-plans/plan/[nid]"
  • To be displayed as submenu of Outreach & Education
    • Will list lesson plans
      • located at outreach/lesson-plans
    • These lesson plans can be clicked to take to following page of subpath outreach/lesson-plans/plan/[id]
  • If Lesson Plans view is edited, Lesson Plans menu item will be moved to bottom of main menu, and must be moved back up to it's place as a submenu of Outreach
    • This could be changed by making the menu static as a link and removing it's default menu link in the view
    • There isn't a way to set it as a submenu within the view configuration
  • New page view for "plan"
    • Unformatted list with contextual filter
      • Content: NID
        • Validation criteria checks to see if content type matches "Outreach, Educational Component, or Lesson Plan"
        • Then does a filter value format by Node ID, which checks URL argument, and gets matching Lesson Plan node
  • User must select unfiltered HTML if they want to write in HTML (but we should get a better text input module for this)
  • To add text at the top of "Lesson Plans," go to Lesson Plan's Page Content, and edit the body -- this will appear above the lesson plans table

Links

  • There are three link category menus displayed in the External Links menu that contain links categorized by the same three taxonomy terms
    • Each menu link links to its own page, which displays a view of all links with that taxonomy term
    • The view contains three fields, Title, Link, and About
      • Title is not displayed (Exclude from Display) in Fields -> Title in view customization menu
      • Link field is displayed, and altered with "Rewrite results" (in Fields -> Links -> Rewrite Results) to display [title] and link to [field-link]
  • UCSB is cloned view of UC Links Page
  • ERI is its own view, but is a block rather than a page to be displayed below Main Page Content on Eri Links page
    • has its own URL, filter, title, etc.
  • Removed User Login in sidebar, and placed link to login form in administrative menu

Gallery

  • View that displays slideshow of images from content type "Image"
    • Currently has pager that allows user to click next, back etc to see other images
    • Aaron still needs to install JQuery to get it working correctly
  • Content displayed includes caption and image
    • title hidden in stylesheet
  • Styled in global.css to space out image and caption

Events

  • Added function to template.php in eriomega to hide display of "(All Day)" for events without a set time.
  • Edited width of Date and PI columns in global.css for Events table
  • Taxonomy term Event or Seminar

To Do

  • Some peoples profile photos are listed, but are not in the images folder
  • Linking PI profile to research
  • Could create a taxonomy let them share a term
  • What about overlaps, if people title their project the same thing
  • Requires multistep process (editing both nodes)
  • Autogenerate term from every new bio? Then use that term for every research project that researcher is associated with
  • Search Autocomplete module

Module Template Editing

  • Modules can be edited by copying template file from sites/all/modules/[module name]/theme to sites/all/themes/[theme name]/templates/
  • Must refresh cache for most changes to take effect.
  • I am working on theming views-view-unformatted.tpl.php
    • Seems to only effect some div tags -- I'm trying to:
  1. First add an id to the elements span and div that display the author, date, and category for editing in css
  2. Either edit in stylesheet, or find a way to hide it in the template
  • Actually, this change should be made in omega/omega/templates/node.tpl.php
  • I added the id "page_date" to the "footer submitted" element, which can be hidden in global.css to hide the date and name of the submitter
  • Alternatively, we could remove the line in the entire line from node.tpl.php in the eriomega subtheme (templates/node.tpl.php)
    • Couldn't find location in templates of the items we want to move below the "footer"
    • Just styled the classes
  1. field-label
  2. field-name-field-outreach-type


Node Export

  • Enabled Node Export Files, Node Export and Node Export XML
    • Had to change permissions to make export node an option in content
  • Import
  1. title --> title
  2. body --> body
  3. field_news_pi --> field_pi
  4. field_news_date --> field_date_time
  5. "event" --> field_event_type
  6. field_news_url --> field_event_url

Feeds

  • Feeds can be used in two ways
  1. To sync data from an rss feed
  2. To import or migrate data in the form of a CSV file
  • For the site, I created a script, which is currently located at http://www-dev.eri.ucsb.edu/sites/all/themes/eriomega/build_csv.php
    • To use, place an exported xml file containing data from the old events database into the same directory as the script
    • the script should initially load a form that will ask you for the name of the file -- select it in the drip down menu and press Submit.
    • a link will appear to download the converted file
  • Once you have converted to csv, on the new ERI site:
    • go to /import
    • select "Events Import"
    • leave all options as they are, and choose the converted file with the upload form
    • Click "Import"
  • How the script works:
    • build_csv.php uses simplexml to read in the xml source, and put each value in the 'node' child into an array
    • fwrite writes the categories at the top (separated by semicolons)
    • each element in the array is printed into a string, which is then written to [document name].csv (again separated by semicolons)
  • How feeds works
    • In the feeds configuration settings, there is an option to add more import functions
    • I created an import function specifically for events
    • In Node Processor Mapping, you can select which CSV fields should be put into each Event Field in Drupal
    • The content type can be chosen in Node Processor settings
    • There is an option to upload file, or to retrieve it from a website

People Profiles

  • Styled with global.css
    • Each field is given a div with css class profile-left, profile-right or profile-bottom
  • Fields with no returned data are hidden in "No Results Behavior" section of each fields settings in the profiles views configuration

People Import

  • URL should start with public://
    • Then name of image
    • Move files to sites/default/files

Organic Groups

Uses and Advantages

  • For creating sort of mini private Drupals within a Drupal site
    • Could be used instead of our quasi-wiki platform.
    • Might be more advanced than we need
      • Researchers could have groups?
  • Can be used to control what and where each user posts
  • Can be viewable by anyone or members only
  • Can have mailing lists
  • OGUR allows special user roles within the group

Setup

Must be setup as a Group Type, not Group Content Type (unless for subgroup)

Helpful Links

Forum thread on using arguments in Views: http://drupal.org/node/357082