Documentation

This function renders a view for a wiki topic, showing its title and the summary line.

Parameters

  • OBJECT: the topic to render the view for, defaults to %BASEWEB%.%BASETOPIC%
  • TITLE_PREFIX: optional string put before the topic title. see RenderWikiTopicView
  • TITLE_EXTRA: optional addition to the topic title. see RenderWikiTopicView
  • TITLE_FIELDS: fields that make up the title aera, defaults to TopicTitle, Summary
  • DISPLAYREVISIONINFO: boolean flag to switch on/off revinfo
  • EDITABLE: boolean flag switching on/off inline editing, defaults to on

Implementation

%STARTINCLUDE%<noautolink>%DBCALL{"%WEB%.%TOPIC%" 
   OBJECT="%OBJECT{default="%BASEWEB%.%BASETOPIC%"}%"
   section="title"
}%%IF{"'%DISPLAYREVISIONINFO{default="on"}%'='on'"
   then="<span class='foswikiRevision'>$percntDBCALL{\"%WEB%.%TOPIC%\" 
         OBJECT=\"%OBJECT{default="%BASEWEB%.%BASETOPIC%"}%\" 
         section=\"revinfo\"
      }$percnt</span>"
}%</noautolink>%DEPRECATED%%STOPINCLUDE%

title

%STARTSECTION{"title"}%<h1 itemprop='headline' class='inlineEditor inlineTitleEditor'>%IF{
   "defined TITLE_PREFIX and not isempty TITLE_PREFIX"
   then="<span class='foswikiTopicPrefix'>%TITLE_PREFIX%</span>"
}%
%RENDERFORDISPLAY{
   topic="%OBJECT%"
   fields="%TITLE_FIELDS{default="TopicTitle,Summary"}%"
   TopicTitle_default="%DBQUERY{topic="%OBJECT%" format="$topic"}%"
   editable="%EDITABLE{default="%IF{
      "'%RENDERFORMDEF{
         topic="%OBJECT%"
         fields="%TITLE_FIELDS{default="TopicTitle,Summary"}%"
         includetype="text"
         format="$type"
      }%'=~'^(text)+$'"
      then="on"
      else="off"
   }%"}%"
   excludeattr=""
   hideempty="on"
   format="<div class='$name'><span itemprop='name' class='inlineEditValue' data-formfield='$name' data-default='$default' data-format='$edit'>[[%OBJECT{default="%BASEWEB%.%BASETOPIC%"}%][$value]]  $editicon</span> %IF{
         "defined TITLE_EXTRA and not isempty TITLE_EXTRA" 
         then="<span class='foswikiTopicExtra'>%TITLE_EXTRA%</span>"
      }%</div>"
   Summary_format="<div class='$name'><div class='foswikiTopicSummary inlineEditValue' data-formfield='$name' data-format='$edit'>$value $editicon</div></div>"
}%
</h1>%DEPRECATED%%ENDSECTION{"title"}%

Revision Info

%STARTSECTION{"revinfo"}%<span class='foswikiRevisionDate'>%JQICON{"fa-calendar"}%
      %REVINFO{
         "<a href='%SCRIPTURLPATH{"diff"}%/$web/$topic?rev=%CURREV{topic="%OBJECT%"}%'>
            <span itemprop='dateModified' content='$iso'>$date - $hour:$min</span>
         </a>" 
         rev="%IF{"%NATMAXREV%!=%CURREV%" then="%CURREV%"}%" topic="%OBJECT%"
      }%
  </span>
  <span class='foswikiRevisionSep'>&#124;</span>
  <span class='foswikiRevisionID'>
   %JQICON{"fa-flag"}%
   %TRANSLATE{"Version [_1]" args="%REVINFO{"<span itemprop='version'>$rev</span>" rev="%IF{"%NATMAXREV%!=%CURREV%" then="%CURREV%"}%" topic="%OBJECT%"}%"}%
  </span>
  <span class='foswikiRevisionSep'>&#124;</span>
  <span class='foswikiRevisionAuthor' itemprop='author'>
   %JQICON{"fa-user"}%
   %REVINFO{
      "$percntIF{
         \"istopic '$wikiusername'\"
         then=\"<a href='$percntSCRIPTURLPATH{\"view\" topic=\"$wikiusername\"}$percnt' itemprop='name' class='foswikiUserField' data-wiki-name='$wikiname'>$percntGETTOPICTITLE{\"$wikiusername\"}$percnt</a>\"
         else=\"<nop>$wikiname\"
      }$percnt"
      rev="%IF{"%NATMAXREV%!=%CURREV%" then="%CURREV%"}%" 
      topic="%OBJECT%"
   }%
  </span> 
  %IF{"context LikePluginEnabled" 
   then="$percntLIKE{ 
            topic=\"%OBJECT%\" 
            format=\"<span class='foswikiRevisionSep'>&#124;</span> <div class='jqLike jqLikeSimple %editable%' %params% style='margin:0'>%like%</div>\" 
            likelabel=\"\" 
            likeicon=\"fa-thumbs-o-up\" 
            hidenull=\"on\" 
         }$percnt" 
  }%<!-- -->%DEPRECATED%%ENDSECTION{"revinfo"}%

Test

RenderWikiTopicView (approved)
(deprecated)

28 January 2025 - 12:24 | Version 1 |

Calls to 'RenderWikiTopicView'

Copyright

© 2006-2019 Michael Daum http://michaeldaumconsulting.com

This file is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. For more details read the LICENSE.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY, to the extent permitted by law; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding arbeitsgruppe.ch? Send feedback