Topic on Project:Support desk

How to give <ref> a name when called through a template, but without Lua/Scribunto?

12
182.232.40.56 (talkcontribs)

I use this template to create a footnotes chapter:

<includeonly><references /></includeonly><noinclude>

[[קטגוריה:תבניות]]
</noinclude>

I use this template to create each footnote:

<includeonly><ref>{{{1}}}</ref></includeonly><noinclude>

[[קטגוריה:תבניות]]
</noinclude>

So, to create a footnote I type:

{{הערה|תוכן}}

But I want to use something like:

{{הערה|שם|תוכן}}

While שם stands for name (HTML attribute);


How to give <ref> a name when called through a template, but without Lua/Scribunto?

182.232.40.56 (talkcontribs)

The second template should be:

<includeonly>{{#tag:ref|{{{1}}}}}</includeonly><noinclude>

[[קטגוריה:תבניות]]
</noinclude>
AhmadF.Cheema (talkcontribs)
182.232.44.48 (talkcontribs)

@AhmadF.Cheema I have read there cautiously but I didn't find any explanation about how to make name at:

<includeonly>{{#tag:ref|{{{1}}}|name="name"}}</includeonly><noinclude>
[[קטגוריה:תבניות]]
</noinclude>

To be equal with שם in template call, so that, instead:

{{הערה|תוכן|name="שם"}}

I could call the template this way:

{{הערה|שם="שם"|תוכן|}}

So maybe a more accurate version of my question is:

How to give <ref> a name in a non-English language when called through a template, but without Lua/Scribunto?

182.232.44.48 (talkcontribs)

Crap, I had to write there:

<includeonly>{{#tag:ref|{{{1}}}|name}}</includeonly><noinclude>
[[קטגוריה:תבניות]]
</noinclude>

I think.

AhmadF.Cheema (talkcontribs)

The template should be:

<includeonly>{{#tag:ref|{{{1}}}|name={{{2}}}}}</includeonly><noinclude>
[[קטגוריה:תבניות]]
</noinclude>

Then it should be called in the article as: {{Template_name|foo|bar}}, where foo is the reference text and bar is the name of the reference. The reference can then be reused with the following code: <ref name=bar/>

49.230.0.242 (talkcontribs)

I was told by Hebrew Wikipedia users that there could be a problem if my template includes text which by itself includes = symbol and I was recommended to use:

{{#tag:ref
    | 1 = {{{תוכן|}}}
    | name = {{{שם|}}}
}}
49.230.0.242 (talkcontribs)

But, that example doesn't work (or I have to change all template calls for it to work).

AhmadF.Cheema (talkcontribs)

This way the template should be called in the article as: {{Template_name|תוכן=foo|שם=bar}}.

49.230.0.242 (talkcontribs)

When calling that template with:

{{הערה|שם="שם"|תוכן="תוכן"}}

I get this Hebrew error:

שגיאת ציטוט: תג <ref> לא תקין; שמות שגויים, למשל, רבים מדי

49.230.0.242 (talkcontribs)

I get the same error with these calls also:

{{הערה|תוכן}}
{{הערה|תוכן="תוכן"}}
49.230.0.242 (talkcontribs)

@AhmadF.Cheema I think I should use your original template like this:

<includeonly>{{#tag:ref|name|{{{1}}}}}</includeonly><noinclude>

[[קטגוריה:תבניות]]
</noinclude>

And, in cases that the CONTENT includes one equal sign or two or more equal signs, than I should input these not as mere text but via a {{=}} template whose value is = and then use that template as in:

{{ Test | R {{=}} 3/(2-(1+1)) }} 

This is a solution I found in a quick search in StackOverflow at "Passing an equal sign ('=') to a parameter in a MediaWiki template".

But:

I am still in problem how to use "שם="שם instead name="name" so to get an all Hebrew (all RTL) template.

Sorry if I missed anything; this is tough and confusing to me.

Reply to "How to give <ref> a name when called through a template, but without Lua/Scribunto?"