“Add a Comment” link in article summary that links directly to the comment form?
Posted: 23 March 2007 10:00 PM   [ Ignore ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1925
Joined  08-02-2006

On my homepage where I have article summaries, I also have a link that reads “Add a Comment”.  What I would like to have happen is once that link is clicked, it will take the visitor directly to the contact form.  I know it’s possible I just don’t know how to do it…I’ve never had a desire or need to do this before.  I’m sorry I know it’s probably the simplest thing to do, but I don’t even know what doing so is called thus why I haven’t searched for it already.

Thanks.

 Signature 

Deron Sizemore
==========
LogoGala | Kentucky Golfing
Twitter: Deron Sizemore | LogoGala

Profile
 
 
Posted: 23 March 2007 10:04 PM   [ Ignore ]   [ # 1 ]  
Administrator
Avatar
RankRankRankRankRankRankRankRank
Total Posts:  40207
Joined  05-14-2004

Have you tried using HTML anchors?  So you’d have an <a name=”#comments”> and then link to the comments link with #comments.

Let me know if you need more details, it’s a standard HTML trick though.

 Signature 
Profile
MSG
 
 
Posted: 23 March 2007 10:22 PM   [ Ignore ]   [ # 2 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  848
Joined  04-24-2002

HTML anchors is definitely the way to do it. One small correction of Lisa’s tip. The name doesn’t need to have the # symbol. Just the link to it. So <a name=“comments”></a> and the link points to #comments.

 Signature 

chrisruzin.netTextMate EE BundlejEdit EE ModeSolspace
“The greatest barrier to success is the fear of failure.” - Sven Goran Eriksson

Profile
 
 
Posted: 23 March 2007 10:24 PM   [ Ignore ]   [ # 3 ]  
Administrator
Avatar
RankRankRankRankRankRankRankRank
Total Posts:  40207
Joined  05-14-2004

I have always been terrible at using that simple HTML anchor thinger.  Thanks for correcting me. =)  Funny how sometimes one gets stuck on simple issues… forever. =)

 Signature 
Profile
MSG
 
 
Posted: 23 March 2007 10:54 PM   [ Ignore ]   [ # 4 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  848
Joined  04-24-2002

We all get stuck on various things. No need to say you’re terrible at it. Your seemingly infinite knowledge of all things EE easily makes up for your anchor thinger usage. smile

 Signature 

chrisruzin.netTextMate EE BundlejEdit EE ModeSolspace
“The greatest barrier to success is the fear of failure.” - Sven Goran Eriksson

Profile
 
 
Posted: 23 March 2007 11:07 PM   [ Ignore ]   [ # 5 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1925
Joined  08-02-2006

Ah I see.  Well that seemed easy enough but it’s not working and I know why, just don’t know how to fix it. 

Here is what I have for the anchor:

<h2><a name="comments">Comments</a></h2>

and here is what I’m using to link to that anchor:

<a href="http://www.mydomain.com/blog/article/#comments>Go to Comments</a>

The problem is that my link does not take me to the “comments” anchor, reason being that the URL of the link would need to include the title of the entry because when I click on the title of the entry right now it takes me to this URL:  http://mydomain.com/blog/article/this-is-a-test-post/.  Therefore, my link URL that I’m trying to get to point to the comments anchor doesn’t include the title of the post, so it gets confused and doesn’t send me to the right place.  I assume I need to include a variable of some kind in the link URL but I’m not sure what I need to include?

 Signature 

Deron Sizemore
==========
LogoGala | Kentucky Golfing
Twitter: Deron Sizemore | LogoGala

Profile
 
 
Posted: 23 March 2007 11:21 PM   [ Ignore ]   [ # 6 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  848
Joined  04-24-2002

The anchor name can go after the title too. So:

http://mydomain.com/blog/article/this-is-a-test-post/#comments
 Signature 

chrisruzin.netTextMate EE BundlejEdit EE ModeSolspace
“The greatest barrier to success is the fear of failure.” - Sven Goran Eriksson

Profile
 
 
Posted: 23 March 2007 11:34 PM   [ Ignore ]   [ # 7 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1925
Joined  08-02-2006

Yeah that would work for that one particular entry, but I need it to be dynamic in that it automatically picks up the URL from the new post, if that’s possible I don’t know?

I’ll just show you what I’m working with.  The site is HERE

On the homepage you can see I’ve got two weblogs set up (featured article, featured course).  On the homepage, the most recent articles from each of these weblogs are displayed in summary form on the homepage.  When the visitor clicks the entry title or the “continue reading” link it takes them to the full article entry which uses my “blog/article” template.  Both the “featured article” and “featured course” weblogs use the “blog/article” template to show the full article entry.  Below is an example of what I’ve used on my homepage to display the most recent “featured article” summary:

{exp:weblog:entries weblog="featuredarticle" limit="1" disable="pagination|member_data|trackbacks"}
            
<h2>FEATURED ARTICLE</h2>
            <
h3><a href="{title_permalink=blog/article}" title="{title}">{title}</a></h3>
            <
ul class="commenttimeauthor">
                <
li class="by">By {featured_writtenby} on {entry_date format="%F %j, %Y"}</li>
                <
li class="comment">{if comment_total > 0}<a href="http://www.kentuckygolfing.com/#commentform" title="{comment_total} Comments on This Article">{comment_total} Comments on This Article</a>{if:else}<a href="http://www.kentuckygolfing.com/blog/article/#commentform" title="Add a Comment">Add a Comment</a>{/if}</li>
            </
ul>        
            
{featured_summary}
            
<p class="readmore"><a href="{title_permalink="blog/article}" title="Continue Reading {title}">Continue Reading</a></p>
                        {/exp:weblog:entries}

Thanks

 Signature 

Deron Sizemore
==========
LogoGala | Kentucky Golfing
Twitter: Deron Sizemore | LogoGala

Profile
 
 
Posted: 23 March 2007 11:58 PM   [ Ignore ]   [ # 8 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  848
Joined  04-24-2002
href="{title_permalink="blog/article}#comments"

That should do it for you.

 Signature 

chrisruzin.netTextMate EE BundlejEdit EE ModeSolspace
“The greatest barrier to success is the fear of failure.” - Sven Goran Eriksson

Profile
 
 
Posted: 24 March 2007 12:25 AM   [ Ignore ]   [ # 9 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1925
Joined  08-02-2006

Perfect!  Thanks.  I didn’t realize I could write it like that.  I tried what I had above, but before that I tried a href=“http://www.kentuckygolfing.com/{title_permalink=“blog/article}/#comments but it didn’t work. lol

Thanks.

 Signature 

Deron Sizemore
==========
LogoGala | Kentucky Golfing
Twitter: Deron Sizemore | LogoGala

Profile
 
 
Posted: 24 March 2007 12:31 AM   [ Ignore ]   [ # 10 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  848
Joined  04-24-2002

No problem. Glad we could help you out.

 Signature 

chrisruzin.netTextMate EE BundlejEdit EE ModeSolspace
“The greatest barrier to success is the fear of failure.” - Sven Goran Eriksson

Profile
 
 
Posted: 24 March 2007 05:38 PM   [ Ignore ]   [ # 11 ]  
Sr. Research Associate
Avatar
RankRankRankRankRank
Total Posts:  3492
Joined  08-28-2003
Lisa Wess - 23 March 2007 10:24 PM

I have always been terrible at using that simple HTML anchor thinger.  Thanks for correcting me. =)  Funny how sometimes one gets stuck on simple issues… forever. =)

Gawd, you’ve got over 17,000 posts, Lisa. It’s certainly allowable that a few things slip through the cracks. BTW, it’s my understanding that once you hit 20,000 posts you have to go back and delete an old one for each new one you enter.

I’ve taken to keeping laminated cheat sheets, check list sheets, and every shortcut known to XHTML and CSS just to get a site up and running. Thank gawd for ‘validate as you go’ editors.

 Signature 

grrramps
———
Honolulu, HI
———
Home | Old Hobby | New Hobby | Newer Hobby | Another update via CSS

Profile
 
 
   
 
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 1743, on December 02, 2009 03:47 PM
Total Registered Members: 120509 Total Logged-in Users: 67
Total Topics: 126576 Total Anonymous Users: 42
Total Replies: 665465 Total Guests: 355
Total Posts: 792041    
Members ( View Memberlist )