Difference between revisions of "User:Aeric/tests"

From AgileApps Support Wiki
imported>Aeric
Β 
imported>Aeric
Β 
(10 intermediate revisions by the same user not shown)
Line 2: Line 2:


''See also:''
''See also:''
:* [[User:Aeric/notes]]
:* [{{SERVER}}/{{SCRIPTPATH}}/wiki_tests.php {{SCRIPTPATH}}/wiki_tests.php]
:* [{{SERVER}}/{{SCRIPTPATH}}/wiki_tests.php {{SCRIPTPATH}}/wiki_tests.php]
==Insert a Category Tree==
Use this for a category page:
:<tt><nowiki>{{CategoryContents}}</nowiki></tt>
Use this for a specific category:
:<tt><nowiki>{{#categorytree:Help|hideroot|mode=all|depth=1}}</nowiki></tt>
: mode=all, categories, pages
: depth=initial display depth
:Options: http://www.mediawiki.org/wiki/Extension:CategoryTree
Blockquoted result:
<blockquote>
{{#categorytree:Help|hideroot|mode=all|depth=1}}
</blockquote>


==Magic Words for Links ==
==Magic Words for Links ==
Line 16: Line 30:
|}
|}


==Negative Conditionals==
==Variables==
Goal: In all but ISV domain, show this text: "This page contains information for ISVs".
{{Variables}}
Β 
This would work, but dang, it's ugly:
<pre>
Β  Β  {{#if: {{#expr ^({{skin}}=ISV)}}|This page contains information for ISVs.
Β  Β  |...}}
</pre>
Β 
So instead of doing that, we defined ShowIsvInfo, so that actual page content is shown only in the ISV domain. (Note that the ending-braces should immediately follow the text, to prevent double-spacing if the page is transcluded. Here, they are on a separate line, for readability.)
Β 
;Code:
:<tt><nowiki>{{#if: {{#expr ^({{skin}}=ISV)}}</nowiki></tt><br>
:<tt><nowiki>|Information on this page is intended for ISVs.</nowiki></tt><br>
:<tt><nowiki>|...}}</nowiki></tt>
Β 
;Analysis:
:It works, but as shown above the resulting code is both ugly and unreadable.
:Much better to define a <tt>HideIsvInfo</tt> variable, and simplify the code
to:
:<tt><nowiki>{{#if: {{HideIsvInfo}}</nowiki></tt><br>
:<tt><nowiki>|Information on this page is intended for ISVs.</nowiki></tt><br>
:<tt><nowiki>|...}}</nowiki></tt>
Β 
WRT defining domain names:
:* [[Template:ISV]] is the name of the template that displays the ISV-specific nav bar.
:* [[Template:LJ]] is the nav bar that is displayed everywhere else
:* So we can't define an "ISV" variable, unless we want to rename the nav-bar template.
:* And we don't want to use <tt><nowiki>{{domain}}</nowiki></tt>, because {domain} is used in URLs all over the Wiki, and it's too easy to make a mistake.
:* So we could use <tt><nowiki>{{skin}}</nowiki></tt>, if and when we want a skin-specific conditional. (But we should only use it for positive tests. As the code above shows, negative tests are unreadable.)
:* Clearly, one place we could use it are for the ''links'' to ISV pages. Then we can code
::<tt><nowiki>{{#ifeq: {{skin}}|ISV|...}}</nowiki></tt><br>
:* '''Alternatively, we could code ''also'' define <tt>ShowIsvInfo</tt>, and then automatically set <tt>HideIsvInfo</tt> to not-<tt>ShowIsvInfo</tt> in <tt>LocalSettings.php</tt>.'''<br>(We should do that for each of the Show variables, just to be consistent.)
Β 
==Skin-Specific Variables==
{{Skin-specific Variables}}


==Variablized Link==
==Variablized Link==

Latest revision as of 00:36, 17 April 2014

Tests.

See also:

Insert a Category Tree

Use this for a category page:

{{CategoryContents}}

Use this for a specific category:

{{#categorytree:Help|hideroot|mode=all|depth=1}}
mode=all, categories, pages
depth=initial display depth
Options: http://www.mediawiki.org/wiki/Extension:CategoryTree

Blockquoted result:

Magic Words for Links

Server ({{SERVER}}) https://agileappscloud.info
Script path ({{SCRIPTPATH}}) /aawiki-src
Hardcoded path http://lj.platformatyourservice.com/wiki/download
Variablized path
({{SERVER}}{{SCRIPTPATH}}/download)
https://agileappscloud.info/aawiki-src/download

Variables

These variables are defined for each skin in LocalSettings.php.
They are case-insensitive.

Global Variables

Application names (because marketing can change them):

Variable Definition Value in Current Domain Usage
HD name of the "HelpDesk" application ServiceDesk {{HD}}

Version Variables

Variable Value
{{MySqlVersion}} 5.5
{{VelocityVersion}} 1.7

Skin-Specific Variables

Variable Name Definition Value in Current Domain Usage
Skin Abbreviated name HD {{#if {{Skin}}|name|...|...else...}}
Domain Used in the platformURL template {yourDomain} Create platform links using {{platformURL}}, instead of https://...
platformURL Template:platformURL
Link used to access the platform
https://{yourDomain}/networking {{platformURL}}
BrandLabel Label used in plugin GUIs
(Eclipse, Outlook,...)
LongJump {{BrandLabel}}
EnterpriseBrand Name of the platform AgileApps Cloud platform {{EnterpriseBrand}}
BrandName Template:BrandName
Advertised brand
AgileApps Cloud {{BrandName}}
TrainingLink A link for training sessions. {{#if {{TrainingLink}} | [{{TrainingLink}} Platform Training]}}
WhitepapersLink Future. Defined the same way as "TrainingLink", so it is easy to change.
 
Booleans
ShowWhitepapers Show whitepapers? (empty=false)
(Fixed branding)
{{#if {{ShowWhitepapers}} | ...}}
ShowOutlookSync Show info related to Outlook Sync & Email Edition Plugin? (empty=false) {{#if {{ShowOutlookSync}} | ...}}
ShowIsvInfo Show info only ISVs care about (empty=false) {{#if {{ShowIsvInfo}} | ...}}
ShowMspInfo Show info only MSPs care about (empty=false) {{#if {{ShowMspInfo}} | ...}}
PlatformAdminInfo Show tenant configuration true (empty=false) {{#if {{PlatformAdminInfo}} | ...}}
ShowInstallInfo Show info for installers true (empty=false) {{#if {{ShowInstallInfo}} | ...}}

Variable Combinations

Use this pattern to conditionalize information intended for all Service Providers (both ISVs and MSPs):
{{#if: {{ShowIsvInfo}} {{ShowMspInfo}} |
__Info for all Service Providers (LJ and ISV domains)__
}}

Notepad.png

Note: Information intended for both is generally conditioned using ShowIsvInfo--whether or not that was a wise choice remains TBD. So the combination above isn't strictly necessary.

Use this pattern if it is necessary to distinguish information intended for ISVs (which may mention MSPs) from information intended for MSPs, in Wiki versions that do not include ISV info (e.g. Relationals):
{{#if: {{ShowIsvInfo}} |
__ISV info (ISV DOMAIN) __

| <!-- HideIsvInfo -->
{{#if: {{ShowMspInfo}} |
__MSP info (LJ DOMAIN)__
}}}}

Variablized Link

  • TrainingLink is used [ here].
  • Conditional link: DNE

Nested Conditionals

Test of nested conditionals. Display site prefix: LJ

Style for Rollovers

Original TEST of rollover help. New  TEST  of rollover.

CSS Styles

Original

  <span title="Rollover text to display" 
        class="terminologydef" style="cursor:help">TEST</span>
  of rollover help.
  where:
     cursor:help style = built-in HTML style attribute for rollover
     terminologydef class =  
        .terminologydef {border-bottom: 1px dashed green;}
      --defined in terminology.php, which puts the css definition into the page
      --or place desired definition in MediaWiki:Common.css

New

  • HTML code
<span title="Rollover text to display" 
      class="rollover" style="cursor:help"> TEST </span> 
of rollover help.
  • Added to MediaWiki:Common.css
.rollover {
  border-top:    1px solid blue; 
  border-bottom: 1px solid blue; 
  border-left:   1px solid blue; 
  border-right:  1px solid blue; 
  background:    yellow;
}

Conditional Category Test

  • Category tags can be conditionalized with the #if of #ifeq test.
  • This page has:
    • A category that always appears (the unconditionalized category)
    • A category that only appears when ShowWhitepapers is true,, using #if.
    • A category that only appears in the ISV domain, using #ifeq.

So:

Domain Categories
LJ 2 categories (whitepapers & unconditional)
ISV 2 categories (ISV & unconditional)
CUSTOM 1 category (unconditional)

Code:

{{#if: {{ShowWhitepapers}} | [[Category:Conditional Whitepapers Category]] }}
{{#ifeq: {{EnterpriseBrand}} | Platform | [[Category:Conditional ISV Category]] }}
[[Category:Unconditional Category]]

Categories:

  • No whitepapers category
  • No ISV category