3 replies [Last post]
melanie_me's picture
Offline
Joined: 03/29/2009
Juice: 108
Was this information Helpful?

I need the attribute name and/or label to render html (italics primarily).

When I changed

$name = _uc_attribute_get_name($attribute, FALSE);
    if (!is_null($name)) {
      $form_attributes[$attribute->aid]['#title'] = check_plain($name);
    }

to

$name = _uc_attribute_get_name($attribute, FALSE);
    if (!is_null($name)) {
      $form_attributes[$attribute->aid]['#title'] = check_markup($name);
    }

Ubercart is putting paragraph tags around the attribute name/label.

Any ideas?

jrowny's picture
Offline
Joined: 01/08/2009
Juice: 297
Re: Attributes name/label to render markup

You can just use CSS right? The italics CSS code looks like tihs:

p{font-style:italic}
melanie_me's picture
Offline
Joined: 03/29/2009
Juice: 108
Would work, except...

The paragraph tags are making the colon after the label break to the next line. Not so nice.

TR
TR's picture
Online
Bug FinderFAQ ModeratorGetting busy with the Ubercode.
Joined: 11/05/2007
Juice: 3424
Re: Would work, except...

Ubercart does not put paragraph tags around attribute names.

Here's an example of the markup created by Ubercart for a "Size" attribute:

<label for="edit-attributes-1">Size: <span title="This field is required." class="form-required">*</span></label>

Notice, no paragraph tags. Perhaps you're using a WYSIWYG editor on the textfield you use to enter your attribute names - those are known to wrap text in paragraph tags.

<tr>.