Formatting Field Content

7 months 1 week ago - 7 months 1 week 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.

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

7 months 1 week ago #69506 by ggppdk
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 review. Thanks!

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

7 months 1 week ago #69507 by madone
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.

7 months 1 week ago - 7 months 1 week ago #69515 by ggppdk
Hello

the layout will add classes
odd
even

so if you are using
news
layout you can use
.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
.news
with
.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 review. Thanks!
The following user(s) said Thank You: madone

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

7 months 5 days ago - 7 months 5 days ago #69540 by madone
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.

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

7 months 5 days ago #69544 by ggppdk
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:
<div class="alternate_colors">

close tag:
</div>

value prefix:
<div>

value suffix:
</div>

and then add the
custom.css of your Joomla template
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 review. Thanks!

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

Moderators: vistamediajoomlacornerggppdk
© 2018 Flexicontent. All Rights Reserved.