Invision Community 4: SEO, prepare for v5 and dormant account notifications By Matt Monday at 02:04 PM
adcantu Posted June 8, 2017 Posted June 8, 2017 Hello I have created a pages database and made a text area field allowing raw html. Only a specific trusted group will have access to edit the articles in the database. However I noticed I am not able to use php in the html. For example I can't call theme resource images. Is there a way to get this to work? Another example, I wanted to use an array as well like in the example here {{$servers = array('192.223.28.120:27014' => "Operation", '192.223.28.120:27015' => "Realism", '192.223.28.120:27016' => "Tactical Co-Op", '192.223.28.120:27017' => "Training", '192.223.28.120:27018' => "Day of Infamy", '192.223.28.120:27019' => "Fun Co-Op");}} <ul class='ipsList_inline> {{foreach $servers as $ip => $title}} <li> {$title} : {$ip} </li> {{endforeach}} </ul> My code gets printed as text only though.
Jim M Posted June 8, 2017 Posted June 8, 2017 Sorry, it is not possible to utilize PHP in the editor. To add images to the editor is fairly easy and does not require PHP. If you're looking to utilize the same image over and over again in the same spot. You may want to utilize a template (where you can use PHP) and some sort of dropdown as a database field to signify which image is used in that spot.
opentype Posted June 8, 2017 Posted June 8, 2017 As suggested, just create your own versions of the Pages templates the database uses. Within those templates, you can do whatever you need. It wouldn’t be very elegant (or secure) to put these things in an editor field.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.