Placing Add Comment Link Above Photo in Matrix

damon18
damon18's picture

Joined: 2002-10-29
Posts: 56
Posted: Mon, 2007-10-15 18:46

I've searched these forums and docs but can't figure out how to add a "Add Comment" link (which obeys item permissions) by itself.

I get the Add Comment link in the Matrix theme in the sidebar, but my members are not finding that link when viewing photos, I'd like to place a more obvious Add Comment button right above the resized and full size photos.

Gallery 2
Matrix Theme

Thanks,

Damon Linkous
Catamaran Sailing at TheBeachcats.com

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Tue, 2007-10-16 03:55

You can add the add comment "block" under the photos. You can also configure the 'block' to be a text box and not just a link.
Edit album theme tab, blocks to show on the photo page: add comment.

Or
try :
<a href="{g->url arg1="view=comment.AddComment" arg2="itemId=`$theme.item.id`" arg3="returnUrl=%CURRENT_URL%" useAuthToken=1}">Add Comment</a>

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
damon18
damon18's picture

Joined: 2002-10-29
Posts: 56
Posted: Wed, 2007-10-17 23:18

Thanks for that, I didn't realize I had neglected to activate the "Add Comment" block along with the "View Comment" one. That expanding comment box is really nice.

I also wanted to use your code to place an Add Comment link above the picture, but the result is a link that works well for logged-in users but guests get thrown out to a blank error page with

Security Violation

The action you attempted is not permitted. 

Not to friendly. Could I get tha link to behave better? If you aren't logged in I'd like to change the text to "Login to Comment On This Item" or something along those lines. Ideally that would be a link that would let them login or register and then bring them back to the item. But even just a plain text (no link) would let them know that commenting is possible if they would just login.

Thanks,

Damon Linkous
Catamaran Sailing at TheBeachcats.com

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Thu, 2007-10-18 03:20

Did you give permissions for the 'guest' user to add comments?

Your request:

 {if $user.isRegisteredUser}
 <a href="{g->url arg1="view=comment.AddComment" arg2="itemId=`$theme.item.id`" arg3="returnUrl=%CURRENT_URL%" useAuthToken=1}">Add Comment</a>
 {else}
 commenting is possible if they would just login.
 {/if}

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
damon18
damon18's picture

Joined: 2002-10-29
Posts: 56
Posted: Fri, 2007-10-19 03:15

No, I don't want to accept guest comments, too much problem with spammers and robots.

Your if statement should have been obvious to me! Someday this stuff will come more natural. ( or maybe not, I've been using Postnuke since version .63 )

Anyway, thanks for the help and you can see the finished product on this picture of me racing my boat a few weeks ago at Navarre Beach, FL
http://www.thebeachcats.com/index.php?module=pictures&g2_itemId=31846

Damon Linkous
Catamaran Sailing at TheBeachcats.com

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Fri, 2007-10-19 03:40
Quote:
I don't want to accept guest comments, too much problem with spammers and robots.

not that much of an issue with G2.3 Anti-spam features for the comment module (akismet / publishing features for the comment module)

Dave

_____________________________________________
Blog & G2 || floridave - Gallery Team