Thread: Mediawiki syntax cleanup.
i'm rather new mediawiki syntax, , i'm sure there easier way accomplish trying do.
basically, want include template on many different pages layout remains consistant, , maintenance easier.
have attached screenshot showing how final result should look. code below work fine, very... unreadable.
(i have added indentation make bit more readable, on actual wiki left aligned works properly. also, installed parserfunctions extension #if)code:{{#if: {{{9|}}} | * '''[[{{{1}}}]]''' ** {{{2}}} *** {{{3}}} ** {{{4}}} *** {{{5}}} ** {{{6}}} *** {{{7}}} ** {{{8}}} *** {{{9}}} | {{#if: {{{7|}}} | * '''[[{{{1}}}]]''' ** {{{2}}} *** {{{3}}} ** {{{4}}} *** {{{5}}} ** {{{6}}} *** {{{7}}} | {{#if: {{{5|}}} | * '''[[{{{1}}}]]''' ** {{{2}}} *** {{{3}}} ** {{{4}}} *** {{{5}}} | * '''[[{{{1}}}]]''' ** {{{2}}} *** {{{3}}} }} }} }}
is, can call template (dose) with:
the point is, each page have different number of ranges, 1 4. using #if statement allows me display appropriate number of ranges, depending on how many pass template.code:{{dose|one|range1|dose1}} or... {{dose|four|range1|dose1|range2|dose2|range3|dose3|range4|dose4}}
there way clean code, or maybe approach problem different angle? i'm new mediawiki have little bit of programming experience (mostly python).
help!![]()
i have not tried myself use loop extension mediawiki use loop. way, can loop 9 1 , check if exist.
i'm not sure mediawiki code should there's pattern in there abstract out.
Forum The Ubuntu Forum Community Ubuntu Specialised Support Development & Programming Programming Talk [SOLVED] Mediawiki syntax cleanup.
Ubuntu
Comments
Post a Comment