Skip to content

Commit

Permalink
republish 2.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
alxndr-w committed May 9, 2021
1 parent 7509999 commit 623270d
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 19 deletions.
2 changes: 2 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
CC BY-NC-SA 4.0

# Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0)

This is a human-readable summary of (and not a substitute for) the license: https://creativecommons.org/licenses/by-nc-sa/4.0/
Expand Down
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# FAQ / Fragen und Antworten für REDAXO 5.10 & YForm 3.4

Mit diesem Addon können FAQ-Bereiche sowie generelle Fragen & Antworten eingegeben und verwaltet werden. Kostenlos für nicht-kommerzielle Projekte (CC BY-NC-SA 4.0). Bitte bei Fragen zur Lizenz und Nutzung qanda@marketing-nach-plan.de anfragen.
Mit diesem Addon können FAQ-Bereiche sowie generelle Fragen & Antworten eingegeben und verwaltet werden. Kostenlos für nicht-kommerzielle Projekte (CC BY-NC-SA 4.0). Bitte bei Fragen zur Lizenz und Nutzung qanda@alexplus.de anfragen.

## Features

Expand Down
30 changes: 16 additions & 14 deletions fragments/qanda.json-ld.php
Original file line number Diff line number Diff line change
@@ -1,23 +1,25 @@
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "QAPage",
"mainEntity": {
"@type": "Question",
"name": "<?= $this->question->getQuestion(); ?>",
"answerCount": 1,
"@type": "Question",
"name": "<?= $this->question->getQuestion(); ?>",
"text": "<?= $this->question->getQuestion(); ?>",
"answerCount": 1,
"dateCreated": "<?= $this->question->getValue('createdate') ?>",
"author": {
"@type": "Person",
"name": "<?= $this->question->getAuthor(); ?>"
},
"acceptedAnswer": {
"@type": "Answer",
"text": "<?= $this->question->getAnswerAsPlaintext(); ?>",
"upvoteCount": 0,
"url": "<?= $this->question->getUrl() ?>",
"dateCreated": "<?= $this->question->getValue('updatedate') ?>",
"author": {
"@type": "Person",
"name": "<?= $this->question->getAuthor(); ?>"
},
"acceptedAnswer": {
"@type": "Answer",
"text": "<?= $this->question->getAnswerAsPlaintext(); ?>",
"author": {
"@type": "Person",
"name": "<?= $this->question->getAuthor(); ?>"
}
}
}
}
</script>
</script>
10 changes: 9 additions & 1 deletion lib/qanda.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,14 @@ public function getCategory()
$this->category = $this->getRelatedDataset('category_ids');
return $this->category;
}
public function getCategories()
{
return $this->getRelatedCollection('category_ids');
}

public function getAnswerAsPlaintext() :string
{
return strip_tags($this->getValue("question"));
return strip_tags($this->getValue("answer"));
}

public function getQuestion()
Expand All @@ -26,6 +30,10 @@ public function getAuthor()
{
return $this->getValue("author");
}
public function getUrl()
{
return $this->getValue("url");
}
public function showJsonLd($question)
{
$fragment = new rex_fragment;
Expand Down
10 changes: 7 additions & 3 deletions package.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# Natürlich, du kannst einfach Autor und Addon-Name ändern,
# schon ist es dein Add-On. Möchtest du nicht lieber
# stattdessen den Entwickler unterstützen?
# https://alexplusde.github.io/qanda/
package: qanda
version: '2.0.0'
author: 'Alexander Walther für MARKETING NACH PLAN'
version: '2.0.1'
author: 'Alexander Walther'
supportpage: https://alexplusde.github.io/qanda/
load: late

Expand Down Expand Up @@ -52,4 +56,4 @@ pages:
perm: qanda[docs]

default_config:
editor: 'class="form-control cke5-editor" data-lang="de" data-profile="default"'
editor: 'class="form-control cke5-editor" data-lang="de" data-profile="default"'

0 comments on commit 623270d

Please sign in to comment.