Results 1 to 12 of 12

Thread: html code in News

  1. #1
    New user
    Join Date
    06-26-09.
    Posts
    9

    Default html code in News

    Hello,

    how is it possible to add html code to news article? without insert tags...

    i need to add simple html code but as soo as i add it the editor just removes it..

    thank you

  2. #2
    Experienced user
    Join Date
    06-20-09.
    Posts
    1,311

    Default Re: html code in News

    In Settings there is a list of allowed tags.
    Double check all the tags you are trying to add are in this list.

  3. #3
    New user
    Join Date
    06-26-09.
    Posts
    9

    Default Re: html code in News

    no unfortunately the tags are allowed... and it works in articles, but doesnt work(eliminated) from the news...

  4. #4
    Community-Moderator xchs's Avatar
    Join Date
    06-19-09.
    Posts
    1,287

    Default Re: html code in News

    There are "valid elements" and "extended valid elements" in the TinyMCE configuration. All other HTML elements are stripped.
    Contao Community Moderator
    → Support options

  5. #5
    New user
    Join Date
    06-26-09.
    Posts
    9

    Default Re: html code in News

    thank you!

    is it possible to add some tags to tinymce? where the file to edit?

  6. #6
    Community-Moderator xchs's Avatar
    Join Date
    06-19-09.
    Posts
    1,287

    Default Re: html code in News

    Can you post the code snippet that you are trying to insert?
    Contao Community Moderator
    → Support options

  7. #7
    New user
    Join Date
    06-26-09.
    Posts
    9

    Default Re: html code in News

    it's just simple facebook like button that i need to put on each news item
    with code
    <iframe src="........."></iframe> or
    <div class="fb-like" data-href="site.ru" data-send="true" data-width="450" data-show-faces="true"></div>

  8. #8
    Community-Moderator xchs's Avatar
    Join Date
    06-19-09.
    Posts
    1,287

    Default Re: html code in News

    You can try to add to the TinyMCE configuration file "system/config/tinyMCE.php" the <iframe> tag to the list of "extended valid elements":

    Code:
    extended_valid_elements : "q[cite|class|title],article,section,hgroup,figure,figcaption,iframe[src|style|width|height|scrolling|marginwidth|marginheight|frameborder]",
    Contao Community Moderator
    → Support options

  9. #9
    New user
    Join Date
    06-26-09.
    Posts
    9

    Default Re: html code in News

    thank you! looks like it working...
    but after i added the tag to .php file the tinyMCE editor no longer is shown in the backend... only plain html window.

  10. #10
    Community-Moderator xchs's Avatar
    Join Date
    06-19-09.
    Posts
    1,287

    Default Re: html code in News

    Maybe you've done something wrong!? I have attached a modified TinyMCE configuration file where I added the <iframe> tag. Try to replace your file with this one.

    Another possibility would be:

    1. Create a new file "fblike.php" in the Contao templates directory "[TL_ROOT]/templates"
      [/*:m:33wo20te]
    2. Insert there the Facebook Like button code:
      Code:
      <iframe src="//www.facebook.com/plugins/like.php?href=http%3A%2F%2Fexample.com%2Fpage%2Fto%2Flike&amp;send=false&amp;layout=standard&amp;width=450&amp;show_faces=false&amp;action=like&amp;colorscheme=light&amp;height=35" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:450px; height:35px;" allowTransparency="true"></iframe>
      If you prefer to use the HTML5 code snippet instead then add the following code to the "fblike.php" file:
      Code:
      <div id="fb-root"></div>
      <script>(function(d, s, id) {
        var js, fjs = d.getElementsByTagName(s)[0];
        if (d.getElementById(id)) return;
        js = d.createElement(s); js.id = id;
        js.src = "//connect.facebook.net/de_DE/all.js#xfbml=1";
        fjs.parentNode.insertBefore(js, fjs);
      }(document, 'script', 'facebook-jssdk'));</script>
      <div class="fb-like" data-send="false" data-layout="standard" data-width="450" data-show-faces="false" data-action="like" data-colorscheme="light"></div>
      [/*:m:33wo20te]
    3. Include the code snippet in your news article via the file insert tag
      Code:
      {{file::fblike.php}}
      [/*:m:33wo20te]


    Contao Community Moderator
    → Support options

  11. #11
    Community-Moderator xchs's Avatar
    Join Date
    06-19-09.
    Posts
    1,287

    Default Re: html code in News

    I found another tutorial that describes the Facebook integration.
    Contao Community Moderator
    → Support options

  12. #12
    New user
    Join Date
    02-23-10.
    Posts
    10

    Default Re: html code in News

    This is a cool method xchs, I used your method to put up a few on my website's header. Thanks for this method.

    [attachment=0:2agn7ew4]CONTAO-ID.PNG[/attachment:2agn7ew4]

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
  •