Difference between revisions of "Issuepedia:Code/lib/links"

From Issuepedia
Jump to navigation Jump to search
(→‎ShowTopic(topic,max): renaming new function so everyone will start using it)
(ShowLinkData(): code is obsolete, but a lot of pages still use it, so let's make it a bit more... functional. [rimshot])
Line 1: Line 1:
 +
===ShowLinkData()===
 +
<func ShowLinkData>
 +
 +
<let name=wtDate>{{date|</let>
 +
<let name=wtDate append copy=data[Date] />
 +
<let name=wtDate append>}}{{datecat|</let>
 +
<let name=wtDate append copy=data[Date] />
 +
<let name=wtDate append>}}</let>
 +
<if flag=$data[Author]>
 +
LATER: make this into a function
 +
  <let name=wtAuth>[[</let>
 +
showing #1
 +
  <let name=wtAuth append copy=data[Author] />
 +
showing #2
 +
  <let name=wtAuth append>]] ([[</let>
 +
  <let name=wtAuth append copy=data[Author] />
 +
  <let name=wtAuth append>/writings|writings]]<sub>[[:category:</let>
 +
  <let name=wtAuth append copy=data[Author] />
 +
  <let name=wtAuth append>/writings|cat]]</sub>)</let>
 +
 +
  <let name=wtAuthCat>[[category:</let>
 +
  <let name=wtAuthCat append copy=data[Author] />
 +
  <let name=wtAuthCat append>/writings]]</let>
 +
</if>
 +
 +
<if flag=$data[Authors]>
 +
  <let name=auths copy=data[Authors] />
 +
  <let name=wtAuthCat null />
 +
  <for xps=$auths let=author>
 +
    <let name=wtAuth append> [[</let>
 +
    <let name=wtAuth append copy=author />
 +
    <let name=wtAuth append>]] ([[</let>
 +
    <let name=wtAuth append copy=author />
 +
    <let name=wtAuth append>/writings|writings]]<sub>[[:category:</let>
 +
    <let name=wtAuth append copy=author />
 +
    <let name=wtAuth append>/writings|cat]]</sub>)</let>
 +
 +
    <let name=wtAuthCat append>[[category:</let>
 +
    <let name=wtAuthCat append copy=author />
 +
    <let name=wtAuthCat append>/writings]]</let>
 +
  </for>
 +
</if>
 +
<if flag=$data[Source]>
 +
  <let name=wtSource>[[</let>
 +
  <let name=wtSource append copy=data[Source] />
 +
  <let name=wtSource append>]] ([[</let>
 +
  <let name=wtSource append copy=data[Source] />
 +
  <let name=wtSource append>/articles|articles]]<sub>[[:category:</let>
 +
  <let name=wtSource append copy=data[Source] />
 +
  <let name=wtSource append>/articles|cat]]</sub>)</let>
 +
</if>
 +
 +
<if flag=$docat>
 +
  <let name=wtDate append>[[category:</let>
 +
  <let name=wtDate append copy=data[Date] />
 +
  <let name=wtDate append>]]</let>
 +
 +
  <let name=wtAuth append copy=wtAuthCat />
 +
 +
  <let name=wtSource append>[[category:</let>
 +
  <let name=wtSource append copy=data[Source] />
 +
  <let name=wtSource append>/articles]]</let>
 +
</if>
 +
 +
Store data in page properties:
 +
<let name=data self save />
 +
 +
<let name=wtTitle>__NOEDITSECTION__
 +
==</let>
 +
<let name=wtTitle append copy=data[Title] />
 +
<let name=wtTitle append>==</let>
 +
<if flag=$data[TextShort]>
 +
  <let name=wtTitle append>
 +
===longer text===</let>
 +
  <let name=wtTextShort>
 +
===shorter text===
 +
</let>
 +
  <let name=wtTextShort append copy=data[TextShort] />
 +
</if><else>
 +
  <let name=wtTextShort />
 +
</else>
 +
 +
<if flag=$data[wpage]>
 +
  <let name=wtLink>[[</let>
 +
  <let name=wtLink append copy=data[wpage] />
 +
  <let name=wtLink append>]]</let>
 +
</if><else>
 +
  <let name=wtLink append copy=data[URL] />
 +
</else>
 +
<let name=topics copy=data[Topics] />
 +
<for xps=$topics let=topic>
 +
  <let name=wtTopics append> [[</let>
 +
  <let name=wtTopics append copy=topic />
 +
  <let name=wtTopics append>]]</let>
 +
 +
  <let name=wtCatgs append> [[:category:</let>
 +
  <let name=wtCatgs append copy=topic />
 +
  <let name=wtCatgs append>|</let>
 +
  <let name=wtCatgs append copy=topic />
 +
  <let name=wtCatgs append>]]</let>
 +
 +
  <if flag=$docat>
 +
    <let name=wtCatgs append> [[category:</let>
 +
    <let name=wtCatgs append copy=topic />
 +
    <let name=wtCatgs append>]]</let>
 +
  </if>
 +
</for>
 +
 +
 +
<if flag=$data[TitlePlain]>
 +
  <let name=TitleSort copy=data[TitlePlain] />
 +
</if><else>
 +
  <let name=TitleSort copy=data[Title] />
 +
</else>
 +
<if flag=$docat>
 +
  <let name=cattag>[[category:data/links|</let>
 +
  <let name=cattag append copy=TitleSort />
 +
  <let name=cattag append>]]</let>
 +
</if>
 +
 +
<let name=display>
 +
{|
 +
|-
 +
| align=right | '''Date''': || <get name=wtDate />
 +
|-
 +
| align=right | '''Link''': || <get name=wtLink />
 +
</let>
 +
 +
<if flag=$wtAuth>
 +
  <let name=display append>
 +
|-
 +
| align=right | '''Author''': || <get name=wtAuth /></let>
 +
</if>
 +
<if flag=$wtSource>
 +
  <let name=display append>
 +
|-
 +
| align=right | '''Source''': || <get name=wtSource /></let>
 +
</if>
 +
<let name=display append>
 +
|-
 +
| align=right | '''Topics''': || <get name=wtTopics />
 +
|-
 +
| align=right | '''Categories''': || <get name=wtCatgs />
 +
|}
 +
[[page type::link]]
 +
</let>
 +
<echo>
 +
__NOEDITSECTION__
 +
==Specs==
 +
<get name=display />
 +
<get name=wtTitle />
 +
<get name=data index=Text /><get name=wtTextShort /><get name=cattag /><hide>
 +
<let name=wtDate null />
 +
<let name=wtAuth null />
 +
<let name=wtSource null />
 +
<let name=wtTopics null />
 +
<let name=wtCatgs null />
 +
</echo>
 +
</func>
 
===GetBrief()===
 
===GetBrief()===
 
<func GetBrief>
 
<func GetBrief>

Revision as of 22:10, 2 August 2012

ShowLinkData()


> function showlinkdata() <= ()

GetBrief()


> function getbrief() <= ()

ShowRecent()


> function showrecent() <= ()

ShowTopic_old(iTopic,iMax)


> function showtopic_old() <= ()

ShowTopic_old(topic,max)

This can be deleted if there are no problems with new ShowTopic().
> function showtopic_old() <= ()

ShowTopic(topic,max)


> function showtopic() <= ()