This section serves as a convenient resource on the basic things necessary to build your YaleSite with Drupal 7. These instructions are intended for Administrators and Site Builders, those who have permission to change the structure of your site and can perform all functions available in the YaleSite, including module configuration, user management, etc.
A Block is a container that allows you to add additional content to a region in your page. You can add images, contact information, a list of related links, an event promotion or anything you’d like to feature!
Blocks can be:
Create Blocks based on the needs of a specific site structure.
You can easily edit the content in any Block using the Gear icon that is a new feature in D7. Simply hover over the upper right corner of your Block. A contextual menu displays with options available based on the type of block you are working with:
Select the option Configure block and it brings you to the configuration area for that specific block.
Block Class allows you to add CSS classes to any block through the block’s configuration interface.
Allows you to turn the Title of your Block into a clickable link. When the module is enabled, the Block Title Link Settings section displays below the Block Body field in the Block configuration. Just add the path and title link attribute (_blank to open in a new window) and the title of your Block is a link.
Collapsiblock makes Blocks collapsible so you can show/hide content by clicking on the title of the Block. This is a great way to incorporate accordion style effect for a full node/page or in a sidebar region of your site. Simply create individual Blocks for each section you want to expand and/or collapse and assign them to a specific region and page. Important Note: These instructions are specific to the YaleSites instance of Drupal using the YaleSites Templates with Omega as the base theme.
Configure the Theme:
Configure the Module:
You should only do this if you want every block on your site to have this behavior.
Configure Each Block
In order to get the expand/collapse effect, each block need to be configured. When the Collapsiblock module is enabled, each Block has a Collapsiblock section after the Block is created.
Field as Block allows you to take a simple Field and display it as a Block on the current page. This block can eliminate the need to use other complex Modules such as Views, Panels or Display Suite by providing an easy way to display related information in the desired Regions of the page.
Create a page and add the Fields. You will notice that when you Save the page, the Fields don’t display. That is because they are now Blocks and they need to be assigned to the appropriate Regions.
Insert Block allows you to embed blocks into the body of your page without any intensive coding. You just need to identify the Block “Delta” and paste a line code in the body of the page where you want the block to display.
In simple terms, the Delta of a block is machine code that identifies the block. However, finding the delta for your block can be a bit challenging if you don’t know where to look.
To find the Delta:
– where name of module is the name of the module that created the block i.e. views
– delta of block is the machine name discussed in the section above i.e. portfolio-block_1 .
Example:
This is a Block create from a View that displays the 3 YaleSites Themes.
Allows you to create a block that lists Twitter posts for a specific account. It is relatively easy to configure.
As with all blocks, indicate the region (Sidebar First or Second)and pages you want the block to display.
Twitter Block Module is a 2 step configuration process: 1) get a Twitter ID for the Widget you want to display. 2) configure the Twitter Block Module.
The Twitter ID you will use is associated with a specific widget you want to use (User timeline, Favorites, List, etc). to create the Widget and then find the Twitter ID for that Widget:
Create and configure the Twitter Block as follows.
Menus are a set of links that allow site visitors to locate content on your site. When a Menu is created it is available as a Block and can be placed in the various regions of your site. Like Blocks, menus can be configured to display on specific pages, content types, and/or for specific people or types of people (roles).
There are two menus you can use to manage your navigation.
You can also create additional menus based on the needs of a specific site structure.
Once your menu is created you can add an item to it. These steps are useful for adding links to files or pages outside of your site. If you are adding new pages to your site, you could add them to the menu as you create the pages. (See Add your page to a Menu)
If you add a link to an external site, it is recommended you open that link in a new window. To do this, you need to enable the Menu Attributes module. Once enabled, you can configure each link to open in a new window.
Once your menu has been created, you might want to rearrange the order. Simply:
Taxonomy is a way to categorize your content using “tags”. Once tagged, the content can be grouped and listed based on the terms associated with the content.
A Taxonomy group is called a Vocabulary; a specific tag is called a Term. Once a Vocabulary is created, Terms are added. Then the Taxonomy can be added to the Content Type as a Term Reference field type.
Different types of content have different meanings. Content Types allow you to define the content on your site using fields to capture pieces of information independently of one another. Each Content Type is treated differently; different properties, fields, page displays, etc. With Content Types, you can arrange what and how you want your content to be displayed as well as control who manages and creates that type of content.
Your YaleSite has built-in features that provide Content Types to make it easier for you to create, update and display your information about your department or organization. In addition to creating basic pages with the Basic Page Content Type, you can create the following types of content providing the features are enabled on your site:
Fields allow you to capture small pieces of information, providing more control and flexibility in the display of content. Using Fields allows you to treat small pieces of content as an individual entity so that it can be listed in a specific order or formatted differently from the other text. For example, if you wanted to capture the phone number of staff members, you can control how the format of the number (###) ###-####, make it bold, and list it below the staff members name.
To define a field, you must consider the following:
When adding fields you will select field type and configure as directed |
Select Widget |
Boolean (on/off) |
|
Date |
|
Email – displays clickable email |
|
Entity Reference – connect to other content types/user profiles |
|
File – upload files, pdf, doc, xls etc |
|
Integer - for numbering and sorting |
|
Image – upload images |
|
Link |
|
Text |
|
List (text) - radio buttons or check lists |
|
Long Text – multiple rows |
|
Long Text and Summary |
|
Term Reference - referenced from taxonomy list |
|
Video Embed |
|
In addition to the standard fields that are available, the following modules provide more field types that give your more control over the types of content that is entered and how that content displays on the landing page.
The following Modules, while not necessary, are commonly used when creating Custom Content Types.
Automatic Nodetitles - Automatic Node Titles allows you to create custom title fields with the use of tokens so you can combine the first name and last name as the title field. Read more about the Automatic Nodetitle Module
Field as Block - This handy little module allows you to take a field and turn it into a Block that you can display in various field. A great way to simplify putting related content in the various regions of your site. Read more about Field as Block Module
External Links - External Links adds icons at the end of your links to indicate if the links point to an external site or is an email link. Read more about the External Links Module
Field Permissions - The Field Permissions module allows administrators to control who sees fields for your content types. For example, you might have a Content Type that captures an email address for the requestor, but you don’t want that information available to all people who view the site. Read more about the Field Permissions Module
Field Redirection - Redirects any field formatter for Link, Term Reference and Entity Reference fields that open a web page or URL. This module automatically redirects a page/node to the URL in the field entered. If no URL is entered in the field, the page/node is opened. A field settings widget is provided to allow selection of the appropriate HTTP status code. Read more about the Field Redirection Module
Fieldgroup - Allows you to create a group for fields created in your content type. Once enabled, the fieldgroup is created as a field and format to display is chosen. Then various fields that are part of that fieldgroup are added via drag-and-drop. Read more about the Fieldgroup Module
Title field – title of the page, regardless of the content type. The red asterisk * indicates a required field. Important Note: some Content Types have changed the label for the title field to a more appropriate label.
Text field – like the Title field, the Text field allows you to add limited text, but is not necessarily required. When special instructions are required, help text help text displays below the field.
Text List field – allows you to select from a list of options. These options can be check boxes, radio buttons or a select list.
Radio Buttons – if a select list displays radio buttons, only one option can be selected.
Check Boxes – if a select list displays check boxes, more than one option can be selected.
Autocomplete field – options are associated with a list of terms – taxonomy or other text list – allows you to locate the term by typing in a few letters of the word. Options can be chosen from the list that displays as the letters are entered. You can tell that it’s an autocomplete field by the circle that displays at the end of the within the field itself.
Date/Time field – used to add dates for publications and events. Incorporates a calendar widget to facilitate picking the date and ensure the date format is correct.
Image field – Used to upload an image related to the content. The image field has 2 buttons – the 1st to choose the image, the 2nd to upload the image to the server.
Link field – Used to add a link that is clickable. Link fields have the option to have a custom label or not. If there are 2 text fields to enter, the first field is the Title or label for the link – the text that will display as a link when done. The second text field is for the full URL which MUST include http:// or https://
Email field – These fields are usually found in People listings where the email for the associated person is added. Even though the field looks like a text field, when used, the text displays as a clickable link on the landing page.
Video field – Used to display video from 3rd party services YouTube and Vimeo. Adding the share URL from either of these services display a play in place video.
Long Text – Used to add multiple paragraphs of text with no limits. Some Long Text fields have the WYSIWYG toolbar which allows you to format text with limited options.
Long Text with Summary – allows you to separate the text into 2 independent sections. This is useful when the initial text of this field requires editorial oversight so the text fits within a smaller section or teaser (see http://news.yale.edu home page).
File field – used to upload a PDF, MS Word or other type of document to the site – DOES NOT INCLUDE IMAGES. Like the Image field, the files are uploaded to the website in 3 steps.
Your YaleSite automatically creates friendly URLs using Clean URLs and the Path Auto module. When you create and save a page, the URL is translated to the title of the page, replacing spaces with dashes (-) and eliminated words with three letters or less (a, and, the, etc.).
However, there may be times when you want more control over the path generated for pages you create with specific content so that it follows a logical path. For example, you might want to have the URL alias for faculty member pages begin with the word “faculty” – sitename.yale.edu/faculty/john-smith. This can be done with the Automated URL Alias feature. This is especially important to ensure blocks display on specific pages using the shorthand academics/* (all the Academic pages get the Academic Menu Block).
It is important to note that URL aliases are set for the Basic Page Content Type and Content Types for other pre-built features.
If the “parent” is Graduate Programs under Academics (see Sample Hierarchy above) the URL would be:
If you create your a Custom Content Type you will need to assign a URL alias to that Content Type if you want to defined the path of the URL:
Important Note: This is an important step when creating any Content Type to ensure the URL alias is set as content is created. Pages created prior to URL alias setup do not automatically update to the new URL alias.
Views are a powerful and flexible way to list and display content. Views can be used to create lists, generate reports, create summaries, and display collections of images or other content. The Views module provides a GUI interface allowing technical and non-technical people to build simple and complex queries with little or no coding. Data is entered once in a Content Type, displayed in various filtering formats and re-purposed throughout the site.
For YaleSites, the custom Views are listed under Structure ->Views in the Administrators toolbar.
Views is a very complex process that requires more than this one page tutorial. However, these instructions will give you an overview of the basic setup.
Views are complex but these pointers can help to reduce the complexity. It is important to note that some of the settings change depending on the type of Display you are working with.
Here are some key points that are helpful when creating Views:
![]() |
If you are changing the Display from the Master, you must choose the This page (override) from the top of the page. Otherwise, the Masterdisplay is changed. |
![]() |
Italics indicate the value has changed from the Master. |
![]() |
Add fields, filters, relationships etc. and rearrange the order of the list for that specific type. |
Settings - link next to the structure indicates additional configuration can be done.
The Webform is a great tool for many things, but it is not meant for displaying data on your website after it’s captured. There are some known limitations when trying to display data using Views with Webforms including the inability to use exposed filters and the sort feature for columns in a table. However, if you want a basic list without filtering and sorting capabilities, you can display the data in the following way:
If you are working on more than one site that have similar content structure, you can use the Bundle Copy module to export and import the code for the Content Types and Views. Once imported, you can adjust the Content Types and Views by adding fields and changing the display. Therefore, we recommend reviewing the basics for creating with Custom Content types.
If you want to duplicate a Content Type or use a custom Content Type on more than one site, you can import the code with a simple copy and paste.
You can export a view and then import it to another site. The view is the first step to creating the list or display you want; once imported, the view will need to be adjusted according to the site specifications. For more information on working with views, we recommend you review the YaleSites Views tutorial.
Your page/block, etc is available for you to link or place on the site as desired.
One of the great features of Drupal is the ability to display an image in multiple sizes, without physically resizing the image, eliminating the need for multiple sizes of the same image on your server. This feature is called Image Styles and it allows you to define an image “preset” size which can then be chosen for display for a specific content type and/or view. To create an Image Style:
The Date and Time settings for your YaleSite come with many display options but might not display in the order or format that you want. You can add a new date format that will be available in the list of the standard date formats (Configuration > Date and Time formats > .
YaleSites comes with a variety of Date formats, but they are limiting. However, you can easily create a new date format in the following way:
Click on the Formats tab and click on +Add format. The Formats dialog displays with the ability to configure and create custom formats.
Enter the PHP codes you using the PHP Manual link to indicate how you would like your date to be formatted.
The PHP manual provides explicit instructions for which codes to use to get the desired result. For this example, I wanted the date to be set to month/day/year so I used the following codes: l, F n, Y where l is the full day spelled out, F is the full month, n is the day number without the leading zero, and Y is the 4 digit year. The new format displays when the configuration is saved.
Once you have created your format, you have the option to name the format as a Date Type so that it shows up as an option on the date formats list in your Views or format options for Content Types.
Once the date has been created it will be available in the list for views and/or content types. Just click on the drop-down menu (in this case a view) and select it as an option. You can also use it for any of the standard formats including Long, Medium and Short.
Choosing a date and time format for a View
Choosing a date and time format for a Content Type:
YaleSites Secure is a Feature that offers additional security for sites that store or collect sensitive data for research projects or collecting information for study participants. YaleSites Secure has all the features that are included in a standard YaleSite with the following differences:
The following is a list of the types information that should NOT be included in your site.
The following is a list of important points that require consideration before developing your site with YaleSites Secure.
In order to ensure the policies and process required for YaleSites Secure are understood, the vendor and site owner must attend a preliminary onboarding meeting. During this meeting the YaleSites Web Team and Yale Information Security Office (ISO) will provide you with the requirements necessary to build a YaleSites Secure site. Development on the site cannot take place prior to the onboarding meeting.
Important Note: The request and approval process for YaleSites Secure may take 2-4 weeks. Please plan accordingly.
YaleSites are provisioned in the development stage (.dev) unless otherwise requested.
Access to the site is determined by role a person has in development, participation and/or viewing the content. Important Note: Anyone who has access to the information on a YaleSites Secure site must complete HIPAA Privacy and HIPAA Security training on Yale’s Training Management System (TMS).
A participant is identified as someone who has access to the site to contribute to the study or research program, but does not have permission to access the administrative pages. Participants are given access to the site using native Drupal login.
Participants who are logged in a given the default role of authenticated user. Additional Roles can be assigned to participants as dictated by site requirements.
Important Note: Email notification for new accounts must be setup to change the language to meet program/project needs.
Anonymous users will only be able to view public pages of the site as determine by the root directory.
YaleSites Secure is setup to allow participants, anonymous users or site visitors to view pages that are in the public virtual directory. In order to create the virtual public directory, you must create a URL alias for each Content Types of any pages that will be viewed by the public (public/[node:title]). All pages that are available to anonymous users or people who are just visiting the site are stored in the public virtual directory.
https://site_name.ys.yale.edu/public/page-url
Configuration and administration pages are restricted to Administrator, Site Builder and Site Editor roles. The following URLs are helpful for administrators to determine the path necessary when coding advanced template files and modules to ensure the path is correct.
/sites/default/files/* (images, pdf, other digital assets)
/sites/all/modules/* (modules used by the website)
/sites/all/themes/* (js, css used by the website)
/user/* (user profile details available only to authenticated user)
/flag/* (allowing for bookmarks using flag module)
/sites/all/libraries/* ()
/cas (allowing users to login with Yale CAS)
All digital assets (images, pdf, etc.) cannot contain user identifiable information, examples include:
User-agent: * Disallow: /