Skip to content

Commit c65efe3

Browse files
committed
Some logic updates
1 parent 4584c84 commit c65efe3

1 file changed

Lines changed: 22 additions & 8 deletions

File tree

src/templates/pages/plugins.txp

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ if (!empty($json2['legacy'])) {
180180
},
181181
"softwareVersion": "<txp:variable name="json-beta-version" escape="json" />",
182182
<txp:if_variable name="json-beta-date">"datePublished": "<txp:variable name="json-beta-date" escape="json" />",</txp:if_variable>
183-
"downloadUrl": "<txp:if_variable name="json-beta-php"><txp:variable name="json-beta-php" escape="json" /><txp:else /><txp:variable name="json-beta-txt" escape="json" /></txp:if_variable>"
183+
"downloadUrl": "<txp:if_variable name="json-beta-txt"><txp:variable name="json-beta-txt" escape="json" /><txp:else /><txp:variable name="json-beta-php" escape="json" /></txp:if_variable>"
184184
}
185185
},
186186
</txp:if_variable>
@@ -202,7 +202,7 @@ if (!empty($json2['legacy'])) {
202202
},
203203
"softwareVersion": "<txp:if_variable name="json-stable-version"><txp:variable name="json-stable-version" escape="json" /><txp:else /><txp:variable name="json-beta-version" escape="json" /></txp:if_variable>",
204204
<txp:if_variable name="json-stable-version"><txp:if_variable name="json-stable-date">"datePublished": "<txp:variable name="json-stable-date" escape="json" />",</txp:if_variable><txp:else /><txp:if_variable name="json-beta-date">"datePublished": "<txp:variable name="json-beta-date" escape="json" />",</txp:if_variable></txp:if_variable>
205-
<txp:if_variable name="json-stable-version">"downloadUrl": "<txp:if_variable name="json-stable-php"><txp:variable name="json-stable-php" escape="json" /><txp:else /><txp:variable name="json-stable-txt" escape="json" /></txp:if_variable>"<txp:else />"downloadUrl": "<txp:if_variable name="json-beta-php"><txp:variable name="json-beta-php" escape="json" /><txp:else /><txp:variable name="json-beta-txt" escape="json" /></txp:if_variable>"</txp:if_variable>
205+
<txp:if_variable name="json-stable-version">"downloadUrl": "<txp:if_variable name="json-stable-txt"><txp:variable name="json-stable-txt" escape="json" /><txp:else /><txp:variable name="json-stable-php" escape="json" /></txp:if_variable>"<txp:else />"downloadUrl": "<txp:if_variable name="json-beta-txt"><txp:variable name="json-beta-txt" escape="json" /><txp:else /><txp:variable name="json-beta-php" escape="json" /></txp:if_variable>"</txp:if_variable>
206206
}
207207
}
208208
}
@@ -312,8 +312,8 @@ if (!empty($json2['legacy'])) {
312312
<dd>Release date: <time><txp:variable name="json-beta-date" /></time></dd>
313313
</txp:if_variable>
314314
<dd><p class="link-group">
315-
<txp:if_variable name="json-beta-txt"><a class="button button-primary" href="<txp:variable name="json-beta-txt" />">TXT download</a></txp:if_variable>
316-
<txp:if_variable name="json-beta-php"><a<txp:if_variable not name="json-beta-txt"> class="button button-primary"</txp:if_variable> href="<txp:variable name="json-beta-php" />">PHP download</a></txp:if_variable>
315+
<txp:if_variable name="json-beta-txt"><txp:variable name="txt-plugin" value="1" /><a class="button button-primary" href="<txp:variable name="json-beta-txt" />">TXT download</a></txp:if_variable>
316+
<txp:if_variable name="json-beta-php"><txp:variable name="php-plugin" value="1" /><a<txp:if_variable not name="json-beta-txt"> class="button button-primary"</txp:if_variable> href="<txp:variable name="json-beta-php" />">PHP download</a></txp:if_variable>
317317
</p></dd>
318318
</txp:if_variable>
319319
<txp:if_variable name="json-stable-version">
@@ -322,17 +322,17 @@ if (!empty($json2['legacy'])) {
322322
<dd>Release date: <time><txp:variable name="json-stable-date" /></time></dd>
323323
</txp:if_variable>
324324
<dd><p class="link-group">
325-
<txp:if_variable name="json-stable-txt"><a class="button button-primary" href="<txp:variable name="json-stable-txt" />">TXT download</a></txp:if_variable>
326-
<txp:if_variable name="json-stable-php"><a<txp:if_variable not name="json-stable-txt"> class="button button-primary"</txp:if_variable> href="<txp:variable name="json-stable-php" />">PHP download</a></txp:if_variable>
325+
<txp:if_variable name="json-stable-txt"><txp:variable name="txt-plugin" value="1" /><a class="button button-primary" href="<txp:variable name="json-stable-txt" />">TXT download</a></txp:if_variable>
326+
<txp:if_variable name="json-stable-php"><txp:variable name="php-plugin" value="1" /><a<txp:if_variable not name="json-stable-txt"> class="button button-primary"</txp:if_variable> href="<txp:variable name="json-stable-php" />">PHP download</a></txp:if_variable>
327327
</p></dd>
328328
<txp:else />
329329
<dt><txp:variable name="json-name" /> <txp:variable name="json-beta-version" /> <small class="alert-block alert-pill warning">Prerelease</small></dt>
330330
<txp:if_variable name="json-beta-date">
331331
<dd>Release date: <time><txp:variable name="json-beta-date" /></time></dd>
332332
</txp:if_variable>
333333
<dd><p class="link-group">
334-
<txp:if_variable name="json-beta-txt"><a class="button button-primary" href="<txp:variable name="json-beta-txt" />">TXT download</a></txp:if_variable>
335-
<txp:if_variable name="json-beta-php"><a<txp:if_variable not name="json-beta-txt"> class="button button-primary"</txp:if_variable> href="<txp:variable name="json-beta-php" />">PHP download</a></txp:if_variable>
334+
<txp:if_variable name="json-beta-txt"><txp:variable name="txt-plugin" value="1" /><a class="button button-primary" href="<txp:variable name="json-beta-txt" />">TXT download</a></txp:if_variable>
335+
<txp:if_variable name="json-beta-php"><txp:variable name="php-plugin" value="1" /><a<txp:if_variable not name="json-beta-txt"> class="button button-primary"</txp:if_variable> href="<txp:variable name="json-beta-php" />">PHP download</a></txp:if_variable>
336336
</p></dd>
337337
</txp:if_variable>
338338
<txp:php>
@@ -353,10 +353,13 @@ if (!empty($json->legacy)) {
353353
echo '<dd><p class="link-group">';
354354

355355
if (!empty($legacy->downloadUrlTxt)) {
356+
parse('<txp:variable name="txt-plugin" value="1" />');
356357
echo n.href('TXT download', txpspecialchars($legacy->downloadUrlTxt), array('class' => 'button button-primary'));
357358
}
358359

359360
if (!empty($legacy->downloadUrlPhp)) {
361+
parse('<txp:variable name="php-plugin" value="1" />');
362+
360363
if (!empty($legacy->downloadUrlTxt)) {
361364
echo n.href('PHP download', txpspecialchars($legacy->downloadUrlPhp));
362365
} else {
@@ -371,6 +374,17 @@ if (!empty($json->legacy)) {
371374
</txp:php>
372375
</dl>
373376
</txp:if_variable>
377+
<txp:evaluate>
378+
<h3 id="installation">Installation instructions</h3>
379+
<txp:if_variable name="txt-plugin">
380+
<h4>How to install a TXT-format Textpattern plugin</h4>
381+
<p>TODO</p>
382+
</txp:if_variable>
383+
<txp:if_variable name="php-plugin">
384+
<h4>How to install a PHP-format Textpattern plugin</h4>
385+
<p>TODO</p>
386+
</txp:if_variable>
387+
</txp:evaluate>
374388
<p class="alert-block information footnote report-issues">If you notice any kind of problem with this page’s construction or content (plugin doesn’t work as stated, outdated information, typos, broken links, or whatever), <a rel="external" target="_blank" href="https://github.com/textpattern/textpattern-curated-plugins-list/issues/new/choose">open an issue</a> and we’ll investigate.</p>
375389
</article>
376390
<section class="layout-4col sidebar">

0 commit comments

Comments
 (0)