New kind of articles, same format

More
7 years 10 months ago #72669 by hervemlam
Dear George,

At this stage I've already got my template, based on a copy of 'blog'. You can see it in my website homepage , just below the carrousel.
I only want to highlight some specific items in the list with a special background colour.

My issue is the CSS hierarchy:
1. #flexicontent ul.introblock > li { background: none [from my template category.less]
2. fcodd and fceven { background-color: something [from components\com_flexicontent\assets\css\flexicontent.css]
3. #flexicontent .Interview { background-color: specific [from my template category.less]

Could I modify this hierarchy?


And another question:
Is it possible, in the "opening text" of a field, to test the value of another field?
I tried this below, but it seems php code isn't taken into account:
Code:
<span id="<?php echo if ($item->fields['specific']->value=='1') echo 'itw_'; ?>my_field" class="flexi label field_my_field"><script type="text/javascript">document.write(Joomla.JText._('<?php if ($item->fields['specific']->value=='1') echo 'ITW_'; ?>MY_LABEL'));</script></span><br />

Regards,
HervE

PHP 8.1.16
Joomla! 4.3.3
FLEXIcontent 4.1.5

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

More
7 years 10 months ago #72678 by micker
yes only in template not in field option

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.

More
7 years 10 months ago #72679 by ggppdk
Hello

about modifying the structure of your custom category layout file,
of course you can do anything you want with it to match the desired result

about accessing the raw field values
you can use
Code:
$item->fieldvalues[45]

where 45 is the ID of the field that you want to access its value
e.g. in your case
Code:
if ( !empty($item->fieldvalues[45]) && $item->fieldvalues[45][0] == '1') { echo "value for field no 45 is 1"; }


-- 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.

More
7 years 10 months ago - 7 years 10 months ago #72682 by hervemlam
Thank you both for your answers.

ggppdk wrote: about modifying the structure of your custom category layout file,
of course you can do anything you want with it to match the desired result

OK, but how can I modify the CSS class hierarchy? (I may be too ignorant in CSS, but what defines which css file is used in priority to another?)

about accessing the raw field values
you can use

Code:
$item->fieldvalues[45]

where 45 is the ID of the field that you want to access its value
e.g. in your case
Code:
if ( !empty($item->fieldvalues[45]) && $item->fieldvalues[45][0] == '1') { echo "value for field no 45 is 1"; }

Looks nice, but I'm afraid it doesn't work: like micker just confirmed, it seems to me PHP code cannot be used in "Opening text for Filed". So what could I do? i must admit I have no idea at the moment.

HervE

PHP 8.1.16
Joomla! 4.3.3
FLEXIcontent 4.1.5
Last edit: 7 years 10 months ago by hervemlam.

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

More
7 years 10 months ago #72686 by ggppdk
Hello

you can use inside
- category_items.php (the layout file of your category view template)
- value_mylayout1.php (a custom layout file for your field)


-- 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
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