I have hit another brick wall with my first modx project
The site i’m building has comments on certain articles.
Jot looks fit for the job, but finding it really hard to customize and learn because I can’t find any documentation about the custom placeholders on the Jot wiki etc.
I am calling jot in to my blog posts like this:
<div id="comments">
<ol>
[[Jot? &placeholders=`1` &output=`0` &subscribe=`1` &tplComments=`commentsLayout` &tplForm=`blogForm` &customfields=`name,email` &debug=`1`]]
[+jot.html.comments+]
</ol>
[+jot.html.form+]
[+jot.html.moderate+]
</div>
Comment template looks like this:
<!-- user comment -->
<li><p class="comment">[+comment.content:wordwrap:esc:nl2br+]</p>
<p class="author"><em>[+comment.createdby:userinfo=`fullname`+] - [+comment.createdon:date=`%A, %d %B, %Y, %H:%M`+]</em></p>
</li>
<!-- end user comment -->
and finally the form template looks like this:
<a name="jf[+jot.link.id+]"></a>
<h2>[+form.edit:is=`1`:then=`Edit comment`:else=`Leave a comment on this article`+]</h2>
[+form.error:isnt=`0`:then=`
<p class="error">
[+form.error:select=`
&-3=You are trying to re-submit the same post. You have probably clicked the submit button more than once.
&-2=Your comment has been rejected.
&-1=Your comment has been saved, it will first be reviewed before it is published.
&1=You are trying to re-submit the same post. You have probably clicked the submit button more than once.
&2=The security code you entered was incorrect.
&3=You can only post once each [+jot.postdelay+] seconds.
&4=Your comment has been rejected.
&5=[+form.errormsg:ifempty=`You didn't enter all the required fields`+]
`+]
</p>
`:strip+]
[+form.confirm:isnt=`0`:then=`
<p class="confirm">
[+form.confirm:select=`
&1=Thank you, your comment has been published.
&2=Your comment has been saved, it will first be reviewed before it is published.
&3=Comment saved.
`+]
</p>
`:strip+]
<form method="post" action="[+form.action:esc+]#jf[+jot.link.id+]" name="post-comment" id="post-comment">
<input name="JotForm" type="hidden" value="[+jot.id+]" />
<input name="JotNow" type="hidden" value="[+jot.seed+]" />
<input name="parent" type="hidden" value="[+form.field.parent+]" />
<div id="form">
<dl>
<dt><label for="name">Name: </label></dt>
<dd><input name="name" type="text" id="name" value="[+form.field.custom.name:esc+]" /></dd>
<dt><label for="email">Email: </label></dt>
<dd><input name="email" type="text" id="email" value="[+form.field.custom.email:esc+]" /></dd>
<dt><label for="comment">Comment: </label></dt>
<dd><textarea name="" cols="20" rows="" id="comment">[+form.field.content:esc+]</textarea></dd>
<dt> </dt>
<dd style="text-align: right; width: 438px;"><input name="" type="image" src="assets/templates/beautytalk_v1/images/buttons/img_button_submit.gif" /></dd>
</dl>
</div>
</form>
I have managed to style the form and comments using my own markup, however new comments posted don’t currently display any content, or use any information in the form (like name).
I’ve tried logging out of the manager but when i post a comment i just get empty content with the author set as "Default admin account - Sunday, 30 March, 2008, 08:13".
I don’t want users to register before posting, so I have a funny feeling my form template is probably wrong in areas.
So far i can only see 2 options:
1 - play around with the default jot html templates
2 - use the default Jot comment and form html, and style accordingly.
None of which i’m happy with because i’m making compromises.
Could anybody help or point me in the right direction?