Jump to content

Use php in database article


adcantu

Recommended Posts

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...