php in prefix/suffix value of a field ?

More
2 years 8 months ago #81981 by bendeb
Hello,
I tried it without success, so I think it's not possible, but is there a way to put some php in prefix/suffix value of a field ? (in field paramaters >>> Viewing >>> Value list >>> Every value prefix/Every value suffix)

It will very nice if we can do it.

For example, to add these condition in "Every value prefix" :
Code:
<div class="<?php if ($item->fields['my_field']->display ==NULL) {echo 'class_1'} else {echo 'class_2''}?>">

Then "</div>" for "Every value suffix"

Thank for your answer.

Regards.


 

Flexicontent 4.1.0b1
Joomla 3.9.18

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

More
2 years 8 months ago #81990 by bendeb
In a normal php file, we can add some php in class, like this :
Code:
<div class="<?php echo 'text';?>">

But it doesn't work if we write this in suffix/prefix values. Maybe I missed something.

Flexicontent 4.1.0b1
Joomla 3.9.18

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

More
2 years 8 months ago #81997 by micker
Hello no its not possible to write PHP in préfixe and suffixe
Its only possible in template

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
2 years 8 months ago - 2 years 8 months ago #81999 by ggppdk
Hello

as micker said, you need create a custom layout

Duplicate file
/tmpl/value_default.php
as
/tmpl/value_mycustomname1.php

Customize the php code of the file
and select layout "mycustomname1" in field's configuration


-- 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: 2 years 8 months ago by ggppdk.

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

More
2 years 8 months ago #82005 by bendeb
OK.
Thank for your answer.

Flexicontent 4.1.0b1
Joomla 3.9.18

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

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