Jump to content

The Editor: Difference between revisions

From Swarthmore Knowledge Base
Imported from Confluence
 
Kwhiteb1 (talk | contribs)
 
(12 intermediate revisions by the same user not shown)
Line 1: Line 1:
== 2) Working with the Editor ==
{{DrupalBack}}
This section introduces the Drupal content editor, where you'll create and format the main content of your webpages. Each tool in the editor toolbar is explained in the sections that follow, along with recommended best practices for creating accessible, well-formatted content.
== 2. Working with the Editor ==


The '''body''' typically contains the main content that appears on a webpage. There is menu bar located at the top which is used to format text, add headings, styles, links, tables, etc.
The '''body''' field contains the main content that appears on a webpage. The editor toolbar appears above the body field and includes tools for formatting text, adding headings, creating links, inserting tables, adding images, and editing HTML source.


[[File:image-20240710-211017.png|653px|alt=Screenshot of the body editor in Swarthmore's Drupal 10]]
{{Screenshot|image-20240710-211017.png|653px|Screenshot of the body editor in Swarthmore's Drupal 10 CMS.|The body editor contains the main page content and formatting toolbar.}}
'''The editors functions are listed below.'''


[[File:editor.png|700px|alt=A visual of the location of editor functions starting on the upper left in Swarthmore's Drupal 10 Ckeditor]]
The editor functions are shown below.
Going from left to right, the order of the editor functions is listed below. Each of the editors functions are described in the sections that follow.


# Undo | Redo
{{Screenshot|editor.png|700px|Screenshot of the Drupal editor toolbar with formatting, link, table, image, source, and fullscreen controls.|The Drupal editor toolbar includes the main tools used to format and manage body content.}}
 
From left to right, the editor toolbar includes:
 
# Undo / Redo
# Remove Formatting
# Remove Formatting
# Bold, Italics, Bullet List, Ordered List
# Bold, Italics, Bullet List, Ordered List
Line 18: Line 22:
# Links
# Links
# Special Characters
# Special Characters
# Find/Replace
# Find / Replace
# Tables
# Tables
# Add Image in Body Copy
# Add Image in Body Copy
Line 25: Line 29:
# Toggle Full Screen
# Toggle Full Screen


== 2.1) Undo | Redo ==
== 2.1 Undo | Redo ==


Allows you to undo or redo any edit you make to the body copy block.
Allows you to undo or redo any edit you make to the body copy block.


== 2.2) Remove Formatting ==
== 2.2 Remove Formatting ==
 
When you copy and paste content from another source (Google Docs, Microsoft Word, PDFs, or a website) the original formatting (fonts, colors, font sizes, spacing, and other styles) is often copied along with the text. This formatting may not match the design of the Swarthmore website.
 
The '''Remove Formatting''' tool strips away the imported formatting while preserving the text itself. To use it, highlight the text you want to clean up and click the '''Remove Formatting''' button in the editor toolbar.
 
{{Callout|type=tip|title=Best Practice|
Always use '''Remove Formatting''' after pasting content into Drupal. This helps ensure your content uses the site's standard styles and remains consistent with the rest of the website.
}}
 
== 2.3 Bold, Italics, Bullet Lists, and Numbered Lists ==
 
The editor toolbar includes tools for applying '''bold''' and ''italic'' formatting, as well as creating bulleted and numbered lists.
 
=== Choosing the Right Type of List ===
 
Drupal supports two types of lists, each intended for a different purpose.
 
'''Numbered lists''' should be used when the order of the items matters, such as instructions or procedures.
 
Example:
 
# Heat the oven to 250°F.
# Season the steak.
# Cook in the oven until nearly done.
# Sear each side over high heat.
# Let the steak rest.
# Serve.
 
'''Bulleted lists''' should be used when the order of the items is not important, such as checklists or collections of related items.
 
Example:
 
* Charging cables
* Socks
* Shirts
* Toiletries
* Prescription medications
* Extra pair of glasses


Whenever you copy and paste text into Drupal from another source (Google Docs, Microsoft Word, PDFs, etc), the pasted text will use the font styling of the original source file (font type, color, size, etc). This font styling will likely be different from the font styling used on the Swarthmore site. The '''Remove Formatting''' function removes that imported formatting and makes the text look consistent with the rest of the website. Simply highlight the text you wish adjust using your cursor and then click the '''Remove Formatting''' button.
{{Callout|type=tip|title=Best Practice|
Choose the list type based on its purpose. Use '''numbered lists''' for step-by-step instructions and '''bulleted lists''' for unordered collections of related items.
}}


{{Card|variant=info|title=Info|content='''Please note: '''All content on the website should use the same style found on the Swarthmore website. To ensure consistency, always use Remove Formatting option when you copy and paste content into the Drupal CMS.}}
== 2.4 Headings ==


== 2.3) Bold / Italics / Bullet List / Ordered List ==
Headings organize your content into logical sections, making webpages easier to read and navigate. Drupal supports heading levels from '''H2''' through '''H6''' within the page editor.


Allows you to add bold and italics content as well as bullet and ordered lists.
The page title is automatically created as the page's '''H1''' heading. When adding headings within the body content, always begin with an '''H2''', then use '''H3''', '''H4''', and so on as needed.


=== A Note About Lists ===
Heading levels should always follow a logical hierarchy. Skipping heading levels (for example, jumping from '''H2''' directly to '''H4''') can make content more difficult to understand, particularly for visitors using screen readers.


There are two kinds of lists - bulleted and numbered lists and they serve different purposes.
A typical heading hierarchy looks like this:


Numbered lists should be used when the order of completion is important. For example, if you are doing a reverse sear on a steak, you need to slow cook the steak before you but it on high heat to sear the outside. The list would look something like this:
<pre>
H1  Page Title (added automatically)


# Heat the oven to 250 F;
H2  First Main Topic
# Dry the steak surface and add any seasonings like salt and/or pepper;
  H3  First Subtopic
# Place the steak in an oven proof pan for 15-20 minutes. You’ll want the steak to be about 30 degrees lower than the desired serving temperature;
  H3  Second Subtopic
# Sear the steak. Put it on a hot grill or in a hot skillet. Cook for 1-2 minutes on each side and 30-60 seconds on the sides;
  H3  Third Subtopic
# Baste with butter and add aromatics;
# Let it rest for 5-10 minutes;
# Serve
# Congratulate yourself on cooking a most delectable steak.


A bulleted list is used when it doesn’t matter what comes first or last. A simple example might be a packing list:
H2  Second Main Topic
  H3  First Subtopic
    H4  Supporting Detail
    H4  Supporting Detail
  H3  Second Subtopic


* charging cords and plugs;
H2  Third Main Topic
* socks;
</pre>
* shirts;
* slacks;
* toiletries and medications;
* extra pair of eye glasses;


== 2.4) Headings ==
{{Callout
|type=tip
|title=Accessibility
|content=Headings are one of the primary ways people using screen readers navigate webpages. To see why heading structure is important, watch [https://youtu.be/0xAv1l04aJI?si=zDevmiYLH1okRUaz Screen Reader Demo: Using Headings (YouTube)].
}}


Allows you to add headings to your content. All webpages follow a standard convention of ranking of headings from H1 to H6. The Page Title (the most important element) is the H1. If you include heading/subheadings in the page content, you would start with H2 and then use H3-H6 for additional sub-headings.
== 2.5 Styles ==


{{Card|variant=info|title=Info|content='''Please note: '''Whenever using headings, you must follow the proper heading sort order. This is essential for accessibility, readability, and to maintain consistency. Headings are the number one way that visitors with screen readers navigate the web. If you are curious to see this in action, take a look at [https://youtu.be/0xAv1l04aJI?si=zDevmiYLH1okRUaz <u>Screen Reader Demo With Headings [YouTube]</u>].
The '''Styles''' menu provides several predefined formatting options that have been approved for use on the Swarthmore website. These styles allow you to emphasize content while maintaining a consistent appearance across the site.


'''H1: '''The title of the page
Common styles include:


''' H2:''' First point
* Lead paragraphs
* Pull quotes
* Other approved content styles


'''H3:''' Subsection of first point
{{Callout|type=tip|title=Best Practice|
Whenever possible, use the predefined styles instead of manually changing font sizes, colors, or other formatting. This helps keep the website visually consistent and accessible.
}}


'''H3:''' Subsection of first point
== 2.6 Horizontal Rule ==


'''H3:''' Subsection of first point
The '''Horizontal Rule''' tool inserts a visual divider between sections of content.


'''H2:''' Second point
Horizontal rules should be used sparingly to separate major sections of a page. In most cases, headings provide a clearer and more accessible way to organize content.


'''H3:''' Subsection of second point
{{Callout|type=tip|title=Best Practice|
Use headings, not horizontal rules, to organize page structure. Horizontal rules should only be used when a visual separation is helpful.
}}
== 2.7 Anchors ==


'''H4:''' Child of second subsection
Anchors are internal links that allow visitors to jump directly to a specific section of a webpage. They are commonly placed on headings so readers can quickly navigate long pages.


'''H4:''' Child of second subsection
Anchor names should be unique, contain no spaces, and use a simple naming convention. Examples include:


'''H3:''' Subsection of second point
* <code>CreatingAnchors</code>
* <code>admissionsRequirements</code>
* <code>required-documents</code>


''' H2:''' Third point}}
When an anchor has been created successfully, a small red flag icon appears in the editor. This icon is only visible while editing and is never shown to website visitors. Selecting the flag displays the anchor's name and allows you to edit it if necessary.


== 2.5) Styles ==
{{Screenshot|Screenshot 2024-10-10 at 11.59.15 AM.png|32px|Red flag icon indicating an anchor has been created.|A red flag icon identifies an anchor within the editor.}}
=== 2.7.1 Creating an Anchor ===


The styles drop down menu allows you apply custom font styles to your content. This is useful if you wish to include lead paragraphs (slightly larger font size for the intro paragraph) or pull quotes (a quote pulled from the content) to your body content.
After creating an anchor, click the red flag icon to open the '''Anchor''' dialog.


== 2.6) Horizontal Rule ==
{{Screenshot|anchor-dialog.png|350px|Screenshot of the Anchor dialog in the Drupal editor.|The Anchor dialog allows you to create or edit an anchor.}}
=== 2.7.2 Linking to an Anchor on the Same Page ===


Allows you to add a horizontal rule to your content.
To create a link to an anchor on the page you're currently editing:


== 2.7) Anchors ==
# Highlight the text that should become the link.
# Select '''Edit Link'''.
# In the '''Link URL''' field, enter the anchor name preceded by a <code>#</code> character.


Anchor are internal links within the body content of a page that allow you jump to a section of the page. Anchors are typically placed at the beginning of the section heading or paragraph that you want visitors to jump to.
For example, if the anchor name is <code>Definitions</code>, enter:


The only requirement is to add a name for the anchor - the name should be one word and contain no spaces. Examples of good anchor names are:
<pre>#Definitions</pre>


* CreatingAnchors
{{Screenshot|Screenshot 2024-10-10 at 11.33.39 AM.png|350px|Screenshot showing the Edit Link option for an existing link.|Open the Edit Link dialog to configure the destination.}}
* admissionsRequirements
* required-documents


You will know you've successfully created an anchor when you see a red flag[[File:Screenshot 2024-10-10 at 11.59.15 AM.png|alt=Small icon of a red flag waving in the wind]]appear in the Copy Editor. This red flag will not be visible to the public and is intended to help remind you of its presence while editing. Clicking on the red flag will display the anchor tag id. If you need to edit the anchor name, you can click on that flag and the '''Anchor''' dialog will reopen.
{{Screenshot|Screenshot 2024-10-10 at 11.33.47 AM.png|350px|Screenshot showing the Link URL field containing an anchor reference.|Enter the anchor name in the Link URL field, preceded by a # symbol.}}


{{Card|variant=info|title=Info|content==== '''Using an Anchor Tag''' ===
=== 2.7.3 Linking to an Anchor on Another Page ===


After you’ve created an anchor link somewhere in the body of your page, click the red flag [[File:Screenshot 2024-10-10 at 11.59.15 AM.png{{!}}alt=Small icon of a red flag waving in the wind]] to open the '''Anchor''' dialog.
You can also link directly to an anchor on another page by appending the anchor name to the end of the page's URL.


[[File:anchor-dialog.png{{!}}350px{{!}}alt=Screenshot of the Swarthmore ckeditor window with a popup indicating where to insert an anchor link]]
Examples:


==== '''Using the anchor tag on the same page''' ====
<pre>
/my-example-page#Definitions
</pre>


To use the anchor on the page that you’re currently editing, click on the link and then the '''Edit Link '''button on the dialog. Paste in <code>#your-anchor</code>, or <code>#Definitions</code> in the example below.
or


[[File:Screenshot 2024-10-10 at 11.33.39 AM.png{{!}}350px{{!}}alt=Screen shot close up of the Edit Link button on the link edit UI for Swarthmore Drupal 10]]
<pre>
In the '''Link URL '''field, add the anchor following a pound (#) symbol. For example, our id of <code>Definitions</code> would be entered as <code>#Definitions</code>.
/node/100057#Definitions
</pre>


[[File:Screenshot 2024-10-10 at 11.33.47 AM.png{{!}}350px{{!}}alt=Screen shot close up of the enter Link URL field for a link found in the editor of the Swarthmore Drupal 10 instance]]
{{Callout|type=tip|title=Best Practice|content=Choose descriptive anchor names that clearly identify the section they reference. Consistent naming makes anchors easier to maintain and reuse throughout your page(s).}}
'''Using the anchor tag on a different page'''


To use the anchor on a '''different''' page than the one you’re currently editing, append the id -- <code>#Definitions</code> in our case – to the end of that page’s url, creating something like <code>swarthmore.edu/my-example-site/my-example-page#Definitions</code> or <code>/node/100057#Definitions</code>, if using the Drupal path as the URL. This link can then be pasted in the '''Link URL '''field of any link on your page.}}
== 2.8 Links ==


== 2.8) Links ==
Adding links to other webpages or other content is one of the most common tasks you'll perform when creating webpages. The most important thing to remember about a link is the text of that link. Make sure it is meaningful and lets visitors know what will happen when they select it. Visit [https://blogs.swarthmore.edu/its/2024/03/13/unlock-the-power-of-meaningful-links/ Unlock the Power of Meaningful Links] to learn more.


Adding links to other webpages or other content is one of the most common tasks you’ll be doing when creating webpages. The most important think to remember about a link is the text of that link. Make sure it is meaningful and lets a visitor know a little about what will happen when they visit that link. Visit [https://blogs.swarthmore.edu/its/2024/03/13/unlock-the-power-of-meaningful-links/ Unlock the Power of Meaningful Links] to learn more. Here are some examples of informative and uninformative link text:
Here are some examples of effective and ineffective link text:


{| class="wikitable"
{| class="wikitable"
Line 138: Line 196:
! Effective
! Effective
|-
|-
| WCAG-compliant links should explain their purpose for the link text alone. [https://www.w3.org/WAI/WCAG22/quickref/?versions=2.1#link-purpose-in-context Click here] to learn more.
| WCAG-compliant links should explain their purpose from the link text alone. [https://www.w3.org/WAI/WCAG22/quickref/?versions=2.1#link-purpose-in-context Click here] to learn more.
| [https://www.w3.org/WAI/WCAG22/quickref/?versions=2.1#link-purpose-in-context WCAG-compliant links should explain their purpose] from the link text alone.
| [https://www.w3.org/WAI/WCAG22/quickref/?versions=2.1#link-purpose-in-context WCAG-compliant links should explain their purpose] from the link text alone.
|-
|-
| Check your contrast levels using [https://webaim.org/resources/contrastchecker/ https://webaim.org/resources/]<br>[https://webaim.org/resources/contrastchecker/ contrastchecker/]
| Check your contrast levels using [https://webaim.org/resources/contrastchecker/ https://webaim.org/resources/]<br>[https://webaim.org/resources/contrastchecker/ contrastchecker/]
| Check your contrast levels using [https://webaim.org/resources/contrastchecker/ WebAim’s  Contrast Checker]
| Check your contrast levels using [https://webaim.org/resources/contrastchecker/ WebAIM's Contrast Checker]
|-
|-
| [https://www.swarthmore.edu/accessibility Swarthmore’s Accessibility website] includes five tips for preparing accessible materials
| [https://www.swarthmore.edu/accessibility Swarthmore's Accessibility website] includes five tips for preparing accessible materials.
| Swarthmore’s Accessibility website includes [["Fast Five" Essentials to Preparing Materials|five tips for preparing accessible materials]]
| Swarthmore's Accessibility website includes [["Fast Five" Essentials to Preparing Materials|five tips for preparing accessible materials]].
|-
|-
| [https://webaim.org/techniques/hypertext/ Here] is an introduction from WebAIM to links and hypertext
| [https://webaim.org/techniques/hypertext/ Here] is an introduction from WebAIM to links and hypertext.
| [https://webaim.org/techniques/hypertext/ WebAIM’s introduction to links and hypertext]
| [https://webaim.org/techniques/hypertext/ WebAIM's introduction to links and hypertext]
|-
|-
| [https://www.swarthmore.edu/sites/default/files/assets/documents/human-resources/10_Minute_Conversation_Guide%5B1%5D.pdf 10 minute conversation]
| [https://www.swarthmore.edu/sites/default/files/assets/documents/human-resources/10_Minute_Conversation_Guide%5B1%5D.pdf 10 minute conversation]
Line 154: Line 212:
|}
|}


=== 2.8.1) Linking to another webpage in Drupal ===
=== 2.8.1 Linking to Another Webpage in Drupal ===


# Highlight the text you wish to become a link
# Highlight the text you wish to become a link.
# Click the the chain icon in the menu bar. This will open the link editor window
# Click the '''Link''' (chain) icon in the editor toolbar. This will open the Link Editor.


[[File:link1.png|598px|alt=Screenshot diagram of how to create a link in Drupal's CKeditor page editor tool]]
{{Screenshot|link1.png|598px|Screenshot showing the Link button in the Drupal editor toolbar.|Select the Link button to create a new link.}}


=== 2.8.2 How the Link Editor Works ===
=== 2.8.2 How the Link Editor Works ===


# '''Link URL''' - is where you would add the link or URL.
# '''Link URL''' — Enter the URL or destination for the link.
# '''Link to a Document''' - if linking to a document (hosted in Drupal) then you click this button.
# '''Link to a Document''' — Opens the document browser so you can select or upload a document stored in Drupal.
# '''Advanced''' - opens/collapses the advanced tab which includes: CSS Classes, ID, and Open in a new window.
# '''Advanced''' — Expands additional options, including CSS Classes, ID, and '''Open in a new window'''.
# '''Open in a new window''' - allows you to toggle whether the link should open in a new tab or not. The default setting is have the link open the same window/tab.
# '''Open in a new window''' — Controls whether the link opens in a new browser tab. By default, links open in the current tab.
# '''Save / Cancel - '''click the check mark to save your edits or the x to cancel
# '''Save / Cancel''' — Click the checkmark to save your changes or the '''X''' to cancel.
 
{{Callout|type=tip|It is recommended that links to external websites (outside of swarthmore.edu) and documents open in a new browser tab.}}


{{Card|variant=info|title=Info|content=Note: It is recommended that when linking to an external website (ie not at [http://swarthmore.edu swarthmore.edu]) or to a document, that you have the link open in a new tab.}}
{{Screenshot|link_editor1.png|287px|Screenshot of the Drupal Link Editor showing the Link URL field and advanced options.|The Link Editor is used to create and edit links.}}
[[File:link_editor1.png|287px|alt=Screenshot diagram of the components making up the insert url popup in Swarthmore's Drupal 10 body editor]]


=== 2.8.3 Creating a link to another page in Drupal ===
=== 2.8.3 Creating a Link to Another Page in Drupal ===


# Start typing the name of the webpage you wish to link to. For example, if you wanted to link to the “Admissions & Aid” homepage, you would type “Admissions” and every page in Drupal that has the word “Admissions” in it’s title would appear in the list below.
# Start typing the name of the webpage you wish to link to. For example, if you wanted to link to the '''Admissions & Aid''' homepage, you would type '''Admissions'''. Drupal will display pages whose titles match your search.
# Select the webpage you wish to link to.
# Select the webpage you wish to link to.


[[File:link_to_drupal_page.png|539px|alt=Screenshot demonstrating the link to page dropdown on Swarthmore's Drupal 10 instance]]
{{Screenshot|link_to_drupal_page.png|539px|Screenshot showing Drupal's page search while creating an internal link.|Search for and select another Drupal page.}}
# After selecting the page you wish to click to, the link editor will switch back the minimized view. In place of the page name, you will see a reference like this /node/######. This is normal. This is how Drupal keeps track of internal links.
 
# Click the checkmark to save your changes or the X to cancel.
# After selecting the page, the Link Editor will return to its minimized view. In place of the page title, you'll see a reference similar to <code>/node/######</code>. This is normal and is how Drupal keeps track of internal links.
# Click the checkmark to save your changes or the '''X''' to cancel.
 
{{Screenshot|node_speak1.png|549px|Screenshot showing the node reference after selecting an internal page.|Drupal stores internal links using node references.}}
 
=== 2.8.4 Creating a Link Using a URL ===
 
# You can also copy and paste any URL directly into the '''Link URL''' field. This includes external websites, internal URLs, Google Drive links, and other valid web addresses.
 
{{Screenshot|link_url1.png|549px|Screenshot showing the Link URL field in the Drupal Link Editor.|Paste a URL directly into the Link URL field.}}


[[File:node_speak1.png|549px|alt=Screenshot diagram of how to save a newly inserted link in Drupal 10]]
{{Callout|type=tip|It is recommended that links to external websites (outside of swarthmore.edu) and documents open in a new browser tab.


=== 2.8.4 Creating a link using an URL ===
{{Screenshot|link_open_new_win.png|416px|Screenshot showing the Open in New Window option in the Link Editor.|Enable '''Open in New Window''' under the Advanced options.}}
}}


# Link URL - You can also simply copy and paste any URL into the field. This includes both external links, internal links, Google drive links, etc.
=== 2.8.5 Linking to a Document ===


[[File:link_url1.png|549px|alt=Screenshot indicating link url in the Drupal 10 instance at Swarthmore]]
# Highlight the text you wish to become a link. Always include the file type in the link text so visitors know they are opening a document (for example, <code>[PDF]</code>).
{{Card|variant=info|title=Info|content=Note: It is recommended that when linking to an external website (ie not containing [http://swarthmore.edu swarthmore.edu] in the URL ) or to a document, that you have the link open in a new window/tab located under the advanced options.


[[File:link_open_new_win.png{{!}}416px{{!}}alt=Screenshot indivating the open in new window toggle in Drupal 10 Ckeditor]]}}
{{Screenshot|link_doc1.png|604px|Screenshot showing how to begin creating a document link.|Select the text that will become the document link.}}


=== 2.8.5 Linking to a document ===
# Click the '''Link to a Document''' button to upload a new document or select one that has already been uploaded to Drupal.
# It is recommended that PDFs (and other documents) open in a new browser tab. This setting is available under the '''Advanced''' options.
# Enable '''Open in a new window''' if appropriate.


# You add a link to a document. Select the text you wish to become a link. Always include the file type to let people know that the link points to a file and not a website. For example, add [pdf] for a pdf file.<br>
{{Screenshot|link_doc2.png|598px|Screenshot showing the Link to Document button in the Link Editor.|Select '''Link to a Document''' to choose or upload a document.}}
[[File:link_doc1.png|604px|alt=Screenshot indicating how to link to a document in Drupal 10]]
# Click the Link to Document Button to add a new document (or select) a existing document that has been previously uploaded to Drupal
# It is recommended always have PDFS (or other documents) open in a new tab. You can control whether a link opens in a new tab, by clicking the Advanced tab
# Under the Advanced tab, slide the toggle to green to have the link open in a new window.<br>
[[File:link_doc2.png|598px|alt=Screenshot indicating the button to insert a document in a Drupal 10 link]]


==== ''How the “Link to Document” works'' ====
==== How the "Link to Document" Dialog Works ====


Clicking the''' Link to Document''' Button will open a new window that allows you upload a new document to Drupal or select an existing document.
Clicking the '''Link to a Document''' button opens a window where you can upload a new document or select one that has already been uploaded to Drupal.


# '''Select Document''' - will display all the documents that has been previously uploaded into Drupal
# '''Select Document''' — Displays documents that have already been uploaded.
# '''Upload Document''' - will allow you upload a new document
# '''Upload Document''' — Uploads a new document.
# '''Filename''' - lets you search the documents folder
# '''Filename''' — Searches the document library by filename.
# '''Name - '''allows you sort the folder by filename
# '''Name''' — Sorts documents alphabetically.
# '''Created''' - allows you sort the folder by when it was uploaded.
# '''Created''' — Sorts documents by upload date.
# '''Radio Button'''- choose the the file you wish make become a link.
# '''Radio Button''' — Selects the document you wish to link to.
# '''Select Document '''- save your choice. You will then be returned to the previous window.
# '''Select Document''' — Saves your selection and returns you to the Link Editor.


[[File:link_select_docuement.png|780px|alt=Screenshot diagramming the link to a document modal window]]
{{Screenshot|link_select_docuement.png|780px|Screenshot of the Link to Document dialog showing document selection and upload options.|The Link to Document dialog allows you to upload or select a document.}}


==== ''Once the document is selected:'' ====
==== Once the Document Is Selected ====


# The name of the file you selected will appear in the Link URL field
# The name of the selected document will appear in the '''Link URL''' field.
# Click the green check mark to add the link in Drupal.
# Click the green checkmark to create the link.


[[File:link_doc_save1.png|560px|alt=Screenshot indicating how to save a link to a document in drupal 10]]
{{Screenshot|link_doc_save1.png|560px|Screenshot showing the selected document before saving the link.|Save the document link by clicking the checkmark.}}


=== 2.8.6 Edit or remove a link ===
=== 2.8.6 Edit or Remove a Link ===


# To edit or remove a link, click the link. The link editor window will appear.
# Click an existing link to open the Link Editor.
# You can select the pencil icon to edit an existing link
# Select the pencil icon to edit the link.
# Or the paperclip X icon to remove the link.
# Select the broken chain icon to remove the link while leaving the text in place.


[[File:edit_delete_link.png|588px|alt=Screenshot diagramming how to edit a previously created link in Drupal 10]]
{{Screenshot|edit_delete_link.png|588px|Screenshot showing the Edit Link and Remove Link options.|Edit or remove an existing link.}}


== 2.9) Special Characters ==
== 2.9 Special Characters ==


This function allows you to add special characters (a,e,i,o,u with accents and other marks). This is most common for foreign words and names that might appear on the site
The '''Special Characters''' tool allows you to insert characters that are not available on a standard keyboard, such as accented letters, mathematical symbols, currency symbols, and punctuation marks. This is most commonly used when entering foreign words, names, or other specialized characters.


[[File:Screenshot 2024-08-01 at 4.38.30 PM.png|313px|alt=Screenshot of the special characters popup window]]
{{Screenshot|Screenshot 2024-08-01 at 4.38.30 PM.png|313px|Screenshot of the Special Characters dialog in the Drupal editor.|The Special Characters dialog lets you insert symbols and accented characters into your content.}}


== 2.10) Find & Replace ==
== 2.10 Find & Replace ==


Allows you to do a standard find and replace in the body content block.
Allows you to do a standard find and replace in the body content block.


== 2.11) Tables ==
== 2.11 Tables ==
 
Use the '''Table''' tool to add tabular data to a webpage. Tables should be used to present data that naturally belongs in rows and columns, such as schedules, pricing information, or comparison charts. Avoid using tables to control the layout or appearance of a webpage.
 
# Select the desired number of rows and columns using the table matrix. Remember to include a row or column for table headings. See [https://webaim.org/techniques/tables/data WebAIM's article on accessible tables] to learn more.
 
{{Screenshot|table3.png|147px|Screenshot showing the table size selection matrix in the Drupal editor.|Select the number of rows and columns for your table.}}


Use this function to add table content to your webpage. Ideally, tables are created to share data e.g. dates and times of a train schedule. Avoid using tables to control look and feel.
# Add your row and/or column headings.
# Enter your table data.


# You first select the number of rows and columns using the matrix. Remember to include a column or row for table headings (see [https://webaim.org/techniques/tables/data WebAims article on tables] to learn more.)
{{Screenshot|table2.png|495px|Screenshot showing a table being edited in the Drupal editor.|Enter your headings and data into the table.}}


[[File:table3.png|147px|alt=Screenshot of the rows and columns matrix creating tool in Drupal 10 editor]]
{{Callout|type=important|title=Accessible Tables|
# Add your column or row headings.
Every table should include a '''caption''' and appropriate '''row or column headings'''. These elements help all visitors understand the purpose of the table and are especially important for people using assistive technologies.
# Then you add your data.<br>
[[File:table2.png|495px|alt=Screenshot showing how to add data to a table in the Drupal 10 editor]]


{{Card|variant=info|title=Info|content=When creating a table you must include a '''Caption and column or row headings'''. These fields are critically important - they not only make tables more understandable and readable, they also help persons with disabilities understand what the table is about. Ideally, tables are created to share date. Avoid using tables to control layout. To learn more about creating accessible tables, take a look at [https://webaim.org/techniques/tables/data WebAim’s article on tables].}}
Tables should be used to present data—not to control page layout. To learn more, see [https://webaim.org/techniques/tables/data WebAIM's article on accessible tables].
}}


== 2.12) Add Image ==
== 2.12 Add Image ==


Visit 6.2) [[Images#6.2)-Adding-an-Image-in-the-Body-Copy|Adding an Image in the Body Copy]] to learn more about adding an image to the body copy
Visit 6.2) [[Images#6.2)-Adding-an-Image-in-the-Body-Copy|Adding an Image in the Body Copy]] to learn more about adding an image to the body copy


== 2.13) Upload Image ==
== 2.13 Upload Image ==


Allows you upload images directly to Drupal.
Allows you upload images directly to Drupal.


== 2.14) HTML Source ==
== 2.14 HTML Source ==


Clicking the '''HTML Source''' button will display the underlying HTML responsible for rendering the text formatting, links, images, and other elements that appear on the page. Editors who are comfortable working with HTML may find this functionality useful for troubleshooting, however it is not necessary for the general editing of content.
Clicking the '''HTML Source''' button will display the underlying HTML responsible for rendering the text formatting, links, images, and other elements that appear on the page. Editors who are comfortable working with HTML may find this functionality useful for troubleshooting, however it is not necessary for the general editing of content.


== 2.15) Full Screen ==
== 2.15 Full Screen ==


The '''Full Screen''' button will maximize the Copy Editor to take up the full browser window. This can be useful when working with a large amount of content or as a means of cutting down on distraction during the writing process.
The '''Full Screen''' button will maximize the Copy Editor to take up the full browser window. This can be useful when working with a large amount of content or as a means of cutting down on distraction during the writing process.

Latest revision as of 18:47, 9 July 2026

This section introduces the Drupal content editor, where you'll create and format the main content of your webpages. Each tool in the editor toolbar is explained in the sections that follow, along with recommended best practices for creating accessible, well-formatted content.

2. Working with the Editor

The body field contains the main content that appears on a webpage. The editor toolbar appears above the body field and includes tools for formatting text, adding headings, creating links, inserting tables, adding images, and editing HTML source.

Screenshot of the body editor in Swarthmore's Drupal 10 CMS.
Figure: The body editor contains the main page content and formatting toolbar.

The editor functions are shown below.

Screenshot of the Drupal editor toolbar with formatting, link, table, image, source, and fullscreen controls.
Figure: The Drupal editor toolbar includes the main tools used to format and manage body content.

From left to right, the editor toolbar includes:

  1. Undo / Redo
  2. Remove Formatting
  3. Bold, Italics, Bullet List, Ordered List
  4. Headings
  5. Styles
  6. Horizontal Rule
  7. Anchors
  8. Links
  9. Special Characters
  10. Find / Replace
  11. Tables
  12. Add Image in Body Copy
  13. Upload Image
  14. View HTML Source
  15. Toggle Full Screen

2.1 Undo | Redo

Allows you to undo or redo any edit you make to the body copy block.

2.2 Remove Formatting

When you copy and paste content from another source (Google Docs, Microsoft Word, PDFs, or a website) the original formatting (fonts, colors, font sizes, spacing, and other styles) is often copied along with the text. This formatting may not match the design of the Swarthmore website.

The Remove Formatting tool strips away the imported formatting while preserving the text itself. To use it, highlight the text you want to clean up and click the Remove Formatting button in the editor toolbar.

Best Practice

Always use Remove Formatting after pasting content into Drupal. This helps ensure your content uses the site's standard styles and remains consistent with the rest of the website.


2.3 Bold, Italics, Bullet Lists, and Numbered Lists

The editor toolbar includes tools for applying bold and italic formatting, as well as creating bulleted and numbered lists.

Choosing the Right Type of List

Drupal supports two types of lists, each intended for a different purpose.

Numbered lists should be used when the order of the items matters, such as instructions or procedures.

Example:

  1. Heat the oven to 250°F.
  2. Season the steak.
  3. Cook in the oven until nearly done.
  4. Sear each side over high heat.
  5. Let the steak rest.
  6. Serve.

Bulleted lists should be used when the order of the items is not important, such as checklists or collections of related items.

Example:

  • Charging cables
  • Socks
  • Shirts
  • Toiletries
  • Prescription medications
  • Extra pair of glasses
Best Practice

Choose the list type based on its purpose. Use numbered lists for step-by-step instructions and bulleted lists for unordered collections of related items.


2.4 Headings

Headings organize your content into logical sections, making webpages easier to read and navigate. Drupal supports heading levels from H2 through H6 within the page editor.

The page title is automatically created as the page's H1 heading. When adding headings within the body content, always begin with an H2, then use H3, H4, and so on as needed.

Heading levels should always follow a logical hierarchy. Skipping heading levels (for example, jumping from H2 directly to H4) can make content more difficult to understand, particularly for visitors using screen readers.

A typical heading hierarchy looks like this:

H1  Page Title (added automatically)

H2  First Main Topic
  H3  First Subtopic
  H3  Second Subtopic
  H3  Third Subtopic

H2  Second Main Topic
  H3  First Subtopic
    H4  Supporting Detail
    H4  Supporting Detail
  H3  Second Subtopic

H2  Third Main Topic
Accessibility
Headings are one of the primary ways people using screen readers navigate webpages. To see why heading structure is important, watch Screen Reader Demo: Using Headings (YouTube).


2.5 Styles

The Styles menu provides several predefined formatting options that have been approved for use on the Swarthmore website. These styles allow you to emphasize content while maintaining a consistent appearance across the site.

Common styles include:

  • Lead paragraphs
  • Pull quotes
  • Other approved content styles
Best Practice

Whenever possible, use the predefined styles instead of manually changing font sizes, colors, or other formatting. This helps keep the website visually consistent and accessible.


2.6 Horizontal Rule

The Horizontal Rule tool inserts a visual divider between sections of content.

Horizontal rules should be used sparingly to separate major sections of a page. In most cases, headings provide a clearer and more accessible way to organize content.

Best Practice

Use headings, not horizontal rules, to organize page structure. Horizontal rules should only be used when a visual separation is helpful.

2.7 Anchors

Anchors are internal links that allow visitors to jump directly to a specific section of a webpage. They are commonly placed on headings so readers can quickly navigate long pages.

Anchor names should be unique, contain no spaces, and use a simple naming convention. Examples include:

  • CreatingAnchors
  • admissionsRequirements
  • required-documents

When an anchor has been created successfully, a small red flag icon appears in the editor. This icon is only visible while editing and is never shown to website visitors. Selecting the flag displays the anchor's name and allows you to edit it if necessary.

Red flag icon indicating an anchor has been created.
Figure: A red flag icon identifies an anchor within the editor.

2.7.1 Creating an Anchor

After creating an anchor, click the red flag icon to open the Anchor dialog.

Screenshot of the Anchor dialog in the Drupal editor.
Figure: The Anchor dialog allows you to create or edit an anchor.

2.7.2 Linking to an Anchor on the Same Page

To create a link to an anchor on the page you're currently editing:

  1. Highlight the text that should become the link.
  2. Select Edit Link.
  3. In the Link URL field, enter the anchor name preceded by a # character.

For example, if the anchor name is Definitions, enter:

#Definitions
Screenshot showing the Edit Link option for an existing link.
Figure: Open the Edit Link dialog to configure the destination.
Screenshot showing the Link URL field containing an anchor reference.
Figure: Enter the anchor name in the Link URL field, preceded by a # symbol.

2.7.3 Linking to an Anchor on Another Page

You can also link directly to an anchor on another page by appending the anchor name to the end of the page's URL.

Examples:

/my-example-page#Definitions

or

/node/100057#Definitions
Best Practice
Choose descriptive anchor names that clearly identify the section they reference. Consistent naming makes anchors easier to maintain and reuse throughout your page(s).


2.8 Links

Adding links to other webpages or other content is one of the most common tasks you'll perform when creating webpages. The most important thing to remember about a link is the text of that link. Make sure it is meaningful and lets visitors know what will happen when they select it. Visit Unlock the Power of Meaningful Links to learn more.

Here are some examples of effective and ineffective link text:

Ineffective Effective
WCAG-compliant links should explain their purpose from the link text alone. Click here to learn more. WCAG-compliant links should explain their purpose from the link text alone.
Check your contrast levels using https://webaim.org/resources/
contrastchecker/
Check your contrast levels using WebAIM's Contrast Checker
Swarthmore's Accessibility website includes five tips for preparing accessible materials. Swarthmore's Accessibility website includes five tips for preparing accessible materials.
Here is an introduction from WebAIM to links and hypertext. WebAIM's introduction to links and hypertext
10 minute conversation How to have a 10 minute conversation [PDF]

2.8.1 Linking to Another Webpage in Drupal

  1. Highlight the text you wish to become a link.
  2. Click the Link (chain) icon in the editor toolbar. This will open the Link Editor.
Screenshot showing the Link button in the Drupal editor toolbar.
Figure: Select the Link button to create a new link.

2.8.2 How the Link Editor Works

  1. Link URL — Enter the URL or destination for the link.
  2. Link to a Document — Opens the document browser so you can select or upload a document stored in Drupal.
  3. Advanced — Expands additional options, including CSS Classes, ID, and Open in a new window.
  4. Open in a new window — Controls whether the link opens in a new browser tab. By default, links open in the current tab.
  5. Save / Cancel — Click the checkmark to save your changes or the X to cancel.
Tip
It is recommended that links to external websites (outside of swarthmore.edu) and documents open in a new browser tab.


Screenshot of the Drupal Link Editor showing the Link URL field and advanced options.
Figure: The Link Editor is used to create and edit links.

2.8.3 Creating a Link to Another Page in Drupal

  1. Start typing the name of the webpage you wish to link to. For example, if you wanted to link to the Admissions & Aid homepage, you would type Admissions. Drupal will display pages whose titles match your search.
  2. Select the webpage you wish to link to.
Screenshot showing Drupal's page search while creating an internal link.
Figure: Search for and select another Drupal page.
  1. After selecting the page, the Link Editor will return to its minimized view. In place of the page title, you'll see a reference similar to /node/######. This is normal and is how Drupal keeps track of internal links.
  2. Click the checkmark to save your changes or the X to cancel.
Screenshot showing the node reference after selecting an internal page.
Figure: Drupal stores internal links using node references.

2.8.4 Creating a Link Using a URL

  1. You can also copy and paste any URL directly into the Link URL field. This includes external websites, internal URLs, Google Drive links, and other valid web addresses.
Screenshot showing the Link URL field in the Drupal Link Editor.
Figure: Paste a URL directly into the Link URL field.
Tip
It is recommended that links to external websites (outside of swarthmore.edu) and documents open in a new browser tab.
Screenshot showing the Open in New Window option in the Link Editor.
Figure: Enable Open in New Window under the Advanced options.


2.8.5 Linking to a Document

  1. Highlight the text you wish to become a link. Always include the file type in the link text so visitors know they are opening a document (for example, [PDF]).
Screenshot showing how to begin creating a document link.
Figure: Select the text that will become the document link.
  1. Click the Link to a Document button to upload a new document or select one that has already been uploaded to Drupal.
  2. It is recommended that PDFs (and other documents) open in a new browser tab. This setting is available under the Advanced options.
  3. Enable Open in a new window if appropriate.
Screenshot showing the Link to Document button in the Link Editor.
Figure: Select Link to a Document to choose or upload a document.

How the "Link to Document" Dialog Works

Clicking the Link to a Document button opens a window where you can upload a new document or select one that has already been uploaded to Drupal.

  1. Select Document — Displays documents that have already been uploaded.
  2. Upload Document — Uploads a new document.
  3. Filename — Searches the document library by filename.
  4. Name — Sorts documents alphabetically.
  5. Created — Sorts documents by upload date.
  6. Radio Button — Selects the document you wish to link to.
  7. Select Document — Saves your selection and returns you to the Link Editor.
Screenshot of the Link to Document dialog showing document selection and upload options.
Figure: The Link to Document dialog allows you to upload or select a document.

Once the Document Is Selected

  1. The name of the selected document will appear in the Link URL field.
  2. Click the green checkmark to create the link.
Screenshot showing the selected document before saving the link.
Figure: Save the document link by clicking the checkmark.

2.8.6 Edit or Remove a Link

  1. Click an existing link to open the Link Editor.
  2. Select the pencil icon to edit the link.
  3. Select the broken chain icon to remove the link while leaving the text in place.
Screenshot showing the Edit Link and Remove Link options.
Figure: Edit or remove an existing link.

2.9 Special Characters

The Special Characters tool allows you to insert characters that are not available on a standard keyboard, such as accented letters, mathematical symbols, currency symbols, and punctuation marks. This is most commonly used when entering foreign words, names, or other specialized characters.

Screenshot of the Special Characters dialog in the Drupal editor.
Figure: The Special Characters dialog lets you insert symbols and accented characters into your content.

2.10 Find & Replace

Allows you to do a standard find and replace in the body content block.

2.11 Tables

Use the Table tool to add tabular data to a webpage. Tables should be used to present data that naturally belongs in rows and columns, such as schedules, pricing information, or comparison charts. Avoid using tables to control the layout or appearance of a webpage.

  1. Select the desired number of rows and columns using the table matrix. Remember to include a row or column for table headings. See WebAIM's article on accessible tables to learn more.
Screenshot showing the table size selection matrix in the Drupal editor.
Figure: Select the number of rows and columns for your table.
  1. Add your row and/or column headings.
  2. Enter your table data.
Screenshot showing a table being edited in the Drupal editor.
Figure: Enter your headings and data into the table.
Accessible Tables

Every table should include a caption and appropriate row or column headings. These elements help all visitors understand the purpose of the table and are especially important for people using assistive technologies.

Tables should be used to present data—not to control page layout. To learn more, see WebAIM's article on accessible tables.


2.12 Add Image

Visit 6.2) Adding an Image in the Body Copy to learn more about adding an image to the body copy

2.13 Upload Image

Allows you upload images directly to Drupal.

2.14 HTML Source

Clicking the HTML Source button will display the underlying HTML responsible for rendering the text formatting, links, images, and other elements that appear on the page. Editors who are comfortable working with HTML may find this functionality useful for troubleshooting, however it is not necessary for the general editing of content.

2.15 Full Screen

The Full Screen button will maximize the Copy Editor to take up the full browser window. This can be useful when working with a large amount of content or as a means of cutting down on distraction during the writing process.

Click the button a second time in order to minimize the Copy Editor, returning it to its original size.