Adding links to IQA results
IQA lets you design search results that contain live hyperlinks within the items that it returns. Using the Hyperlink feature on the Display tab, you can create hyperlinks for multiple columns in your query results. These links let users immediately click through to the records and content that they are seeking. In this example, users can click links to open specific contact profiles.
Combining Hyperlink strings with Alias variables lets you create powerful queries that open the details that your users need.
Building a hyperlink
To build a link, you must first indicate whether it should point to one of the following:
- Shortcut URL (~/MyShortcut)
- Content record (ContentCode)
- Navigation item (NavigationCode)
- ASPX web page (~/Webpage.aspx)
Shortcuts and content record links display the published content record within an iMIS website, regardless of the sitemap definition. Links to a navigation item take the user to a particular page within an iMIS sitemap.
shortcut URL
~/MyShortcut – For the given property, a link is established to the shortcut specified (shortcuts are defined in Site Builder > Manage shortcuts). For example, if you want to link query results to a Products shortcut you have defined, then enter ~/Products.
content record
ContentCode=MyContentCode – For the given property, a link is established to the content identified by the ContentCode value. For example, if you want to link query results to a product page content record that has a Content Code of Specials, then enter ContentCode=Specials. To define or edit a Content Code, go to Page Builder > Manage content, edit a content record, and expand the Properties tab.
navigation item
NavigationCode=MyNavigationCode – For the given property, a link is established to the navigation item identified by the NavigationCode value. For example, if you want to link query results to a profile page’s navigation item that has a Navigation Code of ProfilePage, enter NavigationCode=ProfilePage. To define or edit a Navigation Code, go to Site Builder > Manage sitemaps, edit a navigation item, and expand the Properties tab.
Note: If the Hyperlink includes both a ContentCode and NavigationCode, only the ContentCode is used to build the link.
ASPX web page
~/Webpage.aspx – For the given property, a link goes to an ASPX web page, relative to the root of your website. For example, ~/Party.aspx.
Note: Party.aspx is a sample redirector page shipped with iMIS that checks the user’s permissions to determine which content record to display. To see a sample query that uses this functionality, from IQA open $/ContactManagement/DefaultSystem/Queries/Directory/People search.
Using URL parameters in a hyperlink
Using URL parameters, you can control the data displayed on the target page if it contains a content item that accepts such a value. The URL parameter can either be hardcoded to a specific value or it can be dynamically generated based on the value of a particular Property or Alias of the query. You can add multiple URL parameters to the Hyperlink, separated by ampersands (&).
URL parameters should be in the following form:
- &URLParameter1Name=[PropertyName] – Dynamically builds the link based on the value of the specified query property. When referencing a query property, do not include any spaces. For example, if you want to set the URL Parameter iProductCode (used by the General Product Display content item) to the Product Code property value, enter &iProductCode=[ProductCode] (no space between Product and Code). By combining this example with the Shortcut example, you can build a link that opens the shortcut populated with the product in the query results. The full Hyperlink would look like:
~/ItemDetail&iProductCode=[ProductCode]
NavigationCode=ProfilePage&ID=[iMIS User Id]
Hiding display properties from the query results
Any properties used to build links must be selected for display in the query Display tab. However, you might not want a user to see values for all of the properties required to build the links. You can hide columns from a user by giving the property an Alias prefaced with code_.
In the below example, the Full Name column uses the value of an Id property to build the links, but the Id property is hidden by giving it an Alias of code_Id.
Troubleshooting
Review the following troubleshooting tips:
- If you get an error message after clicking a link in your query results, check your link entry for the following:
- If you have an opening bracket, you must also have a closing bracket [ ].
- If you provide an Alias for a property, then the original property name is no longer usable in the Hyperlink field. The Alias always overrides the original field name and will be the only column name available for reference in the results.
- If a property has Group By enabled with a Hyperlink defined and that link is referencing another property in the query, then the linked property must also have Group By enabled. Not enabling Group By on both properties will result in a query error.
- If your query result links do not work as expected, try the following troubleshooting techniques:
- If possible, find a place in iMIS where the target page is correctly displayed and compare the URL parameters that appear for that page to the ones you have identified in the Hyperlink text field. Are there additional parameters required that you have not provided?
- Add the query to a content record in your website, so that you can view the query results like an end user would. After clicking a linked query result, examine the URL in your browser. Compare it to the Hyperlink you have built in IQA to determine if the URL is incomplete and if it contains everything you intended.