Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2007-10-15 18:28:23

travholt
Member
From: Oslo, Norway
Registered: 2004-08-04
Posts: 14
Website

Change comment form button text

I want to change the text on the buttons in my comment forms.

I’m running a Norwegian site but want an English backend, so I’ve downloaded a copy of en-us.txt and translated just the strings related to comment forms, but the “Preview” and “Submit” strings are also used in Txp’s admin area!

I have looked and searched all over, but my findings are these:

  • The txp:comment_remember, txp:comment_preview and txp:comment_submit tags take no attributes, and may thus not be given alternate labels.
  • There are no plugins written that will allow me to output alternative, more flexible form elements.
  • I can’t make a custom form out of the submit button, because it needs to be disabled at first and enabled when the comment has been previewed.

Is there anywhere I haven’t looked?

If there is no current solution, may I suggest taking into consideration making separate preview/submit strings for comment forms in the language file?

Offline

#2 2007-10-16 13:11:11

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: Change comment form button text

Well, why won’t us hand-code those buttons. It’s the same:

<input type="submit" name="preview" value="Preview" class="button" id="txpCommentPreview" />
<input type="submit" name="submit" value="Submit" class="button"<txp:if_comments_preview><txp:else /> class="button disabled" id="txpCommentSubmit" disabled="disabled"</txp:if_comments_preview> />

Change values, Preview & Submit, what you want, and put the code to your comment_form.

Cheers!

Last edited by Gocom (2007-10-16 13:12:32)

Offline

#3 2007-10-17 12:56:49

travholt
Member
From: Oslo, Norway
Registered: 2004-08-04
Posts: 14
Website

Re: Change comment form button text

Here I was, thinking no one bothered replying, and then I discovered the notification in my junk folder.

Thanks, I didn’t think of using if_comments_preview – hardly knew it existed. I’d actually started looking into making my own plugin …

Your example code isn’t quite in the right order, though:

<input type="submit" name="submit" value="Submit" <txp:if_comments_preview>class="button"<txp:else />class="button disabled" disabled="disabled"</txp:if_comments_preview> id="txpCommentSubmit" />

Offline

#4 2007-10-17 13:58:54

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: Change comment form button text

Hmph, double classes, er — doh. Well, copied code with hurry, and pasted class outside of if-conditional. But it works but won’t validate by WC3 when previewing comment.

Cheers!

Last edited by Gocom (2007-10-17 14:00:10)

Offline

Board footer

Powered by FluxBB