Page 1 of 1

Show session info on each page, without typing same code 20 times

Posted: Thu Apr 18, 2013 11:23 am
by w

When I have an app that needs to include a "Logged in user: " on the top of each page, only when the user is logged in. How can i do this in Tiggzi?

I hope I don't have to include the same code (for example, checking the localStorage for a value and then display the label on top of the page accordingly) on every page of the app? Because if I change 1 thing (for example the localstorage variable name), I have to change it in 20 pages, it's not possible to maintain code like this with such redundancy.


Show session info on each page, without typing same code 20 times

Posted: Thu Apr 18, 2013 11:58 am
by Kateryna Grynko

Hi,

You can place JavaScript code in asset and then call needed function on every page.
Also it's possible to create custom component with new functionality and add it to each page.