Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8126243
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T07:05:14+00:00 2026-06-06T07:05:14+00:00

I have used the embedRelation() to pull another form into the sfGuard user form.

  • 0

I have used the embedRelation() to pull another form into the sfGuard user form. It is working correctly, I am just trying to style it to fit into the current form.

This pulls the form in:

$this->embedRelation('Profile');

but it is adding some extra html elements that I would like to remove:

<div class="form_row">
 Profile 
 <table>
  <tbody><tr>
  <th><label for="sf_guard_user_Profile_department_title">Department</label></th>
  <td><input type="text" name="sf_guard_user[Profile][department_title]" value="Graphic Design" id="sf_guard_user_Profile_department_title"><input type="hidden" name="sf_guard_user[Profile][id]" value="2" id="sf_guard_user_Profile_id">
<input type="hidden" name="sf_guard_user[Profile][sf_guard_user_id]" value="10" id="sf_guard_user_Profile_sf_guard_user_id"></td>
</tr>
</tbody></table> <input type="hidden" name="sf_guard_user[id]" value="10" id="sf_guard_user_id"> </div>

How can I remove “Profile”? I would also like the label to not be wrapped in a table header. Is this possible using embedRelation?

UPDATED Schema Formatter:

sfWidgetFormSchemaFormatter works to remove the table elements from the embedded form. I still can’t figure out how to get rid of “Profile”. I have added the sfWidgetFormSchemaFormatter

sfWidgetFormSchemaFormatterAc2009.class.php

    <?php 

    class sfWidgetFormSchemaFormatterAc2009 extends sfWidgetFormSchemaFormatter
    {
      protected
        $rowFormat       = "%error% \n %label% \n %field%
                            %help% %hidden_fields%\n",
        $errorRowFormat  = "<div>%errors%</div>",
        $helpFormat      = '<div class="form_help">%help%</div>',
        $decoratorFormat = "%content%";

        public function formatRow($label, $field, $errors = array(), $help = '', $hiddenFields = null)
        {
          $row = parent::formatRow(
            $label,
            $field,
            $errors,
            $help,
            $hiddenFields
          );

          return strtr($row, array(
            '%row_class%' => (count($errors) > 0) ? ' form_row_error' : '',
          ));
        }

        public function generateLabel($name, $attributes = array())
      {
        $labelName = $this->generateLabelName($name);

        if (false === $labelName)
        {
          return '';
        }

        if (!isset($attributes['for']))
        {
          $attributes['for'] = $this->widgetSchema->generateId($this->widgetSchema->generateName($name));
        }

        // widget name are usually in lower case. Only embed form have the first character in upper case

        var_dump($name);

        if (preg_match('/^[A-Z]/', $name))
        {
          // do not display label
          return ;
        }
        else
        {
          return $this->widgetSchema->renderContentTag('label', $labelName, $attributes);
        }
      }
    }

html:

<div class="form_row">
 Profile 
 <div>

 <label for="sf_guard_user_Profile_department_title">Department</label> 
 <input class=" text size-300" type="text" name="sf_guard_user[Profile][department_title]" value="Graphic Design" id="sf_guard_user_Profile_department_title">
                         <input type="hidden" name="sf_guard_user[Profile][id]" value="2" id="sf_guard_user_Profile_id">
</div> <input type="hidden" name="sf_guard_user[id]" value="10" id="sf_guard_user_id"> </div>

UPDATE 2:

The new function generateLabel($name, $attributes = array()) is generating this at the top of the form:

string(16) “department_title”

Profile remains.

RESOLVED

I was able to acomplish this using JQuery

I added this to the editSuccess.php template:

<script>
var $body = $('.content-box');
var html = $body.html();
var newHtml = html.replace('Profile', '');
$body.html(newHtml);
</script>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T07:05:15+00:00Added an answer on June 6, 2026 at 7:05 am

    I found a work around that works for me. It’s a bit weird solution.

    The label is displayed using generateLabel. So, if we want to hide the label, we only have the label name to build a condition.

    In your custom formatter:

      public function generateLabel($name, $attributes = array())
      {
        $labelName = $this->generateLabelName($name);
    
        if (false === $labelName)
        {
          return '';
        }
    
        if (!isset($attributes['for']))
        {
          $attributes['for'] = $this->widgetSchema->generateId($this->widgetSchema->generateName($name));
        }
    
        // widget name are usually in lower case. Only embed form have the first character in upper case
        if (preg_match('/^[A-Z]/', $name))
        {
          // do not display label
          return ;
        }
        else
        {
          return $this->widgetSchema->renderContentTag('label', $labelName, $attributes);
        }
      }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have used a plugin that uses prototype js, it's working fine but the
i have used zend paginator in my app its working fine the way its
I have used RDP to get into my windows azure instance. I downloaded VisualSVN
I have used mysql_real_escape_string to enter info into the database but when I return
I have used This guide . But if i add it to another project,
I have used Shibboleth with manual login, meaning the user clicks the login link
I have used Cascading Drop Downs (for Make and Model) in my web form.
I have used several different scripts that people have suggested for trying to parse
I have used MFMailComposeViewController to implement email functionality in my app. It is working
I have used some jquery components in my web site, Suddenly i'm getting an

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.