If I want to set a field as a css value.

More
14 years 2 months ago #3419 by despair
I try to make a templete,and I want to set a select field as a css style selector.

In the templete I want to make field in some tags.
like
<ul class="field1value field2value field3value">

I write
<ul class="iteminfo <?php foreach ($items[$i]->positions as $field) : ?> <?php echo $field->display; ?><?php endforeach; ?>">
But it error. :oops:


Sorry my english is poor. :oops:
Thanks for everyone!

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

More
14 years 2 months ago #3435 by Linuus
What error message do you get?

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

More
14 years 2 months ago #3436 by despair
<br />

<b>Warning</b>: Invalid argument supplied for foreach() in <b>..\www\TIWC\components\com_flexicontent\templates\profile\category_items.php</b> on line <b>236</b><br />

The line236 just what I add in the templete. :?:

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

More
14 years 2 months ago #3437 by Linuus
Have you created a position called color and put your fields here? I'm not that good with FC templates, but I guess you have to do that to use positions.

Do that and try the code below
Code:
<ul class="iteminfo <?php foreach ($this->items->positions['color'] as $field) : ?> <?php echo $field->display; ?><?php endforeach; ?>">


EDIT: Is it an item view or category view you're working with?

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

More
14 years 2 months ago - 14 years 2 months ago #3440 by despair
yes, I add a position in category.xml
<fieldgroups>
<group>images</group>
<group>otherinfo</group>
<group>color</group>
</fieldgroups>
than add a field also named color in the color position.

I really happy to find out Flexicontent is so powerfull.
I want to design a a category templete as school table.
But I'm not good in PHP.
So I want to set fields as css class with jQuery to control every category items.

I tried to build my first template last day. :oops:
140.122.88.193/TIWC/index.php?op ... e&Itemid=4

Many Thanks!!
Last edit: 14 years 2 months ago by despair.

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

More
14 years 2 months ago #3441 by Linuus
Ok, so the template you want to create is a category template, where all the items are listed and when you click the item title you see the detailed view of the template. Correct?
And every item should have its own row color?

I guess you have duplicated the default template or something?

Do I understand correctly? :)

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

Moderators: vistamediajoomlacornerggppdk
Time to create page: 0.298 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