21288 Posts in 5733 Topics by 2602 members
General Questions
SilverStripe Forums » General Questions » How to get rid of "Your website URL" field in post comment form
General questions about getting started with SilverStripe that don't fit in any of the categories above.
Moderators: martimiz, Howard, Sean, Ryan M., biapar, Willr, Ingo, swaiba, simon_w
|
Page:
1
|
Go to End | |
| Author | Topic: | 1883 Views |
-
How to get rid of "Your website URL" field in post comment form

23 May 2009 at 5:51pm
Is there a way to get rid of "Your website URL" field in the post comment form without making changes to cms/code/sitefeatures/PageCommentInterface.php?
-
Re: How to get rid of "Your website URL" field in post comment form

23 May 2009 at 8:07pm
Hi
Go the PageComments class and delete this field in the Contoller. So this field won't be visible for anyone. I don't have enough time, to give you the whole path.
Best regards,
Pascal
-
Re: How to get rid of "Your website URL" field in post comment form

24 May 2009 at 8:56pm
I'm looking for a solution without doing any changes to the code. Introducing solution in code is not ideal since it might disappear upon next update.
-
Re: How to get rid of "Your website URL" field in post comment form

25 May 2009 at 2:49am
Hi mango,
I read currently my last post and I have to detect, that my statement was very difficult to understand. Sorry. What I mean is that
you can write in your Page.php file or another php file. So you can overwrite the pagecomments, because you have a relation with methods on other class.Best regards,
Pascal
-
Re: How to get rid of "Your website URL" field in post comment form

25 May 2009 at 2:55am
Pascal, thanks for the pointer, I now understand what you mean. I guess I'll have to learn a bit more before overwriting pagecomments' behaviour. For the time being I'll just use CSS to display:none it.
Thanks again.
-
Re: How to get rid of "Your website URL" field in post comment form

18 February 2010 at 5:01pm
I have a project where I need to upload text content to some pages of an unfinished site, while developing the rest of it. My concern is that when i update the site, will I overwrite all my content. Is there a way I can prevent this?
Thank you in advance!
-
Re: How to get rid of "Your website URL" field in post comment form

22 October 2010 at 4:42am
i always use this to remove the URL field....
#CommenterURL {
display:none;
} -
Re: How to get rid of "Your website URL" field in post comment form

5 November 2010 at 4:03am Last edited: 5 November 2010 4:04am
or you can :
1 - Create a file mysite/code/PageCommentInterfaceWithoutURL.php :
<?php
class PageCommentInterfaceWithoutURL extends PageCommentInterface{
function PostCommentForm() {
$form = parent::PostCommentForm();
$fields = $form->Fields();
$fields->removeByName('CommenterURL');
$form->setFields($fields);
return $form;
}
}?>
2 - and add this function in your Page_Controller class in mysite/code/page.php :
function PageComments() {
if($this->data() && $this->data()->ProvideComments) {
return new PageCommentInterfaceWithoutURL($this, 'PageComments', $this->data());
}
else {
if(isset($_REQUEST['executeForm']) && $_REQUEST['executeForm'] == 'PageComments.PostCommentForm') {
echo "Comments have been disabled for this page";
die();
}
}
}
| 1883 Views | ||
|
Page:
1
|
Go to Top |




