Portal Connector Secrets Part 2

Portal Connector Secrets, Shhhh... (Part 2)

In my last blog post (see here), I have mainly concentrated on the backend functionality of The Portal Connector widgets. But as a web developer, I’m excited to share some insight into the secret functionality that we have added to the JavaScript API.


TPC Object

The TPC javascript object exposes some very useful information to the client side. To get the TPC object simply type in the “tpc” in the browser console and this will show you some of the functionality that is available to be accessed in the front end.

tpc


The Portal Connector Version

To get the version of The Portal Connector you have installed, simply type in “tpc.version” in the console.

tpc.version


The Portal Connector Forms

To get an array of the forms that are active on the current page, simply type in “tpc.forms” in the console. 

tpc.forms

This will also allow you to access the form widgets inside individual forms. Here is an example of accessing a Portal Connector form widget inside a form:

tpc.form.widget

To get the Form Name of the form, simply type in “tpc.forms[0].$$name”. Where 0 is the index of the form you want to access.

tpc.formname


The Portal Connector Pages Widgets

To get the Portal Connector page widgets, simply type in “tpc.page”. This will give an object listing the page widgets that are in the current page and it allows you to access the API for individual page widgets.

tpc.page

Click here for more information about the individual TPC Widgets API.


Validate Portal Connector Form

You can easily validate a Portal Connector form from the client side, using The Portal Connector API by simply passing the from name to the isFormValid() function, See Below:

tpc.form.validation


Find & Find All

You can find all of The Portal Connector form widgets in the page by simply typing in “tpc.findAll()”.

tpc.findall

You can also find a specific widget by simply typing in “tpc.find()” and passing the name of the widget.

tpc.find


Identity

You can also get the current logged in user's information by simply typing in “tpc.identity”.

tpc.identity
Stay tuned for Part 3 of this Portal Connector Secrets blog series. 
stay-tuned

WANT TO TAKE YOUR WEB PORTAL TO THE NEXT LEVEL ? 

Stay informed of Web Portal Tips & Tricks from Portal Hero!

Sign up for our newsletter!

loading image
Become a Portal Hero!