User:Xaris333/Useful
- Template:Db Ταχεία διαγραφή
- Λήμματα για τα ελληνικά
- User:Xaris333/Tempate National Teams
- Wikipedia:List of Wikipedians by number of edits
- Wikipedia:List of Wikipedians by featured article nominations
IRC Channel #wikipedia-tech
{{expand language|topic=|langcode=el|otherarticle=Άτλας Αγλαντζιάς|date=September 2016}}
Help to replace
[edit]Hello. I want to remove a template. The templates has different names in it. For example:
- {{ft|TEAM1}}
- {{ft|TEAM2}}
- {{ft|TEAM3}}
I want to remove {{ft| and }} to have only
TEAM1
TEAM2
TEAM3
I can easily remove with find and replace the {{ft| but I can't do anything with the }}. Any suggestions?
Xaris333 (talk) 16:50, 12 April 2014 (UTC)
- That would probably require a regular expression. Try the following:
- \{\{ft\|(TEAM[123])}} → $1
- with the "Regex" box ticked. This regex works for me in the AWB regex tester. SiBr4 (talk) 17:09, 12 April 2014 (UTC)
- I think I'm now taking your request too literally and assumed you only wanted to find cases where the first parameter is "TEAM1", "TEAM2" or "TEAM3". A regex that catches every usage of a template {{ft}} would be
- \{\{ft\|(.*)}} → $1
- (the .* matches any text except newlines). SiBr4 (talk) 17:15, 12 April 2014 (UTC)
Many thxs!!! Xaris333 (talk) 18:52, 12 April 2014 (UTC)
- Oh. I already replied at WT:AWB. The regex above won't work very well. Try it in the tester and see. Mr Stephen (talk) 21:56, 12 April 2014 (UTC)
- [Reply moved from Wikipedia talk:AutoWikiBrowser ]:
- I would start with something like: find
\{\{ft\|([^}]*)}}
and replace with$1
You may have to throw in a few\s*
to catch unexpected spaces. See Regular expression and test it using the tool. Mr Stephen (talk) 21:21, 12 April 2014 (UTC)
- @Xaris333 and SiBr4: Yes, the above (
\{\{ft\|(.*)}}
→$1
) is bad. The.*
is greedy and will mess up templates later on page. Something like: \{\{\s*[fF]t\s*\|\s*([^}]*)}}
→$1
- Would work. It captures everything up to the closing "}". However, if a template is used internal to the {{ft}} the above regex will not capture the portion beyond the closing of the interior template (i.e. it will mess up). If you expect that there might be interior templates, you need a more complex regex to account for it. Although not extensively tested, this:
\{\{\s*[fF]t\s*\|\s*([^}{]*(\{\{[^}{]*}}[^}{]*)*)}}
→$1
- looks like it works. However, it does not handle issues of malformed occurances, or interior use of a single "{", etc.
- @Xaris333 and SiBr4: Yes, the above (
- @Xaris333: Please: Do not ask the same question on multiple pages at the same time. If you ask in one place and don't get an answer after some days, go ahead and ask in another place (after mentioning in the original location that you have also asked in another location). Asking in multiple places at one time is confusing, and results in much extra work for others. — Makyen (talk) 23:15, 12 April 2014 (UTC); update to reflect content moved from Wikipedia talk:AutoWikiBrowser 23:24, 12 April 2014 (UTC)
Put template with AWB
[edit]I suggest you go to the More... tab, click Enabled, enter your template, choose either Append or Prepend, pick the number of newlines, and Sort meta data after. Then make your list of talk pages that exist or don't exist, go to the Skip tab and click Don't Care and then start processing. Good luck! GoingBatty (talk) 13:45, 27 December 2013 (UTC)
Wikipedia:AutoWikiBrowser/Custom Modules
Πληροφορίες ποδοσφαιριστή
[edit]Help for a template and category (greek wikipedia)
[edit]Hello. I am asking for your help, because in local wiki couldn't find the answer. Its hard to explain but I will try.
el:Πρότυπο:Football teams. Some months ago I put a category after last } to find articles where the templates has a team is not on the list. Every works fine. Now, I put the template calling football teams inside the template Template:Infobox football biography. But now, almost all the articles are in that category el:Κατηγορία:Πρότυπο:Football teams για ομάδα που δεν υπάρχει στον κατάλογο and I can't find why. Let me give you an example:
- And now the article is in the category. But it shouldn't since all the teams are correct written.
A very small amount of articles are not it the category [3]
Any ideas? Xaris333 (talk) 03:09, 16 April 2014 (UTC)
- @Xaris333: This edit should fix it. You may need to wait for the job queue; but I did a null edit to el:Κέβιν Νόλαν and it no longer appears in el:Κατηγορία:Πρότυπο:Football teams για ομάδα που δεν υπάρχει στον κατάλογο. There are some inconsistencies within el:Πρότυπο:Πληροφορίες ποδοσφαιριστή that I have not fixed - these include the parameters
|club=
and|clubs1=
, which are aliased in three different ways:{{{σύλλογοι1|{{{clubs1|{{{σύλλογοι|{{{clubs|}}}}}}}}}}}}
- three times{{{ομάδες1|{{{clubs1|{{{ομάδες|{{{clubs|}}}}}}}}}}}}
- seven times{{{ομάδες|{{{clubs|}}}}}}
- four times
- Other parameters may be similarly affected. --Redrose64 (talk) 10:29, 16 April 2014 (UTC)
Many thanks!! Xaris333 (talk) 11:19, 16 April 2014 (UTC)
Hello.
- The problem is not solved. Only few articles left the caterory.
- What should I do with alias?
- If you see the template el:Πρότυπο:Πληροφορίες ποδοσφαιριστή there is a rectacle. Why?
Xaris333 (talk) 19:41, 16 April 2014 (UTC)
- When I first checked the category, there were well over 10,000 articles. I forget the exact figure; it may have been between 12,000 and 14,000. Now, there are 1,147 - an improvement of more than 90%.
- I don't know what to do about the aliased parameters, other than make them consistent. I don't speak Greek: the main thing to decide is whether "clubs" means "σύλλογοι" or if it means "ομάδες".
- By "rectacle", I assume that you mean "rectangle". It's the empty template; see el:Βικιπαίδεια:Πρόχειρο. --Redrose64 (talk) 20:04, 16 April 2014 (UTC)
Thx! Now are only 843 articles. I will wait untill tomorrow and I will tell you. There must be less than 100. Xaris333 (talk) 20:18, 16 April 2014 (UTC)
Hello again! May I ask you one more thing? If you don't have time, its ok... Look inside of this el:Πρότυπο:Football teams (Κατάλογος ομάδων means team list). The list it el:Πρότυπο:Football teams/Κατάλογος ομάδων. Is there a way:
- if I put the symbol → in front of the team to have →TEAM NAME ? The easy way was to write all the teams for the least again with the symbol in front of them [4]. But this is not good.
- to do the same thing with a specific word in the end of the team name (after a single space)?
Xaris333 (talk) 00:01, 17 April 2014 (UTC)
- If you're using the template directly, you could just use
→{{ft|team}}
to prepend an arrow. Within the template you could also add an "arrow" parameter and put{{#if:{{{arrow|}}}|→}}
before the {{#switch}} function, so an arrow can be added using{{ft|team|arrow=yes}}
. This is handy if you want to use the template indirectly, such as in the infobox you linked to. A more general{{{prefix}}}
parameter is also possible. - Looking at the template code, I think you want the team name with suffix to be piped to the team article. That could again be done as an additional parameter, but that will break the template on pages using the name with suffix as first parameter, putting them in the new tracking category. If that's not a problem, the syntax for the pipe link would be something like
{{#if:{{{suffix|}}} | [[Team name|Team name {{{suffix}}}]] | [[Team name]]}}
. SiBr4 (talk) 08:38, 17 April 2014 (UTC)
User:SiBr4 I have tried the second case {{#if:{{{arrow|}}}|→}}
, but it is not working. May be I wrοte it wrong. Can you edit the template or tell me how to write it? el:Πρότυπο:Football teams Xaris333 (talk) 20:38, 17 April 2014 (UTC)
- @Xaris333: The way you first added it, it should work, but it still relies on the duplicated #switch cases with arrows. With the #if part before the sub-template invocation, like you did here, the duplicate team names are not necessary (unless you expect people to still use
{{ft|→team}}
instead of the new{{ft|team|arrow=yes}}
). Could you please be more specific about what it is doing wrong? SiBr4 (talk) 21:16, 17 April 2014 (UTC)
- @SiBr4: You are right! It's working if I am using the template directly. But can it work with the template el:Πρότυπο:Πληροφορίες ποδοσφαιριστή? [5] Xaris333 (talk) 21:24, 17 April 2014 (UTC)
- If you want the infobox to always show the arrow in front of the flagicon, the parameter
|arrow=yes
should be added to the{{ft}}
template in the infobox. If the arrow shouldn't be there by default but one should be able to add it, you should use|arrow=
in order for{{{arrow|}}}
{{Πληροφορίες ποδοσφαιριστή|arrow=yes}}
to work. I don't know what the use of these arrows is in the first place, so you should decide in which cases it should be added. SiBr4 (talk) 21:40, 17 April 2014 (UTC)
- If you want the infobox to always show the arrow in front of the flagicon, the parameter
- @SiBr4: It's for the teams where the player was loaned. I want if in the template el:Πρότυπο:Πληροφορίες ποδοσφαιριστή
- OK. I just added a LOT of arrow parameters to the infobox template. Now you can add an arrow to each individual team template using
|currentclub=Team|currentclubarrow=yes
,|club1=Team|club1arrow=yes
,|youthclubs1=Team|youthclubs1arrow=yes
, etc., etc. SiBr4 (talk) 22:18, 17 April 2014 (UTC)
- OK. I just added a LOT of arrow parameters to the infobox template. Now you can add an arrow to each individual team template using
- @SiBr4: Many thanks for your time but I think in not working. [6] I think the problem is on el:Πρότυπο:Football teams. See el:Χρήστης333/Test. Xaris333 (talk) 22:59, 17 April 2014 (UTC)
- @SiBr4: Ok, I fixed it [7],
but, unfortunately, with this, the articles withs the arrow, are on the category el:Κατηγορία:Πρότυπο:Football teams για ομάδα που δεν υπάρχει στον κατάλογο. I don't want that...Xaris333 (talk) 23:04, 17 April 2014 (UTC)
- @SiBr4: Ok, I fixed it [7],
- @Xaris333: The Τραϊανός Δέλλας article doesn't show the arrow because you translated all arrow parameters into Greek. I've fixed it in that specific article by changing "clubs2arrow=yes" to "ομάδες2δανεικός=yes". SiBr4 (talk) 07:09, 18 April 2014 (UTC)
- There are a lot of pages in the tracking category because they still include the arrow in the first parameter. Such pages need to be updated to use the new parameters instead. AWB should be able to do that. SiBr4 (talk) 11:14, 18 April 2014 (UTC)
- @SiBr4: I have corrected a lot by hand. I don't know how to do it with AWB, so I will continue by hand. May I ask you something similar? I want, if I write |managerclubs1=Arsenal |managerclubs1assistantcoach=yes to show Arsenal (assistant coach). Pls explain to me how to do it, or just edit the template for managerclubs1 and I will do the rest. Xaris333 (talk) 14:36, 18 April 2014 (UTC)
That doesn't require any change to the Ft template, since you can just append text to the team with flag within the infobox. The coding depends on which parameter values you want the template to accept:
{{#ifeq:{{{managerclubs1assistantcoach|}}}|yes|(assistant coach)}}
to accept only "yes";{{#switch:{{{managerclubs1assistantcoach|}}}|yes|ναι|1=(assistant coach)}}
to accept multiple values, such as the English and Greek words for "yes" or a logical "1";{{#if:{{{managerclubs1assistantcoach|}}}|(assistant coach)}}
to accept any non-empty text, including words like "no". SiBr4 (talk) 14:54, 18 April 2014 (UTC)
@SiBr4: I prefer the first one. But I am not sure if I understand. Should I edit the el:Πρότυπο:Πληροφορίες ποδοσφαιριστή and how? And what am I going to write one the article? And I don't want the articles with (assistant coach) to be on the category el:Κατηγορία:Πρότυπο:Football teams για ομάδα που δεν υπάρχει στον κατάλογο. Xaris333 (talk) 15:18, 18 April 2014 (UTC)
- @Xaris333: I've made the change myself. The code adds the text "(assistant coach)" if the parameter value is equal to "yes", so to add the text to the infobox in an article, add the parameter
|managerclubs1assistantcoach=yes
,|managerclubs2assistantcoach=yes
, etc. Because the text is added outside the Ft template, it should not result in articles ending up in the tracking category. SiBr4 (talk) 15:34, 18 April 2014 (UTC)
@SiBr4: Thanx for everything!!! Xaris333 (talk) 17:27, 18 April 2014 (UTC)