Results 1 to 5 of 5

Thread: inserting <?php ?> tag in an Element

  1. #1
    New user
    Join Date
    07-28-15.
    Posts
    2

    Unglücklich inserting <?php ?> tag in an Element

    I have tried to add a <?php ?> tag in an element but always it get commented like if wrote

    Code:
    <?php echo "hello"; ?>
    it becomes

    Code:
    <!--?php echo "hello"; ?-->

  2. #2
    User Andreas's Avatar
    Join Date
    07-11-09.
    Location
    Mönchengladbach
    Posts
    499

    Default

    Where exactly did you insert that code?
    Web-Development, Freelancer, Burgtech, XHTML, HTML5, CSS, PHP, Javascript, MooTools, MySQL and more
    Amazon wishlist

  3. #3
    New user
    Join Date
    07-28-15.
    Posts
    2

    Default

    Quote Originally Posted by Andreas View Post
    Where exactly did you insert that code?
    I tried adding it in the text editor of new page , new element , in Site Structure

  4. #4
    User Spooky's Avatar
    Join Date
    01-03-13.
    Posts
    339

    Default

    You can use PHP code only in PHP files or in Templates, not in any text fields of content elements, modules, articles etc.

  5. #5
    User Andreas's Avatar
    Join Date
    07-11-09.
    Location
    Mönchengladbach
    Posts
    499

    Default

    As Spooky says, and you can import PHP into the BE e.g. into the RTE with an insert tag
    Code:
    {{file::myPHP.html5}}
    {{file::myPHP.php}}
    https://docs.contao.org/books/manual...clude-elements

    ps My FF 39 did not scroll to the anchor #include-elements, chrome does. Don't know why.
    Last edited by Andreas; 07/29/2015 at 16:21.
    Web-Development, Freelancer, Burgtech, XHTML, HTML5, CSS, PHP, Javascript, MooTools, MySQL and more
    Amazon wishlist

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •