- 12 Sep 2024
- 8 minute read
- Print
- DarkLight
- PDF
Troubleshooting Portals
- Updated 12 Sep 2024
- 8 minute read
- Print
- DarkLight
- PDF
Below are some frequent topics related to using Portals in Slate.
Duplicate branding
The portal method output type determines how the data is returned in the portal. If the portal leverages tabs, then the method using the view containing the tab architecture should set the output type to Default Branding. The methods associated with the tab views should be set to AJAX Popup/No Branding.
Go the method for the tab where there is duplicate branding displayed.
Click Edit.
Ensure the Output Type is AJAX Popup/No Branding.
Portal is slow to load
Slow loading portals or timeouts can occur if portal queries are inefficient or trying to pull too much data at once. To start, ensure that all portal queries are using standard Configurable Joins query bases whenever possible and have limited use of custom SQL.
Breaking up large queries into multiple queries can also help load the portal if a large amount of data is needed.
Consider if the information can be broken up across different tabs so that queries are only pulled when necessary. Also, check that queries are linked only to their appropriate methods. There is no need to link a query to a method if the data is not used when the method is called.
Additionally, check that exports aren't duplicated across queries when they're not needed. For example, if a method is linked to two queries and you need the pull the rank 1 GRE score, including it in just one of the linked queries will suffice.
Try to see if information needs to be displayed immediately upon page load, or if a user could take an action to get the information. For instance, if you want to display a list of checklist items for a list of applicants in the portal user's department, does the user need to see the checklist items immediately when they log into the portal? Or could the checklist information be in a pop-up where the data is only pulled when the user wants more information about a specific applicant?
Table View Widget
No queries in dropdown
When using a Table View Widget, only queries with a node will be available for selection.
Go the query to be used in the Table View Widget.
Click Edit Parameters.
Add a value for the Output Node.
Return to the portal view and select the query.
No results shown
When using a Table View Widget in a portal view, a query must be selected.
The query used must contain a sort.
Unsupported method
This error typically happens during one of these circumstances:
A portal was created with one or more views, but no methods.
An action was called, but no method with that action exists.
There is a naming mismatch between the action being called and the action of the method.
If your portal does not have any methods and you are seeing this error, make sure there is at least one method that is associated with a view and has a blank action.
When starting to build a portal with pop-ups or tabs where additional methods with actions are needed, this error can occur if you have built the URL in the view to go to the new pop-up or tab, but have yet to create a method. Creating the method with the determined action will resolve the error.
If you have already created the method but are still seeing the error, check the cmd called in the URL against the action of the method. In this example, the portal method is directory_detail, but the cmd in the URL is directory_details.
Must declare scalar variable
If you are using a parameter in your portal, such as passing the ID of the record clicked into the query to return data in a pop-up or sending in a filter selection, then the parameter must be declared in Edit Parameters.
Go the query where you are receiving the error.
Click Edit Parameters.
Add the parameter in the Parameters section.
Ensure that you set a type.
Tabs are not highlighting
To start, you'll want to ensure that in the JavaScript for your tabs, you are setting the class to active rather than selected or other type of class.
Additionally, you can use Custom CSS Rules to change the color, hover color, size, etc. The subtabs class in the rule is active, as it should be.
Records can access a view they shouldn't see
Make sure your redirect(s) follow the conventions in the Portal Redirects article. That is, if you have multiple disparate views, make sure you have one redirect method per view method. If you have a portal with tabs, make sure you set up your single redirect method correctly.
For example, in this portal with two separate views (and no tabs), you'll see that there is a method with an action for each view, as well as a corresponding method with the same action for the redirect.
Conversely, in a portal that uses tabs, you only need a single redirect method. In this case, the redirect query must have a parameter called tab that captures the current tab and redirects based on it.
Merge fields are blank
The merge fields used in Static Content parts must match exactly with the query exports. For example, in the query, if the export label is first but in the view the merge field is first_name, then the data will not display.
The export labels have been updated to match the merge fields exactly.
If the merge fields and the query exports match, you'll want to check if the query is linked to the appropriate method. When a portal method runs, it only has access to data in queries linked to that method.
If the volunteer information query is not linked, then the portal method doesn't have access to the data in that query and, consequently, the data is not used in the view's merge fields.
Liquid Looping merge fields are blank
Liquid Looping syntax requires a prefix in front of the merge fields. If you recently added a merge field and it’s blank, make sure the prefix is present.
In this example, the location merge fields are missing the result prefix shown in the other merge fields. In this scenario, the summary and date information does populate, but the city and region do not.
In the source code, the Liquid looping syntax starting with for result in my_event. my_event is the node used in the query. result is the prefix. When looping through the list of results in the my_event node, in order to output the data correctly, each merge field must include result. before the merge field name.
The prefix in Liquid looping can be determined by the user. You may see examples of for item in node_name or for applicant in node_name. Whatever prefix is decided, it must be used in front of each merge field while using Liquid looping.
When creating a portal that pulls information about a single record, as well as information about a list of records (for example, an alumni interviewing portal that displays data about the alumni record logged in, as well as the list of interviewees assigned to them), it is important to understand when to use a node and when not to.
A node is only necessary when pulling a list of results. In this example, there is a query for a list of possible interviewees and a query for a list of possible events. These queries have nodes because there could be 0-n results. There is also a query for volunteer information about the volunteer logged into the portal. This query does not have a node, as it is only returning a single row of data.
Pop-Up doesn't load any data
In order for data to appear in a pop-up, a parameter must be used in the URL for the pop-up. For example, the portal may pass in an applicant's ID as the value for the id or record parameter. The name of the parameter used in the URL must match the parameter used in the query that returns the data in the pop-up. Additionally, the portal must have access to the merge field that populates the value.
The parameter name is application. result.id is the value that will be passed to the pop-up query. The first troubleshooting step is to ensure that a value is included. You can check using your browser's developer tools. When using Chrome, press Command + Option + C (Mac) or Control + Shift + C (Windows, Linux, Chrome OS).
Clicking on Kat's record, we can see in the Network tab that application=c63763f4-f83f-4d7c-8b7a-938540ce5299. This means that a value for application is being sent into the pop-up query.
Next, check the parameter in the pop-up query. If it is not application, then the query will not be able to accept the value.
Go the query used in the pop-up.
Click Edit Parameters.
Ensure that the parameter in the Edit Parameters section matches the parameter used in the URL.
Ensure that you set a type.
Check that the filter then uses the same parameter.
application is indeed the parameter and is used in the filter.
If data is still not appearing in the pop-up, make sure that the query is only using a node where applicable. In this example, two queries are being used in the pop-up. The first query, which pulls details about the applicant clicked, does not have a node, because there will only be one record in query results. The second query, which returns the checklist items for the applicant, does have a node, as an applicant might have multiple checklist items.
Portal XML
XML, also known as eXtensible Markup Language, is designed to store data while HTML displays the data. In a portal, users can see their HTML using the Source Code in the view widgets. To view the XML, users can go to the portal and append &output=xml (or ?output=xmlif the portal URL does not have any additional parameters).
Go the portal.
Open developer tools, and go to the Network tab.
Right click on the URL, and select Open in new tab.
Append the URL in the new tab with output=xml.
The XML will display information about the user logged in, as well as the data from the portal queries for that method.
Important!
Only users with the 'Administrator (All Access)' permission will be able to view the XML.
Using XML can help users troubleshoot the names of the merge fields, identify what nodes are used, etc. While it is not necessary to understand XML or be familiar with browser developer tools to build a portal, some familiarity can be useful when troubleshooting.