By bryan kennedy on
I am trying to pull the comment submission form inside of the content of my page. However, PHPTemplate doesn't seem to have this level of granularity. As far as I can tell the content of my page and my comment form is embeded within the $content variable. Digging around in the comment.module shows me that there are theme_ functions for various parts of the comment mechanism but nothing like page.tpl.php where I could move the HTML that output the comment form up into a different part of my page. I can do some wicked css hack with massive negative margins if I must, but I was hoping to be able to redefine the HTML structure for comments with PHPTemplate. Thanks
Comments
comments not themable enough
So it appears that the comment.module does not provide any theme hooks to do what I wanted. I ended up just modifying the whole content of the page with a little PHP hack. Thought I would post it here in case it was usefull to anyone, but I keep getting a suspicous data error. So the general idea is to do a find and relace with your $content variable in the page.tpl.php file to move the comment submission form above the comments. Not pretty but it get's the results I needed.
I saw your post from May
I saw your post from May last year and wondered if you have found any better sollution to the problem of theming the comment form?
Regards
Comment Template
I believe you need to create a comment template (comment.tpl.php) in order to theme the comments. I don't recall what needs to go into it at the moment, but it shouldn't be too difficult.
Mike
http://www.ixlr8.org
Yes, but what about the form?
Yes I have seen the possibilities of theming the comment itself, but what I was looking for was the form that lets the user of the page fill in a new comment.
I'm planning on using comments on a page-node as a guestbook, and it would be great if there could be a small form on the bottom of my personal homepage where users could fill in a quick greeting. The current comment form available is too big for my taste. But I guess I could always hardcode it in the comment module.
Thanks for the reply
Hans
Layers of theming
Remember, there are many layers of theming. There are the default tpl.php forms that PHPTemplate supports natively.
Then, comment.module has several themeable functions. You can override these functions and do whatever you like, placing your new function in template.php in the case of PHPTemplate.
can the comment form itself be themed from a PHPtemplate theme?
Can the comment form itself be themed from a PHPtemplate theme?
My Drupal-powered Blog: ThoughtfulChaos
comment form not themable using comment.tpl.php
The form used for posting comments is not themable via comment.tpl.php. comment.tpl.php themes a single comment. Everything outside of a single comment (for e.g. the indentation if threaded commenting is enabled) cannot be themed from comment.tpl.php.
My Drupal-powered Blog: ThoughtfulChaos
Exactly
Yeah, that was my problem and why I had to just end up doing some PHP hacking with grep search and replaces to get it to do what I needed.