Procedure 5: Linking to a modal (pop-up window) on another T4 webpage
Advisory
The information on this page is only applicable if you're editing the University webpages using T4. It presumes that you have already completed the beginners and advanced level of the T4 basic training (a link for staff only - opens in new window).
Introduction
If you've completed the introductory training, you'll have already encountered linking to modal windows from the same T4 page.
This page builds on that tutorial to show you how to link to a modal on another page, modal management guidance, and full lists of template support for this type of link.
How to create this type of link
Preparation
Difficulty level: Foundation.
You must have a modal set up and assigned an ID that's unique to the page it's on in order to link to it. If you have editing access to the page you can create a modal yourself, following the instructions in the introductory training.
Whichever method you use to link to the modal, you'll need to know its web address. The following procedure will show you how to find that address:
- Do you already know the modal's ID number?
- No: go to step 2.
- Yes: go to step 4.
- Do you have T4 editing access to the page containing the modal?
- Yes: open the modal in T4 to check its ID number, then go to step 4.
- No: go to step 3.
- Open the page that contains the modal on the live site. Do you know of a link on this page that opens the modal?
- Yes: right click on the link and select 'copy clean link'. It's important that you choose 'copy clean link' rather than just 'copy link' to avoid copying over extra code that can sometimes be present. You can test this by pasting the link into notepad – it should look similar to:
https://www.exeter.ac.uk/research/institutes/esi/nature/#modal7link. If there's a long string of extra letters and numbers included, then the link isn't clean. When you have a clean link you can exit this preparation and follow Method A or B below. - No: in the address field of the browser, add #modalIDlink, to the end of the URL, for example:
https://www.exeter.ac.uk/research/institutes/esi/nature/#modalIDlink. Change ID to '1' and press return. A modal should open – if it's the modal you want then you can copy the web address, including the bit at the end; if it's not the right modal, keep changing the number to 2, 3 etc.. until it opens the modal you need, then copy that web address. You can now exit this preparation and follow Method A or B below.
- Yes: right click on the link and select 'copy clean link'. It's important that you choose 'copy clean link' rather than just 'copy link' to avoid copying over extra code that can sometimes be present. You can test this by pasting the link into notepad – it should look similar to:
- Open the page that contains the modal on the live site.
- In the address field of the browser, add #modalIDlink, to the end of the URL, replacing ID with the ID of the modal. For example:
https://www.exeter.ac.uk/research/institutes/esi/nature/#modal7link. Press return – if the address is correct then the modal you want to link to should open. If it's not the correct modal you can experiment with other ID numbers until the correct one opens. - When the correct modal has opened, copy the web address including the bit at the end. You're now ready to follow Method A or B below.
Methods
The method to use will depend on the template you're using. If you're not sure which method to use, refer to template support.
Method A: Using a text editing window
Difficulty level: Foundation
- Type your link text into the editing window of the template you want to link from.
- With your mouse, select (highlight) the link text you've just created.
- Either (whichever you prefer):
- Click on the 'Insert/edit link' icon in the editing ribbon of the editing window and select 'Link to external site'.
or - Use the keyboard shortcut CTRL + K.
- Click on the 'Insert/edit link' icon in the editing ribbon of the editing window and select 'Link to external site'.
- In the URL field, paste the web address you prepared earlier.
- Where it says 'Open link in...' choose 'Current window' or 'New window':
- 'Current window'
- This will take the reader directly to the open modal on the other page, and that page will reload in the same window as the current page that's linking to it.
- This is the default setting and the most commonly chosen one.
- Go to step 6.
- 'New window'
- This will keep the current page open while opening a new page or tab (depending on the reader's browser settings), which will display the other page with the modal open.
- This option is useful if the reader is likely to want to read the modal alongside your current page.
- If you choose this option you should add '(opens in new window)' at the end of the 'Text to display' box. So for example, your link may say 'See more about our research into sea turtles (link opens in new window)'.
- Go to step 6.
- 'Current window'
- Save and approve your edit.
- Preview your edit to check that modal opens as intended.
Method B: Using a URL field
Difficulty level: Foundation.
- In the URL field, enter the web address you prepared earlier.
- Save and approve your edit.
- Preview your edit to check that the link takes the reader to the intended place.
Modal management
- It's a good idea to include the ID number of any modal you create in its T4 name so that you don't have to open it to find that information.
- Be aware that modal links are static. This means that you modal link will break if:
- The modal number is changed.
- The modal is moved to a different page.
- The page containing the modal is renamed.
- The T4 folder containing that page is renamed.
Template support
The templates listed below all support this type of link. The tables will show you which method to use for each template field.
| Template | Field | Method |
|---|---|---|
| Accordion pane | Pane content | A |
| Additional quote | Quote | A |
| Quotee name | A | |
| Call to action links | Link url 1-3 (external page) | B |
| Carousel entry | Link URL | B |
| Feature box | Text | A |
| Panel header link (external website) | B | |
| Generic highlight button | Button URL (external page) | B |
| Highlight content panel | Text | A |
| Quotee name | A | |
| Messages billboard | Msg URL 1-4 (external page) | B |
| Modal window | Text | A |
| Page structure v1 | Content | A |
| Page text | Content | A |
| Panel | Text | A |
| Full panel link (external page) | B | |
| Profile panel | Description | A |
| Website | B | |
| Profiles item set | Profile text 1-8 | A |
| Quote | Quote | A |
| Quotee name | A | |
| Tab | Tab content | A |
| Tabs container | Tab 1 content | A |
| Video embed | Description | A |
| Template | Field | Method |
|---|---|---|
| Accommodation residence filter panel | Link (external page) | B |
| Accordion panel | Content | A |
| Accordion panel for Funders/Faculties (PGR) | Content | A |
| Accordion panel for Funding list (PGR) | Content | A |
| Campaign landing page v2 | Header KSPs | A |
| Header KSPs footnotes | A | |
| Text above form | A | |
| Overview text | A | |
| KSP1-4 text | A | |
| KSP footnotes | A | |
| Carousel 1-4 text | A | |
| Optional text | A | |
| Panel 1-4 text | A | |
| Optional button link (external page) | B | |
| Carousel interface | Link URL | B |
| Carousel panel | Link URL | B |
| Carousel panels set | Panel 1-4: text | A |
| Panel 1-4: Full panel link (external page) | B | |
| Carousel panels set interface | Panel 1-4: text | A |
| Panel 1-4: Full panel link (external page) | B | |
| Gallery image | Image caption | A |
| Hero section page header | Text | A |
| Modal window | Text | A |
| Page structure v2 | Content | A |
| Page text | Text | A |
| Panel | Text | A |
| Full panel link (external page) | B | |
| Panel & Modal Combo | Panel Text | A |
| Modal Text | A | |
| Panel blog feed | Text | A |
| Panel set blog feed | Text | A |
| PG: On-demand video | Text | A |
| Profile set | Profile 1-6 text | A |
| Quote template | Quote | A |
| 'Read more' text | A | |
| Tab container | Tab 1 content | A |
| Tab entry | Tab content | A |
| Tab entry blog feed | Tab content | A |
| UG: On-demand video | Text | A |