Add php in Item HTML parameter

More
12 years 10 months ago #35598 by bendeb
Hello,

It will be nice if we can add some php in Item HTML parameter (List Creation (Frontend Views), of relation field for example, but others too).

At the time being, we are limited to put only html and some predefined tags.
For the application I have to do, I need to put some php instructions in this area, but for now it don't works.

Is that possible to add this feature ?

Thank you. :)

Flexicontent 4.1.0b1
Joomla 3.9.18

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

More
12 years 10 months ago #35603 by ggppdk
something like ?:
{{:: ... ::}}

Maybe the above, would work, without making the regular expression parsing to fail, we already have execution of PHP code in modules.

Note that this means that anyone having access to fields will have potentially ability to do anything in the site, (now this applies for our modules)


-- 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
12 years 10 months ago #35608 by bendeb
You said that I can put php code within {{:: my php here ::}} tags ?
I tried it, but it doesn't work :
Code:
{{::<?php echo 'blablabla'; ?>::}}

Flexicontent 4.1.0b1
Joomla 3.9.18

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

More
12 years 10 months ago #35610 by ggppdk
Hello, i am sorry for the confusion,

i was thinking that this syntax might be good for regular expression matching , if we add

Not sure , this will mean that anyone having access to fields can do anything in the website


-- 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
12 years 10 months ago #35612 by bendeb
OK.
But I'm the only user that can access to fields parameters, so it's not dangerous (in my case).
But generally, the users we allowed to edit fields are trustworthy, no ?
Most often, they are administrators or managers.

Flexicontent 4.1.0b1
Joomla 3.9.18

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

More
12 years 10 months ago #35618 by micker
You can use this
extensions.netassopro.com/5-exte ... codeinsert

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
12 years 10 months ago #35638 by bendeb
Thank Micker.
I look this, and I will tell you. :)
But it seems this plugins can't do what I have to do.

In fact, I have to put some php code in the Item HTML of relation field, because this custom HTML is repeated for each relation item choosen.

At this time, I put this in my custom HTML of my relation field :
Code:
<tr><td>{{title}}</td><td>{{field1}}</td><td>{{field2}}</td><td>{{field3}}</td></tr>

And here is the code in my template (item.php) :
Code:
<table><tbody><tr><th>Title</th><th>Field1</th> <th>Field2</th><th>Field3</th></tr> <?php echo $this->fields['my_relation_field']->display;?> </tbody> </table>

So, when I choose a related item, it display with its values in a table and it's great.
But now, I want to add another column with some php code for each related item. Like this :
Code:
<tr><td>{{title}}</td><td>{{field1}}</td><td>{{field2}}</td><td>{{field3}}</td><td>--SOME PHP CODE--</td></tr>

In this case, the php code could repeat itself for each item. :)

I don't know if I'm understandable. :?

Flexicontent 4.1.0b1
Joomla 3.9.18

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

More
12 years 10 months ago #35644 by bendeb
I tried the plugin, and maybe it could do what I want but it seems there is a problem.
In the field parameters, if a choose Langage HTML, it works, but if I choose Langage PHP, I have this error in frontend :

Notice: Undefined property: stdClass::$display in ...\components\com_flexicontent\templates\my_template\item.php on line 222

Line 222 is the displaying of the field :
Code:
<b>Code :</b> <?php echo $this->fields['code']->display; ?>

So, for now, I don't know if this plugin will help me for what I have to do, but maybe yes. :?

I use the latest version of Flexicontent (r1659 for Joomla 2.5).

Flexicontent 4.1.0b1
Joomla 3.9.18

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

More
12 years 10 months ago #35645 by ggppdk
Hello,
A solution now
is to use:
ReReplacer + Sourcer from Nonumber extensions

These will allow you to replace specific text with the execution of PHP code

- Negative , it is a little slower than implementing this inside FLEXIcontent CORE
- Positive you add replacement anywhere !!
- NOTE: the more replacement you add the slower it gets, so use only what is needed (a small number of replacements will not harm performance !!)

Regards


-- 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
12 years 10 months ago #35646 by bendeb
Thank ggppdk.
I will try this method and say you if it's good. :)

Flexicontent 4.1.0b1
Joomla 3.9.18

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