Caveat: You need to have Template Editor permissions. It may be sensible when naming new hooks, new templates or new template sets to add "TRAINING" as part of the name, to differentiate your work from 'live' production work. Do consider any 'Delete' actions carefully - is it your work you are deleting?
Reference Hooks
You need two hooks for converting the codes for the players into their names and the codes for the teams into their names.
All Teams
Using Ignition Post Win Client as a Template Editor.
Select the main tab DATA
Select the sub-tab SCHEMAS & HOOKS
Below SCHEMAS:
Data Provider: XMLTeam
Target: Production
Schema: soccer event-report
Sample Data: Southampton v Leicester City
Using the 'sports-content.sports-event.team' node, create a hook at the parent level
Rename 'All Teams'
With 'All Teams' selected
Expand the nodes 'team-metadata' and 'name'
Highlight 'team.team-metadata.name.full'
Click 'Create a new hook into this element next to or below All Teams'
Rename: Full Team
Create a second hook to 'team.team-metadata.name.full'
Rename: Full Team Abbr
In Hook Properties apply the Lookup 'PL_18_19_Fixture_Abbreviated' and select 'Abbr'
Highlight 'team.team-metadata.team-key'
Click 'Create a new hook into this element next to or below All Teams'
Add the following 'Transform Steps':
'Skip 'N' Chars', where 'N' = 4
Create a second hook to 'team.team-metadata.team-key'
Rename: Team Key Abbr
In Hook Properties apply the Lookup 'PL_18_19_Fixture_Abbreviated' and select 'Abbr'
Add the following 'Transform Steps':
'Skip 'N' Chars', where 'N' = 4
Whilst selecting the 'Lookup' and populating the adjacent field (known as the 'Key' column), you may have noticed there was also the option below 'Lookup' called 'Fallbacks' with two buttons:
Add Fallback to Lookup
Add Fallback to Hook
What does it mean? Well, if the Lookup information does not contain information in the 'Key' column to match, then it cannot provide the corresponding information from the chosen 'Key' - in this instance 'Abbr'. These two buttons provide ways to deal with this.
Examining this instance
Question - What happens if the name of the team being provided by XMLTeam or by your chosen sample data does not appear in the Lookup - with a corresponding 'Key' i.e. 'Abbr' (e.g. Trumpton FC)? Answer - The data in its original form being provided by XMLTeam or by your chosen sample data is simply provided. You could set an alternate Lookup as the 'Fallback' or you could set the 'Fallback' to use data from an alternate hook.
All Teams - Continued
Ensure the 'All Teams' hook is selected, click 'Create a new hook into this element next to or below All Teams' using the following nodes:
team.id
team.associate.associate-metadata.name.full
team.associate.associate-metadata.position
team.team-metadata.alignment
Ensure 'All Teams' is selected
Set List Key = 'Id'
Add a constraint, as follows:
team.team-metadata.alignment
= * (Text)
The below image shows the hooks created so far:
Now make a couple of the sub-hooks more meaningful by renaming more appropriately.
Rename 'Position' to: Associate Position
Rename 'Full' to: Associate Full
All Players
Collapse all the nodes within the 'team' node and then expand as follows:
player
player-metadata
name
Using the 'player' node, create a hook at the parent level
Rename to: All Players
With 'All Players' selected, click 'Create a new hook into this element next to or below All Players' using the following nodes:
player.player-metadata.name.last
player.player-metadata.player-key
player.player-metadata.uniform-number
player.player-metadata.position-regular
(For more on Composite Hooks and Formats, see the main Ignition Help files.)
With 'All Players' selected
Click 'Add Composite Hook'
Rename: Index of Count
Set the 'Composite Mode' to: Format String
Set the 'Format' to: {0} of {1}
Add the following component hooks:
All Players.Index
All Players.Count
With 'All Players' selected
Set List Key = 'Player Key'
Tip. If you hover the mouse over the grey icon adjacent to the name of the hook it displays: ‘Multi-Select List’
Hooks to produce a Score
Now you have created the hooks necessary to do referencing, you will now create some hooks to extract a score at full-time and a score at half-time for both the home team and the away team. You need to be careful to ensure you are using the correct node during this stage of the tutorial - there are two nodes named 'score'.
Collapse the schema to the 'team' node
Expand 'team-metadata'
Expand 'team-stats' and 'sub-score'
Home Team
Firstly, you will create the parent hook for the home team and its required sub-hooks and then following similar actions, you will create hooks for the away team.
Using the 'team' node, create a hook at the parent level
Rename: Home Team
Ensure 'Home Team' is selected
Click 'Create a new hook into this element next to or below Home Team' adjacent to the node: team.id'
Click 'Create a new hook into this element next to or below Home Team' adjacent to the node: team.team-stats.score
Rename: Home FT
Click 'Create a new hook into this element next to or below Home Team' adjacent to the node: team.team-stats.sub-score.score
Rename: Home HT
Add a constraint, as follows:
team.team-stats.sub-score.period-value
<= 1 (number)
With 'Home Team' selected
Set the 'Select Mode' to: Single Item (first in list)
Add a constraint:
team.team-metadata.alignment
= home (text)
Away Team
Using the 'team' node, create a hook at the parent level
Rename: Away Team
With 'Away Team' selected
Click 'Create a new hook into this element next to or below Away Team' adjacent to the node: team.id
Click 'Create a new hook into this element next to or below Away Team' adjacent to the node: team.team-stats.score
Rename: Away FT
Click 'Create a new hook into this element next to or below Away Team' adjacent to the node: team.team-stats.sub-score.score
Rename: Away HT
Add a constraint, as follows:
team.team-stats.sub-score.period-value
<= 1 (number)
With 'Away Team' selected
Set the 'Select Mode' to: Single Item (first in list)
Add a constraint, as follows:
team.team-metadata.alignment
= away (text)
Rename 'Home FT' to: Home FT Score
Rename 'Home HT' to: Home HT Score
Rename 'Away FT' to: Away FT Score
Rename 'Away HT' to: Away HT Score
Your next tutorial is:
Scoreline graphic Part 3