Formatting Field Content

More
7 years 2 months ago - 7 years 2 months ago #69505 by madone
Hello,
On latest version 3.2.1.2 of flexicontent, I am trying to display a field within a universal module. This works great, but how can I best format the content of that field so that alternate lines are swapping colours. For example 5 lines of content, lines 1, 3 & 5 are yellow, lines 2 & 4 are blue.

I understand this must be within custom CSS of a flexi template, which I have and probably in the item.css, but not sure how to tackle this.

Your assistance is much appreciated as always.
Last edit: 7 years 2 months ago by ggppdk.

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

More
7 years 2 months ago #69506 by ggppdk
Replied by ggppdk on topic Formatting Field Content
Hello

so in universal content module,
you have select in its configuration to use the "news" layout ?


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...

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

More
7 years 2 months ago #69507 by madone
Replied by madone on topic Formatting Field Content
Hello,

Yes, it is using a copy of the original news template that is slightly modified.

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

More
7 years 2 months ago - 7 years 2 months ago #69515 by ggppdk
Replied by ggppdk on topic Formatting Field Content
Hello

the layout will add classes
Code:
odd even

so if you are using
Code:
news
layout you can use
Code:
.news.mod_flexicontent_wrapper .mod_flexicontent .mod_flexicontent_featured_wrapper.odd, .news.mod_flexicontent_wrapper .mod_flexicontent .mod_flexicontent_standard_wrapper.odd { background: #FFFFFF; } .news.mod_flexicontent_wrapper .mod_flexicontent .mod_flexicontent_featured_wrapper.even, .news.mod_flexicontent_wrapper .mod_flexicontent .mod_flexicontent_standard_wrapper.even { background: #F0F0F0; }

if your custom layout is name 'mynews'
then replace
Code:
.news
with
Code:
.mynews


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...
Last edit: 7 years 2 months ago by ggppdk.
The following user(s) said Thank You: madone

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

More
7 years 2 months ago - 7 years 2 months ago #69540 by madone
Replied by madone on topic Formatting Field Content
Hello,

Thank you for this. However, this does the background in one colour. The field is Text with multiple values. Both odd and even have different background allocated.

I seems that only .odd css is applied for the background colour. Even is never used when inspecting the code. The value list in the field configuration is set for Line Break .

Do I need to allocate a css type to the field? I was under the impression that flexi takes care of that.
Last edit: 7 years 2 months ago by madone.

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

More
7 years 2 months ago #69544 by ggppdk
Replied by ggppdk on topic Formatting Field Content
Hello

The field is Text with multiple values


I miss read your original question

- i was talking about the items shown by universal module,
you are talking about multiple values of the same field

Your question is a general CSS question

please go to field configuration
and use

open tag:
Code:
<div class="alternate_colors">

close tag:
Code:
</div>

value prefix:
Code:
<div>

value suffix:
Code:
</div>

and then add the
custom.css of your Joomla template
Code:
div.alternate_colors:nth-child(odd) { background: #FFFFFF; } div.alternate_colors:nth-child(even) { background: #FFFFFF; }


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...

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

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