Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is it possible to set custom vars on xml creation list templates? #1793

Open
gonzalo opened this issue Jan 25, 2024 · 2 comments
Open

Is it possible to set custom vars on xml creation list templates? #1793

gonzalo opened this issue Jan 25, 2024 · 2 comments
Labels

Comments

@gonzalo
Copy link

gonzalo commented Jan 25, 2024

Version

Sympa 6.2.70

Installation method

deb package

Expected behavior

I'm trying to add custom_vars into xml template files to standarize automatic creation of certain lists, but I don't know if is even possible.

What I'm trying to achieve is something like this.

<?xml version="1.0" ?> 
  <list> 
  	<listname>forpruebav2</listname> 
	<type>my_type</type>
    	<subject>XML generated list xxxxx</subject> 
    	<status>open</status> 
    	<topics>my_topic</topics> 
  	<language>es</language> 
  	<owner multiple="1"> 
  	   <email>my@mail.com</email> 
  	</owner> 
        <custom_subject>TEST LIST</custom_subject>
        <custom_vars>
           <var name=“my_custom_var_name" value="/xxx/xxx/xxxx/my_file.txt"/>
        </custom_vars>
  </list>

The template work (list is created), but obviously custom_vars section is just "ignored"

@ikedas
Copy link
Member

ikedas commented Jan 28, 2024

XML element should be:

        <custom_vars multiple="1">
           <name>my_custom_var_name</name>
           <value>/xxx/xxx/xxxx/my_file.txt</value>
        </custom_vars>

And you may add the parameter to config.tt2 of list creation template:

(Existing content of config.tt2...)

[% FOREACH v = custom_vars %]
custom_vars
  [% v.name %] [%v.value %]

[% END %]

@gonzalo
Copy link
Author

gonzalo commented Jan 30, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants