Hi David
By default, Habari aims to be HTML5 compliant and accordingly, the default
form controls will comply with HTML5 standards.
You appear to be using a theme that is trying to be XHTML 1.0 Transitional
complaint so in order to make the form controls compliant, you'll need to
provide your own.
You can do this as follows:
1. Create a directory in your theme directory to hold the form controls.
This is only optional, but it keeps things nice and tidy.
2. Copy the system/admin/formcontrol/formcontrol_* files you want to modify
to the directory created above, this case formcontrol_submit.php and
formcontrol_form.php
3. Modify the HTML in the copied files to make them XHTML compliant, wihch
in this case involves adding the / to the hidden and submit input types.
4. Add the following to your theme's theme.php:
public function action_form_comment( $form )
{
$this->add_template( 'themename_submit', dirname(__FILE__) .
'/formcontrols/formcontrol_submit.php' );
$this->add_template( 'themename_form', dirname(__FILE__) .
'/formcontrols/formcontrol_form.php' );
$form->set_option('template', templatename_form');
$form->cf_submit->template = 'themename_submit';
}
You can use any text for "themename", for example the actual theme's name.
This should now render your submit and hidden field (just the name="FormUI"
field) as you want them to.
You can use the same method for any of the other FormControl field types
too.
HTH
Colin
On Fri, Jun 17, 2011 at 3:33 AM, David <[email protected]> wrote:
> On Jun 15, 9:21 pm, David <[email protected]> wrote:
> > The comment form doesn't pass HTML markup
> > validation. ... How do I fix that?
> >
> > You can see them here:http://david.dlma.com/habari/internet-security
>
> The validation errors:
>
> http://validator.w3.org/check?uri=http%3A%2F%2Fdavid.dlma.com%2Fhabari%2Finternet-security&charset=%28detect+automatically%29&doctype=Inline&group=0
>
> I don't know PHP, so I get lost. Here's what happens: my theme calls
> $post->comment_form()->out().
>
> That evidently comes from system/classes/post.php, where
> comment_form() creates a FormUI( 'comment-'. $context, 'comment' ) and
> sets parameters on it, then returns it. So now we're looking to see
> what that particular FormUI's out() method prints. I think that comes
> from system/classes/formui.php, and what it does is echo out the
> results of calling $this->get() on each of the args from
> func_get_args().
>
> At that point it gets hard for me to follow. All I want is for my
> comment form's "hidden" and "submit" elements to properly close
> themselves so my pages can pass HTML markup validation. Anybody have
> any suggestions?
>
> Thanks,
> --David
>
> --
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/habari-users
>
--
Colin Seymour
Blog: http://colinseymour.co.uk
Tech Stuff: http://lildude.co.uk
Barefoot Running: http://barefootrunner.co.uk
IRC: lildude #habari
--
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/habari-users