Hi,
I suggest to format your template in a different way. First you need to use
the http:// in the URL, because its possible that pictures, videos, etc. are
stored in a different way - ie. an ftp:// or https:// site. Thus, you can't
assume the http:// Prefix.
The template you want to have can get built using if-statements. This
imitates a case-loop.
<Template rel="example">
;{{{title}}}
{{ifeq:{{{format}}}|image|<img alt="{{{notes}}}" ... src="{{mainurl}}" />|
{{ifeq:{{{format}}}|audio|<embed alt="{{{notes}}}" ... src="{{mainurl}}" />|
{{ifeq:{{{format}}}|video|<embed alt="{{{notes}}}" ... src="{{mainurl}}" />|
<div style="color:red">'''Error:''' the given mediatype is invalid. Please
use either "image", "audio". Or "video".</div>
}}}}}}
:{{{notes}}}
</Template>
The format is:
{{ifeq:{{{variable}}}|template|then|else}}
And means: If "variable" is equal "template" then write "then" else write
"else".
Hopefully that helps.
Ys, MovGP0
Thierry Kennes wrote:
> Hello all,
> I'm new here. I need some help that I didn't figure out yet. I made a
> template that is used like this in a way :
> {{Blabla|
> title=Name (ie: Flickr)|
> mainurl= The main URL (without "http://")|
> format=image, audio, video|
> notes= notes you'd like to write.
> }}
>
> The problem is with format field. Actually, I want that it uses a
different
> format so that later, I can query and made for example a list of all
audios.
> Does anyone have an idea how to do it ?
>
> ps: i've already tried by using a template "format" within the
template
> "blabla" but there is 2 square brackets at the end and I don't know how to
> get rid of them. it looks like :
> {{Blabla|
> ....
> ....
> format= {{format | format=image}} {{format | format=audio}} {{format
|
> format=video}}|
> .....
> }}
>
> ps2: sorry for my bad english :)
>
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Semediawiki-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/semediawiki-user