Viewing 17 posts - 1 through 17 (of 17 total)
  • Author
    Posts
  • #190938

    Hello,

    I´m trying to inser html code on pages that I created using the Layout Builder, but how do I do that? I can’t find the html code for the page.

    What I want to accomplish is to insert the html code generated by the google webmaster tools (microdata markers) on the pages of my site.

    For eg.: <!– Microdata markup added by the wizard for structured data markup Google. –>

    Thanks.
    Fabiana.

    #191559

    Hey faterra!

    You can add a Text Block element under Content Elements and add your code on Text tab http://i.imgur.com/BovgEcZ.jpg

    Regards,
    Yigit

    #191574
    This reply has been marked as private.
    #192286

    Hey!

    You would need to edit those specific items throughout all of the theme files. There are already schema items in place for most things which is what it looks like you are asking but there is no one single place we could instruct you to add in things like that.

    If you feel it is a must-have for your site then you would need to look into a freelance developer to modify the theme files for you.

    Best regards,
    Devin

    #705496

    Hi,

    I really need to display pure HTML code on many posts, using all what you said is not a professionnal way to work, if by bad chance you switch back to Visual then back to Text in a Text Block, everything is bad .. I’ve read all posts talking about that, none of your solutions is acceptable.

    We are finishing our first version of CYJS open source Javascript framework – cyjs.fr – and I want to display tuto examples of how to use the framework, and I need to display sometimes HTML code, sometimes JS or PHP code. Currently I’m obliged to create PNG pictures done with screen captures of my code editor, that’s really not pro ! Ane a lot of time just to display 5 lines of text code …:(

    You know time is money, please could you just tell me which would be the best way to be able to insert HTML code in a post using enfold theme ? Modifying enfold PHP or JS files is not a problem, especially if I can put them in enfold-child.

    For example changing the Code Block element to be able to use it, that would mean I would ‘sacrify’ it’s primary goal to finally just display its content without any rendering. In such an example, which enfold files would be concerned ? Please just give me some advices and I will do. Sure if you make me save a lot of time by doing so, I will send you the modified files so you will give them to your other customers.

    Thanks, URGENT NOW ! ;)

    #705524

    Hi,

    The other option, is to convert your code to a function and a shortcode, so you can output it and never loose anything.

    Let us know if that works out for you.

    Thanks a lot

    Best regards,
    Basilis

    #705553

    Thanks, but that’s really not good for me. Imagine you are Dennis Ritchie and you want to explain how to program in C language and give that job to an assistant, you need to show lot of codes examples but that assistant is just aboe to write some posts…
    I need something easy to use for an end user. Some other powerful themes can do this, but I don’t have time to know another one…
    The idea I suggest is the only one possible, except if you plan to create a new widget that would work like the block text widget but without any enfold rendering.
    We are a lot of users with that boring problem…

    #705650

    Hi,

    Try to use this plugin: https://wordpress.org/plugins/syntaxhighlighter/
    Here is how it is used: https://en.support.wordpress.com/code/posting-source-code/

    You just need to use the text block, then use the shortcode of the plugin. Hope this workaround helps :)

    Best regards,
    Nikko

    #705703

    I’m sorry, it’s not working : I wrote this in a post in a text block :

    Exemple :
    [ code language=”html”]
    <div class=”cell”></div>
    [/code]

    The <div> is not displayed…

    #705771

    Hi,

    Please post us your login credentials (in the “private data” field), so we can take a look at your backend.

    Login credentials include:

    • The URL to the login screen.
    • A valid username (with full administration capabilities).
    • As well as a password for that username.
    • permission to deactivate plugins if necessary.

    Best regards,
    Nikko

    #705850

    Finally it’s working, but not perfect …:(
    That plugin does not work well on existing text objects, it is necessary to empty, save, then create the text again. Then after it is possible to create a [code] behavior.is ok.
    But you loose a lot of time even, because that plugin inserts white lines at each edition, and when you use a self tag like <mytag> it replaces < and > by their corresponding html encoding ..:( ..
    And finally when you swtich from visual to text then back to visual, all < and > are changed …

    So thanks for the idea, that plugin is better than nothing, but when you have a lot a code to show it’s not pro at all, sorry.

    Any other idea ?

    #705885

    Hi!

    We can not do much regarding that.
    The switching is a well known issue that exist on WordPress, so it has to be avoided.
    If you use ALB, please keep working based on that and do not change it.

    Hope you understand

    Cheers!
    Basilis

    #705901

    hum, what is ALB ?

    #705915

    Hi!

    It is the Advanced LAyout Builder you are using, inside Enfold! :)

    Regards,
    Basilis

    #706086

    Well, I spent my whole Sunday to test all existing code highlight plugins on WordPress, and I’m sorry to say that NO ONE is working with Enfold.
    And I’m 100% sure the problem comes from Enfold,

    And when I mean working, I mean working a professionnal way.

    Many plugins work only at the first item edition. Example : in a text block with Syntxhighlighter plugin, I put some HTML code to display, I save immedialty, it works, then I come back to update the HTML example code and the Enfold editor has destroy everything by adding some & and so on … And the problem come also with Prism WP, Enlighter, Crayon Syntax Highlighter, Code Snippets CPT … All these work fine with a standard WP theme.

    So I’m not happy to conclude by saying that Enfold is NOT COMPATIBLE with code display since its integrated editor damage everything. Everything that is said in the different posts is not working properly. I have a lot of code to display, the only solution for now is to use another theme.

    As I have suggested, a possible way would be to provide a widget that would as least garantee a non-rendering, for example a shortcode as [mycode]anything here with html code or tabs or any blabla[/mycode] that would display EXACTLY what is written WITHOUT any interpretation. Or at least could you give me some quick informations for me to be quickly able to change the behavior of an existing widgets ?

    Thanks to all team for help.

    • This reply was modified 8 years ago by luke7263.
    #706650

    I finally find an acceptable solution with Code Snippet CPT plugin.
    That one is not famous, a bit buggy, but it is the only one working with Enfold advanced editor.
    The main difference is that it creates its own posts to store your different codes so the displayed code is not included in the post when editing a post, that’s the reason why Enfold editor cannot damage it.
    I really suggest it to people who need to display a lot of code, it handle all current languages.

    1. – So first install that plugin, I personnaly installed version 2.0.8, only 200 installed but it makes the job.
    2. – then add CSS code to improve display :
      
      pre.prettyprint {
        line-height: 15px;
        font-size: 14px;
        font-family: Consolas;
      }
      pre.prettyprint.linenums {
          padding-left: 1.5em !important;
      }
      pre.ol {
        list-style: none;
      }
      .snippet-buttons {
        display: none;
      }
      li.L1, li.L3, li.L5, li.L7, li.L9 {
          background: unset !important;
      } </li>
      
    3. – there is a boring height calculation bug when creating a new code directly from the editor, so you have to create the code directly from the plugin menu. I will correct it maybe a day when I’ll have time ..:(
    4. An example of the result here -> http://cyjs.fr/multilingual

    • This reply was modified 8 years ago by luke7263.
    #706890

    Hi luke7263,

    Thanks for sharing the solution :)

    Best regards,
    Nikko

Viewing 17 posts - 1 through 17 (of 17 total)
  • The topic ‘How to insert HTML code – Layout Builder’ is closed to new replies.