I was recently asked to explain how to modify the SalesLogix Web. A common enough question IN get asked so I figured I would describe the Page and how to do some of the things.
One of the things I do not like about the current implementation of the Welcome page is that it is largely static text. Things like the welcome message should really be data driven. That way an administrator could make a note about some important news for the day and it would immediately show up. Currently to do this you need to update the deployed pages manually to show a static message. Maybe a future blog will show how to change this. For now let’s look at the current state:
The easiest way of determining what makes up a given page is to look at the page definition in the Application Architect. The details about the various smart parts that are loaded can be seen on the page definition. To get to the page definition:
- Open the Application Architect.
- If the Project Explorer is not open, press Cntrl+Alt+E to open it.
- In the Project Explorer, expand out the VFS…Portal Manager…Sage SalesLogix…Pages.
You will see the list of pages that exist in the web client. For the welcome page, scroll down to the first instance of the Page called “Welcome Page”. Double click on it and the page definition dialog will open.
Under the Smart Parts tab you can see the various components that make up the page. If you click on a specific smart part you can see the definitions for the smart part just to the right. In the screen shot above we can se we have the EditRecurance smart part selected.
The Title and Description can be customized. This is the heading of each “box” on the standard welcome page. For instance if you click on the smart part “IntroText” you can see the Title and Description are “Welcome”. This corresponds to the title of the box on the welcome page that says “Welcome”.
The Smart Part property of each smart part shows where the smart part is located. You can tell that all of the smart parts on the Welcome page are custom smart parts (not quick forms) because each smart part has a suffix of “(Custom)”. This means that the pages have no GUI in the Application Architect and instead are comprised of standard ASP.Net user control files.
Let’s take a look at one of these custom forms. We will look at the “IntroText” smart part since that contains a message that often is requested to be changed. Click on the IntroText smart part definition on the page. To the right you will see the Smart Part property show a path of “SmartPartsDashboardIntroText.ascx”. This is the location within the VFS where the smart part can be found. Now you can click the Edit button to open the ascx file directly but I want to show you how to navigate there because we will need to look at other things besides just the ascx file.
In the Project explorer, under VFS…Portal Manager…Sage SalesLogix, you will see a folder called Support Files. Expand out this folder. You will see a sub folder called “SmartParts”. This is the location all custom smart parts exist in the VFS. Now if we refer back to the path that was defined for the “IntroText” smart part, of “SmartPartsDashboardIntroText.ascx” we can now navigate in the project explorer to that location.
So in the project explorer you should navigate to VFS…Portal Manager…Sage SalesLogix…Support Files…SmartParts…Dashboard. In this folder you will see all of the custom smart parts.
Most custom smart parts in the system consist of three components:
- An ascx file which is the page markup file defining what is on the page.
- An ascx.cs file which is the code file corresponsing to the ascx file with the same name.
- A resx file which is a resource file containing text values. This file is referenced by the ascx file. This file is in a sub folder called app_localresources.
Lets take a look at the IntroText.ascx file. Double click the file to open the editor.
On line ten of the code we can see a asp.net label control defined called “Label2”. The text of the label is being pulled from resources:IntroText. Now the resources keyword denotes that the text that displays for this label is being pulled in from this ascx’s associated resource file. The resource file is located in the same location in the VFS as the smart part. Look back at the Project Explorer. You will see a folder in the Dashboard folder called App_LocalResources.
When you expand the folder you will see the resx files corresponding to each ascx file. Find the IntroLinks.ascx.resx file. Double click on the file to open the editor.
The editor contains the resource file. A lot of the first part of the file(lines 3-60) is a comment section that is not important. If you scroll down to line 123 you can see the resource element with the name of “introText”. On line 124 you can see what the value of this resource element actually is. Now we are getting somewhere. Here is the text you see on the welcome page. If you modify this resx file, replacing the existing text with something of your own you will then see that new text once the web site is redeployed.
Lets take a look at the actual welcome page quickly:
We can see that this smart part also has an image and a heading of “Welcome to Sage SalesLogix”, as well as a link to learn how to use the system. Lets look back to the ascx file.
We can see on lines 12-16 markup to add the “learn how to use the system” link. What about the picture and “Welcome to Sage SalesLogix” heading. How are those defined?
Well those are actually part of the smart part’s style sheet. You can see on line 7 that the div is using the style sheet class of ListOfLinksOuterDiv. Digging through the CSS, also in the VFS reveals that the image is defned in the Sage-styles.css under the welcome-widget definition. This welcome-widget also has a h2 definition which can be traced to rely on the resource file called “Widget.resx” under VFS…Portal Manager…Sage SalesLogix…App_LocalResources.
Line 270 of the resource file contains the definition of the title. Changing this resx file’s value on that line will replace “Welcome to Sage SalesLogix” to another value. (After the site is redeployed.)
So there you have it the not so simple way of changing the resource files to make the welcome page’s intro text appear different. Keep in mind you can always update the resx files on the deployed web site directly instead of doing it in application architect but doing so will reset the asp.net application and any users in the system will get kicked out. Modifying the deployed files only also means the next time the site is deployed from the application architect your local web site changes will be overwritten with what is in the VFS when the site is deployed.
As you can see having static content on the page is a real drag to have to manage and maintain. Far better to pull this information dynamically based on data. I could see recreating this type of page but with real time feeds from various sources. Building the page dynamically is really the best way to handle a welcome screen like this. Too bad Sage only created a static series of smart parts for the OOTB welcome page.