list all fields (also empty fields) [solved]

More
14 years 4 months ago - 14 years 3 months ago #13819 by ocaeymaex
I am currently customizing some templates and I would like to show all fields, including the empty ones.

At the moment, the empty fields are left out (not displayed) and it messes up my screen. I'd like to have them shown on the web page, regardless of whether they're empty or not.

The corresponding code in the template is the following:
Code:
<?php foreach ($this->item->positions['frame3'] as $field) : ?> <li><div> <?php if ($field->label) : ?> <div class="label field_created"> <?php echo $field->label; ?> </div> <?php endif; ?> <div class="value field_created"> <?php echo $field->display; ?> </div> </div></li> <?php endforeach; ?>

I have no clue how this should be adapted to list *ALL* fields. Any tip would be highly appreciated.

Thanks in advance.
Last edit: 14 years 3 months ago by ocaeymaex.

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

More
14 years 4 months ago #13824 by yopyop001
Hi,

No lot of time to test.

But, if you add
Code:
<?php print_r($this->item->fields); ?>

in the beginning of your template file, do you find the field you want to display?

If yes you can call fields (label or value) using :
Code:
$this->item->fields['field_name']->label
or
Code:
$this->item->fields['field_name']->display

If not, i think you have to make changes in the core of Flexicontent...

Regards

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

More
14 years 3 months ago #13952 by ocaeymaex
Thanks for the reply, but it goes a biut too far for me. I have posted a message here asking for freelance assistance. Let's see if anybody shows up.

Thanks again.

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

Moderators: vistamediajoomlacornerggppdk
Time to create page: 0.281 seconds
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
Save