i want to generate table rows from template in Mediawiki:
I have a main table, where a custom number of elements (are inputted by a form by the user.
The input form looks like:
{for template|Team|multiple|embed in field=Project[Team]}
and generates
{{Project
|Team={{Team|Role|First Name}}{{Team|Role2|Second Name}}
}}
The Template "Team" gives back formatted mediawiki table rows:
|{{{1}}}
|{{#arraymap:{{{2}}}|,|x|[[x]]|, }}
|-
And are embedded in the Main-Table-Template:
{|
! Team
|-
{{#if: {{Team}}|{{{Team}}} }}
|}
But unfortunately this gives a warning: "The Value of the attribute Team "|Role1..." contains invalid characters or is incomplete..." (translated from german).
I tried replacing | & |- with the recommended {{!}} but had no success.
Hope someone has an idea to remove those warning
Related
we have a formular to create host names with some additional information.
Inside the formular we include a template, which gets the values via input fields:
{{{for template|IP|multiple|add button text=Add IP}}}
'''IP:''' {{{field|IP|mandatory|property=Host IP}}}
'''MAC:''' {{{field|MAC}}}
{{{end template}}}
We want to have a check if the given IP adress is already used by another host.
I already tried creating an array and iterating through the values and compare it with a given value: this works.
{{#arraydefine: myArray1 | {{ #ask: [[IP::+]] | mainlabel=- |headers=hide | ?IP }} }}
{{#arrayprint: myArray1||####| {{#ifeq: #### | {{{IP}}} | Duplicate #### <br>| No duplicate #### <br>}} }}
However, if I include this in the form itself, the IP input box doesn't assign the value to an actual variable {{{IP}}} - therefor I cannot access it with the method above.
I then tried to use it on the template "IP" directly. That works, but now it checks with every existing site which uses this template and of course, finds duplicates (because it checks it's own value against the array which also contains the value since it's already existing).
I spent almost 2 work days on this little issue now and I reach the limits of my understanding of semantic wiki. Any ideas would be appreciated.
Thank you in advance!
Since your page name is the host name, and host pages store the IP, you can do the following:
Ask for pages with the same IP as the current page :
{{#ask:[[IP::{{{IP}}}]] |mainlabel=-|?#-=}}
Store the result into an array, lets call it "hosts". The array now contains host names that have the same IP as the current page (with html link removed) and the current page itself.
Create a new array containing a single value, the current page name (using {{FULLPAGENAME}} magic word), lets call it "current"
Substract the two arrays :
{{#arraydiff:duplicate|hosts|current}}
Then check the length of the resulting array "duplicate".
if arraysize > 0, a host page different from current page exists with the same IP.
I am quite new in the usage of SPFX but I have created a page using Content Query with HTML template of Handlebars and I have an issue for getting the information from column type lookup.
I have a list "Document" with :
Column "Owner" defined as Lookup people in a group sharepoint users
Column "Proces" defined as lookup on a list containing the different process information
In my HTML template I used Owner.rawValue and Proces.rawValue and got the id (Example: Owner: 25 and process = 36).
Does someone know, have the corresponding code to be able to get :
For Owner, the username (can be a string to be manipulated, no issue)
For Proces, the title being the column used in loopk field
Many thanks and at your disposal for further instruction if not clear
Setup:
I have a Jekyll collection of 800 items
I've set output: false as I don't need individual pages for each one, and want to save time on builds
I do, however, want to be able to output: true on select items
Question
Is there a way to do this? I tried overriding the output variable in the selected item's front matter, but that didn't seem to make difference.
I do know about published: true/false, but I need for all files to be published:true for their data to remain available elsewhere in my site. This question pertains to their output as pages.
You can use two collections, one with output: true (col1) and the other with no output (col2).
Now if you want to loop over both collections in single pass, you can concatenate them :
{% assign all = site.col1 | concat: site.col2 %}
And if you have the same datas in both collections, you can sort item like this :
{% assign all = site.col1 | concat: site.col2 | sort: 'title' %}
I'm a new user for mediawiki. I have installed and configured the semantic mediawiki correctly. Now I want to display a external database table in a wiki page. I tried External Data extension, but I didn't know how to display them correctly. Are there some tutorials available? Could you help me? Thanks!
http://www.mediawiki.org/wiki/Extension:External_Data#.23get_db_data_-_retrieve_data_from_a_database
shows the basic steps. I have personally not found a good tutorial yet.
To try the feature out you might want to start with a query to your own Mediawiki.
Create an extenal data server entry "mediawiki" in you LocalSettings.php that
simply reuses your Mediawikis database configuration:
# external data configuration
$edgDBServer['mediawiki'] = $wgDBserver;
$edgDBServerType['mediawiki'] = $wgDBtype;
$edgDBName['mediawiki'] = $wgDBname;
$edgDBUser['mediawiki'] = $wgDBuser;
$edgDBPass['mediawiki'] = $wgDBpassword;
Then add a macro to fetch some data from the user table (which is a standard Mediawiki table) in
some page of your choice:
{{#get_db_data:
|server=mediawiki
|from=user
|where=not user_name ='Wikiroot'
|data=id=user_id,login=user_name,name=user_real_name
}}
To display the data you might want to use #for_external_table:
{| class="wikitable"
! id
! login
! name{{#for_external_table:<nowiki/>
{{!}}-
{{!}} {{{id}}}
{{!}} {{{login}}}
{{!}} {{{name}}}
}}
|}
You should get a table with id, login and name of your mediawiki users except wikiroot.
I'm new to Django, and need help with a question about email templates.
I'm using a Django-helpdesk apps and it's have a model name Ticket. Along with many other fields, I would like to add an extra field to it, that is, a field name foo. All database is updated, and when a user submitter a new ticket, an email is sent to the user with some info, i.e submitter_email, dates etc. Everything seems to be correct but the new field foo I've added is blank.
For example, in email templates we can retrieve a ticket id by calling in HTML field:
{{ ticket.ticket }}
you'll get Ticket number 1234, or:
{{ ticket.submitter_email }}
If you want to retrieve a submitter email. But when I call:
{{ ticket.foo }}
the foo is blank.
To mention: Django-Helpdesk email templates using JSON, and south, and I've checked that south is migrated corectly after the field foo is added.
Do I missed something here? I'm very thankful for your help.
Thanks.
I've found my answer. All you need is to add your field foo in the contex of the method safe_template_context(ticket) in the lib.py.