Global Variables?

messageinabox

Client
Регистрация
25.04.2011
Сообщения
32
Благодарностей
0
Баллы
6
I have files that are common to use (emails, names, sites, etc) by different templates.

Instead of having to import a list, do list processing, assigning variables I would like to have a common variable across my templates. How can I do that with Global variable?

Also, say I made a 'Common Folder' of emails, names, sites, etc - Folder Common
c:\zenno\common

and my template is at
c:\zenno\wordpress

How can I access the Folder 'Common' without having to use exact path (in case I want to transfer the template to another computer).

Thanks!!
 

rostonix

Известная личность
Регистрация
23.12.2011
Сообщения
29 067
Благодарностей
5 715
Баллы
113
I have files that are common to use (emails, names, sites, etc) by different templates.

Instead of having to import a list, do list processing, assigning variables I would like to have a common variable across my templates. How can I do that with Global variable?

Also, say I made a 'Common Folder' of emails, names, sites, etc - Folder Common
c:\zenno\common

and my template is at
c:\zenno\wordpress

How can I access the Folder 'Common' without having to use exact path (in case I want to transfer the template to another computer).

Thanks!!
If you're not changing variables inside template (and it's not to be needed to change variables for all projects at this point) just create importing this data + list processing for 1 template and copy to others.

Variable for project directory: {-Project.Directory-}
 

messageinabox

Client
Регистрация
25.04.2011
Сообщения
32
Благодарностей
0
Баллы
6
So, if my project directory for Wordpress is at c:\zenno\wordpress

How can I make a path going to c:\zenno\common ?
(This directory has my emails, names, etc)

I want to do to have a path going to this directory c:\zenno\common because when I make another template (LiveJournal) I want to use the same data inside c:\zenno\common
 

rostonix

Известная личность
Регистрация
23.12.2011
Сообщения
29 067
Благодарностей
5 715
Баллы
113
Just use c:\zenno\common

{-Project.Directory-} will be for each project different (depends on it's folder)
 

drvosjeca

Client
Регистрация
26.10.2011
Сообщения
512
Благодарностей
455
Баллы
63
So, if my project directory for Wordpress is at c:\zenno\wordpress

How can I make a path going to c:\zenno\common ?
(This directory has my emails, names, etc)

I want to do to have a path going to this directory c:\zenno\common because when I make another template (LiveJournal) I want to use the same data inside c:\zenno\common
Let me put you few options on table...

1. if you use {-Project.Directory-}example.txt ...that means that wherever you save your template, it will pick this example.txt from same folder (that is if you have it inside).

2. if you set {-Project.Directory-}somsubfolder\example.txt ...this means that wherever you save your template, it will pick example.txt file from its subfolder, which is in this example named "somsubfolder".


3. you can set some permanent files for some data if you like, and save filepthas in some txt files (i would never do it like this, but it is another option just to show you). These can be later used as variables.

4. You can use global variables. Like for example you set one template, which will define and activate all global variables, but this needs to be set in poster every time you wanna run projects, best would be in scheduler. First you set template for global variables preparation to run, then rest templates following.



Like you see...there is always more then just on way to solve something, it is up to you which one you wanna use :-)

i hope it helps
 
  • Спасибо
Реакции: BFlame6 и messageinabox

Stroks

Client
Регистрация
09.02.2012
Сообщения
219
Благодарностей
14
Баллы
18
So if you run 10 different templates, and you use set a global variable in template that is executed first, you can use the same variable too in other 9 templates.

As I do not see settings in poster for global variables.
 

rostonix

Известная личность
Регистрация
23.12.2011
Сообщения
29 067
Благодарностей
5 715
Баллы
113
So if you run 10 different templates, and you use set a global variable in template that is executed first, you can use the same variable too in other 9 templates.

As I do not see settings in poster for global variables.
Correct.
You can set them via variable processing action.
 

drvosjeca

Client
Регистрация
26.10.2011
Сообщения
512
Благодарностей
455
Баллы
63
So if you run 10 different templates, and you use set a global variable in template that is executed first, you can use the same variable too in other 9 templates.

As I do not see settings in poster for global variables.
settings are in template, you just set what you wanna run and when in poster...and yes, you can do that, use same variables in other templates
 

messageinabox

Client
Регистрация
25.04.2011
Сообщения
32
Благодарностей
0
Баллы
6
2. if you set {-Project.Directory-}somsubfolder\example.txt ...this means that wherever you save your template, it will pick example.txt file from its subfolder, which is in this example named "somsubfolder".
The path for my templates are
c:\zenno\wordpress
c:\zenno\livejournal

How can I get details from this folder
c:\zenno\common

Will I use {-Project.Directory-}common\firstname.txt to get the file firstname.txt?


4. You can use global variables. Like for example you set one template, which will define and activate all global variables, but this needs to be set in poster every time you wanna run projects, best would be in scheduler. First you set template for global variables preparation to run, then rest templates following.
I would prefer using global variables but I'm new to ZP and I don't have any idea how to set and activate global variables :( How can I do this?

THANKS!!!
 

rostonix

Известная личность
Регистрация
23.12.2011
Сообщения
29 067
Благодарностей
5 715
Баллы
113
See above:


Just use c:\zenno\common

{-Project.Directory-} will be for each project different (depends on it's folder)
 

Кто просматривает тему: (Всего: 0, Пользователи: 0, Гости: 0)