Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #416465

    Hi, Maybe this topic has already been discussed, but i don’t find it, neither by searching in this forum neither anywhere.

    My problem. Except using the “code block” available in content element, i try to paste a sample of code (xml for example) in order it’s readable by every one.
    Like “code block”.

    But my problem is:
    actually i use the accordion tool, and i want that one of my items contains a sample of code.
    When i paste my code as text, this one is correctly written.

    Example, if i write in visual mode <p>, it will be correctly written like this <p>
    When i publish my page then i look at it, there is no problem.

    When i come back, in my page, my <p> or <p> have completely disappeared.

    my impression is, that “enfold theme” considers that is full html and not html written with special characters.

    Have you got a solution ? or a different way to put a code block in the accordion tool ?

    Thanks in advance

    #416568

    i try to add this directly in the accordion tabs.
    but no way, when, i publish my page and i come back to edit it all is disapeared

    i try to write this:

    [av_codeblock wrapper_element='' wrapper_element_attributes='']
    <?xml version=”1.0″ encoding=”UTF-8″ standalone=”yes”?>
    <xs:schema version=”1.0″ xmlns:xs=”http://www.w3.org/2001/XMLSchema”&gt;

    <xs:element name=”Report” type=”orderReportModel”></xs:element>

    </xs:schema>
    [/av_codeblock]

    #417257

    Hey!

    You’ll need to use the default editor and then type your code out inside the accordion like so.

    [av_toggle_container initial='0' mode='accordion' sort='']
    [av_toggle title='Toggle 1' tags='']
    <pre>Here is some code</pre>
    [/av_toggle]
    [av_toggle title='Toggle 2' tags='']
    Toggle Content goes here
    [/av_toggle]
    [/av_toggle_container]

    Or if you want to use the advanced layout editor then you can try doing this, http://kriesi.at/documentation/enfold/enable-advanced-layout-builder-debug/, and then type your code out inside the accordion shortcode that you see in the debug view.

    Regards,
    Elliott

    #417706

    Hi thanks,

    It’s what i jave already done but.
    When i try to put some xml code snipped.
    All code disapeared when i publish my page.

    #418656

    Hi!

    Paste the code your using here and we’ll test it on our end.

    Best regards,
    Elliott

    #418691

    I found an alternative solution using the advanced-layout-builder-debug.
    But now i have to use exclusivly it for this kind of page.

    [av_toggle_container initial='0' mode='accordion' sort='']
    [av_toggle title='my title' tags='']
    [av_codeblock wrapper_element='pre' wrapper_element_attributes='' escape_html='aviaTBescape_html']
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
     <xs:schema version="1.0" xmlns:xs="http://www.w3.org/2001/XMLSchema">
       <xs:element name="sales" type="sample"></xs:element>
       <xs:complexType name="sample">
         <xs:sequence>
           <xs:element name="shopName" type="xs:string" nillable="true"></xs:element>
           <xs:element name="zipCode" type="xs:int"></xs:element>
           <xs:element name="day" type="xs:dateTime" nillable="true"></xs:element>
           <xs:element name="items" type="salesItem" nillable="true" minOccurs="0" maxOccurs="unbounded"></xs:element>
         </xs:sequence>
       </xs:complexType>
       <xs:complexType name="salesItem">
         <xs:sequence>
           <xs:element name="articleName" type="xs:string" nillable="true"></xs:element>
           <xs:element name="category" type="category" nillable="true"></xs:element>
           <xs:element name="price" type="xs:double"></xs:element>
           <xs:element name="runningTotal" type="xs:double"></xs:element>
         </xs:sequence>
       </xs:complexType>
        <xs:simpleType name="category">
         <xs:restriction base="xs:string">
           <xs:enumeration value="Furniture"></xs:enumeration>
           <xs:enumeration value="Art"></xs:enumeration>
           <xs:enumeration value="Supplies"></xs:enumeration>
           <xs:enumeration value="Travelling"></xs:enumeration>
         </xs:restriction>
       </xs:simpleType> 
     </xs:schema>
    [/av_codeblock]
    [/av_toggle]
    [/av_toggle_container]
    #418695

    Do you think an update will come with this problem corrected ?

    I mean, you can use the < pre > tag to write code snipped (C#, Java, Cobol, php) , but you can put neither html code neither xml code in it.
    The only solution i find is to use my solution. Then be careful cause you cant use the advanced layout editor anymore, you must to write directly in the advanced-layout-builder-debug to modify it

    • This reply was modified 10 years, 3 months ago by barthvader.
    #418706

    If you try without the [av_codeblock] tag,
    you will see that xml disappeared when you publish then return to your page in order to edit it.

    Try this

    [av_toggle_container initial='0' mode='accordion' sort='']
    [av_toggle title='my title' tags='']
    <pre>
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
     <xs:schema version="1.0" xmlns:xs="http://www.w3.org/2001/XMLSchema">
       <xs:element name="sales" type="sample"></xs:element>
       <xs:complexType name="sample">
         <xs:sequence>
           <xs:element name="shopName" type="xs:string" nillable="true"></xs:element>
           <xs:element name="zipCode" type="xs:int"></xs:element>
           <xs:element name="day" type="xs:dateTime" nillable="true"></xs:element>
           <xs:element name="items" type="salesItem" nillable="true" minOccurs="0" maxOccurs="unbounded"></xs:element>
         </xs:sequence>
       </xs:complexType>
       <xs:complexType name="salesItem">
         <xs:sequence>
           <xs:element name="articleName" type="xs:string" nillable="true"></xs:element>
           <xs:element name="category" type="category" nillable="true"></xs:element>
           <xs:element name="price" type="xs:double"></xs:element>
           <xs:element name="runningTotal" type="xs:double"></xs:element>
         </xs:sequence>
       </xs:complexType>
        <xs:simpleType name="category">
         <xs:restriction base="xs:string">
           <xs:enumeration value="Furniture"></xs:enumeration>
           <xs:enumeration value="Art"></xs:enumeration>
           <xs:enumeration value="Supplies"></xs:enumeration>
           <xs:enumeration value="Travelling"></xs:enumeration>
         </xs:restriction>
       </xs:simpleType> 
     </xs:schema>
    <pre>
    [/av_toggle]
    [/av_toggle_container]
    • This reply was modified 10 years, 3 months ago by barthvader.
    #419555

    Hi!

    It’s working fine on my end. Make sure you check the “Escape HTML Code” option in the codeblock element.

    Regards,
    Elliott

    #421019

    Hi

    Yes i did ! Escape HTML code is checked.
    Let me try to explain
    – code block tool is working fine
    – accordion tool is working fine
    But if you want to put some code block short code with XML in the accordion tools:
    Put some XML code block into a toggle of an accordion
    it’s working fine but :
    When you save your page, publish it, and finally edit again the accordion tools, XML has completely disappeared.
    Where is my XML ?

    Regards.

    #422015

    Hey!

    Oh I see. In this case you’ll need to escape your code. You can use a tool such as this, http://www.freeformatter.com/html-escape.html.

    Cheers!
    Elliott

    #422057

    Hi,
    Thanks for that solution.
    Unfortunately it’s exactly the same problem when you save, publish then return to edit the page all xml code has disappeared.
    With this tool the disadvantage more, is that it does not preserve neither spaces neither tabs.
    For the moment i have to keep my solution and must write directly with the advanced-layout-builder-debug to modify it.

    Thanks anyway

    Maybe a correction in a next update

    Barth.

Viewing 12 posts - 1 through 12 (of 12 total)
  • The topic ‘problem with "paste as text" function’ is closed to new replies.