bS Reply #1, 5 years, 5 months ago
Need comments in XML format?
Demo: source | xml
You can use technique to make comments available as a feed or to create some sort of AJAX implementation of Jot.
Here's how to do this:
1. Create a new chunk: JotTplXML This is just one example of a format but you can customize the format any way you want.. just be sure to use :esc in the user edited content placeholders to escape all html tags else the xml will choke.
2. Create a new chunk: JotXML You can enter the docid as a static value or you can use a snippet that takes a querystring id to create a dynamic source document. You can also add tag id if you want)
3. Create a new document
- Set the Content Type to: text/xml - In the document content field enter: {{JotXML}}
View the page
Demo: source | xml
You can use technique to make comments available as a feed or to create some sort of AJAX implementation of Jot.
Here's how to do this:
1. Create a new chunk: JotTplXML This is just one example of a format but you can customize the format any way you want.. just be sure to use :esc in the user edited content placeholders to escape all html tags else the xml will choke.
[+comment.published:is=`1`:then=` <comment id="[+comment.id+]" postnr="[+comment.postnumber+]" createdon="[+comment.createdon:date=`%B %d, %Y, %H:%M:%S`+]" editedon="[+comment.editedon:date=`%B %d, %Y, %H:%M:%S`+]" createdby="[+comment.createdby+]" editedby="[+comment.editedby+]"> <user postcount="[+comment.userpostcount+]"> [+comment.createdby:userinfo=`username`:ifempty=`[+comment.custom.name:ifempty=`[+jot.guestname+]`+]`:esc+] </user> <subject>[+comment.title:esc+]</subject> <message>[+comment.content:esc:nl2br:esc+]</message> </comment> `:strip+]
2. Create a new chunk: JotXML You can enter the docid as a static value or you can use a snippet that takes a querystring id to create a dynamic source document. You can also add tag id if you want)
<?xml version="1.0"?> [[Jot?docid=`45` &placeholders=`1` &output=`0` &tplComments=`JotTplXML` &pagination=`0`]] <jot> [+jot.html.comments+] </jot>
3. Create a new document
- Set the Content Type to: text/xml - In the document content field enter: {{JotXML}}
View the page


