$field->label null

  • Anonymous
  • Topic Author
  • Visitor
  • Visitor
13 years 8 months ago #10231 by Anonymous
$field->label null was created by Anonymous
Greetings,
I can't figure out why my custom fields are all null when displaying the label in the frontend, while in the backend they display fine.
Code:
<!-- BOF attribs --> <?php if (isset($item->positions['attribs'])) : ?> <ul> <?php foreach ($item->positions['attribs'] as $field) : ?> <li><?php echo $field->label .': '.$field->display; ?></li> <?php endforeach; ?> </ul> <?php endif; ?> <!-- EOF attribs -->
Lets say I have the core "Categories" and my custom text-field "Position"
The categories label will display fine, the "Position" label will be NULL

Please Log in or Create an account to join the conversation.

More
13 years 8 months ago #10232 by micker
Replied by micker on topic $field->label null
hello i think your syntax is not cool
Code:
<!-- BOF yourposition --> <?php if (isset($this->item->positions['yourposition'])) : ?> <?php foreach ($this->item->positions['yourposition'] as $champ) : ?> <div class="champ_<?php echo $champ->name; ?>"> <?php if ($champ->label) : ?> <div class="etiquette"><?php echo $champ->label; ?></div> <?php endif; ?> <div class="valeur"><?php echo $champ->display; ?></div> </div> <?php endforeach; ?> <?php endif; ?> </div> <!-- EOF yourposition -->
by carrefull assign your template at your categorie and drag and drop your filed in good position in admin template
regards

FLEXIcontent is Free but involves a very big effort on our part.
Like the our support? (for a bug-free FC, despite being huge extension) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing reviews. Thanks![/size]

Please Log in or Create an account to join the conversation.

  • Anonymous
  • Topic Author
  • Visitor
  • Visitor
13 years 8 months ago #10259 by Anonymous
Replied by Anonymous on topic $field->label null
Code:
<?php if (isset($item->positions['attribs'])) : ?> <ul class="attributes"> <?php foreach ($item->positions['attribs'] as $field) : ?> <li><?php echo (isset($field->label)) ? $field->label .': '.$field->display : $field->display;?></li> <?php endforeach; ?> </ul> <?php endif; ?>
Hmm added the iffset for label, however it's assigned properly. I get the values to display, but not the labels of the custom fields

Please Log in or Create an account to join the conversation.

More
13 years 8 months ago #10260 by micker
Replied by micker on topic $field->label null
hello you can hide the label on field administration
regards

FLEXIcontent is Free but involves a very big effort on our part.
Like the our support? (for a bug-free FC, despite being huge extension) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing reviews. Thanks![/size]

Please Log in or Create an account to join the conversation.

  • Anonymous
  • Topic Author
  • Visitor
  • Visitor
13 years 7 months ago #10280 by Anonymous
Replied by Anonymous on topic $field->label null
Sorry that is not the problem, I have set them all to display label, however their Labels are not read. In the Backend I see them, in the front end If i try to output them i get something like this

starttime - param "display_label": "1" label: NULL
speaker - param "display_label": "1" label: NULL
topic - param "display_label": "1" label: NULL
venue - param "display_label": "1" label: NULL
text - param "display_label": "0" label: "Description"
eventpic - param "display_label": "1" label: NULL

Please Log in or Create an account to join the conversation.

  • Anonymous
  • Topic Author
  • Visitor
  • Visitor
13 years 7 months ago #10281 by Anonymous
Replied by Anonymous on topic $field->label null
here's a sample of my custom date field
Code:
object(stdClass)#285 (20) { ["id"]=> string(2) "15" ["field_type"]=> string(4) "date" ["name"]=> string(9) "starttime" ["label"]=> NULL ["description"]=> string(0) "" ["isfilter"]=> string(1) "0" ["iscore"]=> string(1) "0" ["issearch"]=> string(1) "1" ["isadvsearch"]=> string(1) "0" ["positions"]=> string(0) "" ["published"]=> string(1) "1" ["attribs"]=> string(101) "display_label=1 date_format=DATE_FORMAT_LC2 custom_date=%c allow_multiple=0 max_values=0 separatorf=1" ["checked_out"]=> string(1) "0" ["checked_out_time"]=> string(19) "0000-00-00 00:00:00" ["access"]=> string(1) "0" ["ordering"]=> string(2) "15" ["item_id"]=> int(1) ["value"]=> array(1) { [0]=> string(10) "2010-07-08" } ["parameters"]=> object(JParameter)#247 (7) { ["_raw"]=> string(101) "display_label=1 date_format=DATE_FORMAT_LC2 custom_date=%c allow_multiple=0 max_values=0 separatorf=1" ["_xml"]=> NULL ["_elements"]=> array(0) { } ["_elementPath"]=> array(1) { [0]=> string(65) "XXXXX" } ["_defaultNameSpace"]=> string(8) "_default" ["_registry"]=> array(1) { ["_default"]=> array(1) { ["data"]=> object(stdClass)#249 (6) { ["display_label"]=> string(1) "1" ["date_format"]=> string(15) "DATE_FORMAT_LC2" ["custom_date"]=> string(2) "%c" ["allow_multiple"]=> string(1) "0" ["max_values"]=> string(1) "0" ["separatorf"]=> string(1) "1" } } } ["_errors"]=> array(0) { } } ["display"]=> string(28) "Thursday, 08 July 2010 08:00" }

Note:
["label"]=>
NULL

Please Log in or Create an account to join the conversation.

Moderators: vistamediajoomlacornerggppdk
Time to create page: 0.564 seconds
Save
Cookies user preferences
We use cookies to ensure you to get the best experience on our website. If you decline the use of cookies, this website may not function as expected.
Accept all
Decline all
Essential
These cookies are needed to make the website work correctly. You can not disable them.
Display
Accept
Analytics
Tools used to analyze the data to measure the effectiveness of a website and to understand how it works.
Google Analytics
Accept
Decline