Procedure 3: Linking to an accordion
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
You could theoretically link to an accordion using Procedure 3, linking to a specific place on a T4 webpage. Using that procedure you would link to the accordion template directly, or to the heading just above it if there is one.
However, with that method the accordion wouldn't be open when the reader arrives at the link destination, and it may not be clear which accordion pane you intend them to read. This method will instead take the reader directly to an open accordion.
How to create this type of link
Preparation
Difficulty level: Advanced
- the number for the accordion
- the number for the specific accordion pane that you want to open
- Is the accordion on the same page as your link, or are you linking to an accordion on another page?
- The accordion is on another page: go to step 2.
- The accordion is on the same page as the link: go to step 3.
- Do you have T4 editing access to the page containing the accordion?
- Yes: go to step 3.
- No: go to step 6.
- Go to the accordion containing the particular panel you want to link to, and open its accordion header code template to find its ID, and make a note of it. Then go to step 4.
- Open the accordion panel that you want to link to, to find its ID.
- The full ID will be of the form '#accordionIDA-IDP', where IDA is the accordion ID and IDP is the accordion panel ID. For example, in an accordion with ID '0', an accordion panel with ID '3' would have an ID of '#accordion0-3'. Once you have this for your accordion you can exit this preparation and follow Method A or B below.
- Open the page that contains the accordion on the live site.
- Right click on the accordion pane that you want to link to, and select 'Inspect'.
- A new pane of code will appear with one line of code highlighted, which will say something like
<a class="accordion-toggle">Accordion name</a>. 3 lines above this you should see a line of code that includes a 'data-target' element. It will say something likedata-target="#accordion0-3". This data target is the full dual-number ID that you're looking for. - You can test the ID by copying and pasting the web address of the page into a new tab or window, and then adding the data target ID to the end. For example:
https://www.exeter.ac.uk/departments/#accordion0-2. When going to this address, the page should automatically load focused on the open accordion pane. - You're now ready to follow Method A or B below.
Methods
The method to use will depend on the template you're linking from. If you're not sure which method to use for your template, 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 box type #modalIDlink, replacing ID with the ID of the modal you want to link to, for example #modal1link or #modal12link.
- Where it says 'Open link in current window', you do not need to change this to say 'New window' – you can leave this setting as it is.
- Save and approve your edit.
- Preview your edit to check that the modal opens as intended.
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 |