ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Custom profile fiel with HTML

February 26, 2008 7:21am

Subscribe [1]
  • #1 / Feb 26, 2008 7:21am

    Mbruijn

    12 posts

    Hello,

    Is it possible to add a custom profile field with html formatting so members can insert their info with markup and safe html like youtube embed codes?

    Thanks, Marc

  • #2 / Feb 26, 2008 10:32am

    Robin Sowell

    13255 posts

    Looks like this would take a feature request or some custom coding.  Ignoring whether it might be stripped via xss_clean, looks like the html is set to ‘none’- can see it in mod.member_settings.php:

    'text_format'   => $row['m_field_fmt'],
                                                                                        'html_format'   => 'none',
                                                                                        'auto_links'    => 'n',
                                                                                        'allow_img_url' => 'n'

    Now- you can set formating to none/xhtml/etc- but sounds like you need html_format set to safe or all for what you’re doing.

  • #3 / Feb 26, 2008 10:54am

    Mbruijn

    12 posts

    I didn’t know where to look, but I guess that a part of the solution is in this file.
    In the bio field is safe html allowed, if I also allow img urls, then a part is fixed. Now I want a WYSIWYG row above this field like the normal weblog entry field. Would this be possible and would this be the solution?

  • #4 / Feb 26, 2008 11:06am

    Robin Sowell

    13255 posts

    The bio field allows safe html- don’t think it likes images though:

    if (ereg("^bio$", $key))
                {
                    $bio = $TYPE->parse_type($query->row[$val], 
                                                                 array(
                                                                            'text_format'   => 'xhtml',
                                                                            'html_format'   => 'safe',
                                                                            'auto_links'    => 'y',
                                                                            'allow_img_url' => 'n'
                                                                       )
                                                                );

    But if safe_html parsed what you need- it should work.  That said- adding a wysiwyg editor won’t matter.  Put it in manually, put it in via wysiwyg- EE will parse the contents in the same manner.

  • #5 / Feb 26, 2008 12:20pm

    Mbruijn

    12 posts

    Ok, but how do I get a WYSIWYG editor with that field? Most of the visitors of my site don’t understand plain html.

  • #6 / Feb 26, 2008 12:37pm

    Robin Sowell

    13255 posts

    Well, they’re pretty much limited to text in a lot of the areas.  What all do you want them to enter?  I’m thinking this stuff might go in better as weblog entries than the member templates- they are really limited in the html that could go there anyway.

    I think I’d reconsider the setup myself.  That said- I haven’t spotted anyone trying to use a wysiwyg editor for the member templates- but I can’t particularly see why it wouldn’t work.  You’d want to go to ‘Admin- Members and Groups- Member Profile templates’ and start looking for where you need to add the js/etc for whatever editor you’re interested in.  Can’t say for sure how doable it is- as it’s not something I would suggest doing.  You really can’t use much html in those fields.  It’s not what they’re designed for.  Sounds like weblog entries- perhaps via the standalone entry form might be more appropriate.  And I’d bet money someone has tweaked with a wysiwyg editor for that.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases