Skip to main content

Return to TX Community

Liaison

Customizing Event CSS and Javascript in Events 5.0 and higher

DISCLAIMER: This CSS tag is not supported or maintained by TargetX and is meant as an example of how you may choose to use CSS within our products. Some or all of the customizations these tags provide may change or no longer apply to your instance at any time. If at any time the CSS impedes expected functionality in the TargetX product, our recommendation will be for you to remove the CSS to regain functionality.  

Custom CSS changes are stored directly in Salesforce as data on the Events Custom Code Object. To use this new object, you will first need to create a tab for Events Custom Code. To do so, please see the documentation from Salesforce on creating new tabs

Note: A new tab was not added as part of this package given Salesforce's limit on custom tabs. 

To create new custom CSS or Javascript:
 

Notes: 

  • Leave out the Script tags when creating custom CSS or Javascript. They are automatically applied in the code and not needed.
  • IMPORTANT! In order to have CSS work correctly in your Events module, you must set the Sharing Settings for external users to Public Read Only or a sharing rule must be created to share with profiles, so the site can see the record on the Events Custom Code Object. For additional information, see: Recommended sharing settings for Default External Access (Organization-wide Defaults).

 

  1. Click "+" to see full list of tabs in Salesforce
  2. Click on the Events Custom Code tab
  3. Click New
  4. Enter a Theme Name and copy the exact name for reference in later steps.
  5. Enter the CSS or Javascript for the Events page.

Note: The custom CSS and Javascript will apply to all pages. Separate CSS or Javascript on a page by page setting is not available.

  1. Click Save
  2. Navigate to Setup and search for Custom Settings
  3. Select Manage next to Events Settings
  4. Click Edit next to the custom setting to which you'd like to apply the CSS or Javascript
  5. Type or paste in the exact name of the custom code record you created into the Template Override field
  6. Click Save

Note: To test this feature, you can paste the following sample CSS code into an Events Custom Code record and enter the name of that theme in the Template Override field on one of your events custom setting files.

There are two places where you can make updates to the look and feel of your public event site: your Default Community Theme and in the Events Custom Code object:

Area to be Customized Controlled via
Background of Events view Event Custom Code record
Header background Event Custom Code record
University Name Default Community Theme
Header Logo Static Resource on Default Community Theme
Logo background Event Custom Code record
Event Calendar Text Event Custom Code record

If you want to keep your logo the same between your Events page and your App Dashboard or Portal Events pages, you'll want to update the Header Logo in each of your community themes. This will ensure continuity across the board.

Note: When you update the Header Logo in your App Dashboard or Portal Community Themes, that will also change the logo on your App Dashboard or Portal Community site.

Sample Codes

Important: TargetX recommends that you DO NOT use custom code to manipulate the settings for iframes.

Description

Code

Removes the gradient background on the Events page. .event-details__container--poster .event-details__content {
  background-image: none;
}
Appends the text "(Not including student)" after the Number of Guests question on the event registration page. label[for="type"]:after

{content:'\00a0(Not including student) '}
This will turn the background of all pages red. body{ background-color:red; }
This code will hide the Cancel button. .bd span span input:nth-of-type(3)
{
display:none !important;
}
This code will allow you to adjust the Custom Questions section white space within Events 6. .l__container
{ padding-bottom: 0px; }

This code will increase the space in custom questions if you are using TX Forms.

 

.form-input__label
{ white-space: normal; }

This code will allow you to ensure the Custom Questions do not overflow to the side of the screen within Events 6.

.form-input__label
{ white-space: normal; }
This code changes the color of the Register button and also the More Info button if it is featured. .button--color--green, .button--color--green:focus {
background-color: red;
}
This code removes the background color behind the events logo if you use a .png file. .portal-header__logo {
background: none;
}
Change the ALL EVENTS and FEATURED EVENTS headers font size. Replace 16px with your preferred font size. .event-sidebar__title {font-size: 16px;}
Change the MY EVENTS, TYPE, KEYWORD & LOCATION headers font size. Replace 16px with your preferred font size.All E .accordion-title-text.ng-binding {font-size: 16px;}

 

 

  • Was this article helpful?