Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2006-12-09 03:11:06

alexdickow
New Member
Registered: 2006-12-09
Posts: 8

Toggle comments form (was: new to textpattern)

I’m new not only to Textpattern, but to html, and trying to figure out a few design details:

a) I find the comment input field to be visually intrusive when people are reading my articles. But I’d like people to be able to make comments freely. So, I’d like to have articles followed by a “click here to comment” link, or something along those lines: ONLY upon clicking the link would visitors then see the comment input field. How can I do this?

b) I would like people to be able to subscribe to my blog’s feed, but I can’t find anything in the FAQs or online manuals on how to provide a link for visitors who would like to subscribe.

c) my “previous article” and “next article” links show up after my articles in the form of article titles. I’d like them to simply appear everywhere literally as the words “previous article” and “next article”. How do I do this?

I would imagine these are simple questions. Please take pity on an ignorant soul, and many thanks in advance.

Alex Dickow

Last edited by els (2006-12-12 16:30:24)

Offline

#2 2006-12-09 03:43:48

Walker
Plugin Author
From: Boston, MA
Registered: 2004-02-24
Posts: 592
Website

Re: Toggle comments form (was: new to textpattern)

For c: How to change the previous and next article links

Last edited by Walker (2006-12-09 03:44:11)

Offline

#3 2006-12-09 04:02:06

Walker
Plugin Author
From: Boston, MA
Registered: 2004-02-24
Posts: 592
Website

Re: Toggle comments form (was: new to textpattern)

To provide the feed link go to Presentation->pages and then click “XML Feeds” on the left-hand side. Select “articles” and then build your feed using the pop-up tag builder.

If you’re using the default install, you should already have two links that say “RSS / Atom”.

Offline

#4 2006-12-09 05:11:13

jm
Plugin Author
From: Missoula, MT
Registered: 2005-11-27
Posts: 1,746
Website

Re: Toggle comments form (was: new to textpattern)

For a, you could use some javascript. The less obtrusive the better, but here’s a quick script. Add this to your head or article:

function toggle_ini () {
	var form = document.getElementById('txpCommentInputForm');
		form.style.display = 'none';
}
//Toggle Objects
function toggle(obj) {
	var el = document.getElementById(obj);
	el.style.display = (el.style.display != 'none' ? 'none' : '' );
	}

window.onload = toggle_ini;

HTML:

<a href="#txpCommentInputForm" onclick="toggle('txpCommentInputForm')>Comment</a>

Offline

#5 2006-12-11 20:57:14

alexdickow
New Member
Registered: 2006-12-09
Posts: 8

Re: Toggle comments form (was: new to textpattern)

Thanks to all for your help. I got my older/newer article links working, and added my xml stuff (pending tests). But I’m not sure where to put the javascript and the html link: how do I find the “article” or “head” to which I’m supposed to add the script? Somewhere in the default page in Presentation:Pages?
Thanks again,
Alex

Offline

#6 2006-12-11 21:42:27

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: Toggle comments form (was: new to textpattern)

alexdickow wrote:

Somewhere in the default page in Presentation:Pages?

On the page between the <head> ... </head> tags.

Offline

#7 2006-12-11 22:25:55

alexdickow
New Member
Registered: 2006-12-09
Posts: 8

Re: Toggle comments form (was: new to textpattern)

Tried that, but it just displayed some messy code on my page w/o understanding it as a javascript. I also don’t seem to have the complete html link tag listed above: it looks cut off after the word “comment”. Which makes me wonder if I’m seeing all the javascript code that jm mu posted….
I think I’m still missing something.
Thanks again,
Alex

Offline

#8 2006-12-11 22:31:47

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: Toggle comments form (was: new to textpattern)

Wrap the script in <script type="text/javascript"> ... </script>.

Offline

#9 2006-12-11 22:39:53

alexdickow
New Member
Registered: 2006-12-09
Posts: 8

Re: Toggle comments form (was: new to textpattern)

I got that to work, so the messy code is no longer displaying. But I’m still not sure where to put the comment link tag that this javascript is going to operate on, that is, where to put this tag: <a href=”#txpCommentInputForm” onclick=“toggle(‘txpCommentInputForm’)>Comment</a>
Thanks,
Alex

Offline

#10 2006-12-11 22:48:58

alexdickow
New Member
Registered: 2006-12-09
Posts: 8

Re: Toggle comments form (was: new to textpattern)

Okay, clearly the script is now operating: I see the comment input box when I open an article, for a split second: it then vanishes, and is replaced by…nothing.
So, still looking for a way to put the “comment” link to lead to the input box.
Thanks,
Alex

Offline

#11 2006-12-12 02:22:35

jm
Plugin Author
From: Missoula, MT
Registered: 2005-11-27
Posts: 1,746
Website

Re: Toggle comments form (was: new to textpattern)

Place this <a href="#txpCommentInputForm" onclick="toggle('txpCommentInputForm')>Comment</a> before your comment form, so go to Presentation>Forms>default and place it after <txp:body />. That should do it.

Offline

#12 2006-12-12 04:35:11

alexdickow
New Member
Registered: 2006-12-09
Posts: 8

Re: Toggle comments form (was: new to textpattern)

Still can’t get that toggle script working properly…the “Comment” link doesn’t appear!
Thanks for your help….
Yours,
Alex

Offline

Board footer

Powered by FluxBB