Global variable from a template doesn't get added to lesson

Use templates to standardize and re-use content functionality

Moderator: Nav

Global variable from a template doesn't get added to lesson

Postby daljit » Wed Oct 10, 2012 5:23 am

Hi,

I have template which has 2 variables - one is of global type and another is local. When I apply this template to a lesson, the global variable from the template doesn't get added to the lesson which breaks the copied template 'actions' and I have to manually create this variable, and update all the related actions. The purpose of using a template was to save time adding these actions manually.

I have noticed that there are about 150 global variables already in the lesson. This template works fine on some other lessons. Could the number of global variables be the cause of this problem?

I hope you can help me find the solution.

Thanks,
Daljit
daljit
 
Posts: 4
Joined: Wed Nov 23, 2011 10:28 am

Re: Global variable from a template doesn't get added to lesson

Postby Nav » Thu Oct 11, 2012 11:28 am

Hi Daljit,
Thanks for posting this (and testing it).

I think you're running into a fail safe that we designed after people were having some issues a while ago. Basically, if you're working on a lesson and decide to create a template from one of the pages, the template will grab all the Global Variables. Many people don't realize this since you may or may not be concerned with variables on this particular page (but SmartBuilder doesn't know if you are or not).

Then when you apply that template back to the same lesson, you have twice as many Global Variables! If you continue this process all in the same lesson, your Global Variables just keep increasing until there are thousands of them, and you can't even open your lesson anymore. So we made it so that if you're applying a template and there are already 100 Global Variables in it, we don't bring in the new ones. If you have 99, then you're okay.

The fix for this is to open your template and look in the Variables panel. You'll see lots of variables (and copies). Delete the ones that aren't part of the template. If you're not sure about one, you can select the variable and use the Where Used to highlight the actions using that variable. You should probably also clean up the Global Variables in your lesson as well.

If you intentionally have over 100 Global Variables in your lesson, and you wish to add more in your template, you may want to edit your template to make the template variables Local, rather than Global. Once they are in the lesson, you can click on the Globe icon to change them to Global.

Hope that helps!

- Nav
Nav
 
Posts: 866
Joined: Mon Nov 05, 2007 2:58 pm


Return to Templates

Who is online

Users browsing this forum: No registered users and 2 guests

cron
Not able to open ./cache/data_global.php