ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Comment url problems

July 01, 2008 10:45am

Subscribe [1]
  • #1 / Jul 01, 2008 10:45am

    jontusmedia

    20 posts

    I want the name of people who comment on my site to link to their url but I’m having problems achieving this.

    Using the following code:

    {exp:comment:form}
    
    {if logged_out}
    
    Name: <input type="text" name="name" value="{name}" size="50" /></p>
    
    Email: <input type="text" name="email" value="{email}" size="50" /></p>
    
    
    URL: <input type="text" name="url" value="{url}" size="50" /></p>
    
    {/if}
    
    <textarea name="comment" cols="70" rows="10">{comment}</textarea></p>
    
    <input type="checkbox" name="save_info" value="yes" {save_info} /> Remember my personal information
    
    <input type="checkbox" name="notify_me" value="yes" {notify_me} /> Notify me of follow-up comments?
    
    <input type="submit" name="submit" value="Submit" />
    
    
    {/exp:comment:form}

    I get the result that the commentator’s name is shown and their comment. But their name is not a url.

    You can see this at work here.

  • #2 / Jul 01, 2008 10:54am

    Robin Sowell

    13255 posts

    Heh- I agree w/your post on IE!  OK- what are you using in the comment entries tag?  That’s where you’ll structure the comment output.  It sounds like you want to use the {url_as_author} variable there:

    Hyperlink pointing to the URL (if it exists) with the author name as the link title. If the URL does not exist simply the name is returned.

  • #3 / Jul 01, 2008 12:16pm

    jontusmedia

    20 posts

    Robin,
    Thank you. I needed to switch {name} for {url_as_author} in the mark-up between the comments tags.

    I.e.

    {exp:comment:entries weblog="section01" }    
                        <li class="alt" id="comment-6">
                            {url_as_author}  on
                                        {comment_date format="%F %d, %Y"}
                            <div class="commenttext">
                        {comment}
                            </div>
    {/exp:comment:entries}
  • #4 / Jul 01, 2008 12:55pm

    Robin Sowell

    13255 posts

    Good deal- and glad you’re squared away.

    Closing this one out….

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases