User:Johan G/Template:Informative template with preloaded text: Difference between revisions

Jump to navigation Jump to search
m
Intermediate save. Sketching out better logic
(*Intermediate break* trying to get correct parts rendering in correct circumstance and setting up error messages to help users troubleshoot)
m (Intermediate save. Sketching out better logic)
Line 8: Line 8:


-->
-->
  <nowiki>1 is not empty
  <nowiki>1 and doc is empty and /doc do not exist
  use 1
    1 is not empty
  doc is empty
        use 1
    /doc exist
     doc is not empty
      use /doc
        /doc exist and doc is not /doc
    /doc do not exist
          trow error
  doc is not empty
        use doc
    doc point to /doc
       else
      use doc
        /doc exist
     doc do not point to /doc
          use /doc
      use doc
  else
      throw error
    encourage writing /doc</nowiki></noinclude><includeonly>
1 is empty
  doc is empty
    /doc exist
      use /doc
    /doc do not exist
      encourage writing doc
  doc is not empty
    doc point to /doc
      use doc
    doc do not point to /doc
      use doc
       throw error</nowiki>
 
<nowiki>[[{{FULLPAGENAME}}/doc]]</nowiki>
[[{{FULLPAGENAME}}/doc]]
 
<nowiki>{{#ifexist: {{{doc|-{{FULLPAGENAME}}/doc}}} <!-- Does /doc or page in doc exist? -->
| Yes, /doc or page in doc exist
yes
| No, /doc or page in doc does not exist
no
}}</nowiki>
{{#ifexist: {{{doc|-{{FULLPAGENAME}}/doc}}}
|
yes
|
no
}}
 
<nowiki>{{#ifeq: {{{doc|-{{FULLPAGENAME}}/doc}}} | {{FULLPAGENAME}}/doc <!-- If defined, does doc point to /doc? -->
|
equal
|
{{error|Page '''{{FULLPAGENAME}}/doc''' exist, but parameter '''doc''' points to '''{{{doc}}}'''|User:Johan G/Template:Informative template with preloaded text}}
}}</nowiki>
{{#ifeq: {{{doc|-{{FULLPAGENAME}}/doc}}} | {{FULLPAGENAME}}/doc
|
equal
|
{{error|Page '''{{FULLPAGENAME}}/doc''' exist, but parameter '''doc''' points to '''{{{doc}}}'''|User:Johan G/Template:Informative template with preloaded text}}
}}
 
</noinclude><includeonly>
__NOEDITSECTION__
__NOEDITSECTION__
__NOTOC__
__NOTOC__

Navigation menu