Editors are able to choose and order elements whichever way they like on the publish page – this is then directly reflected on the front-end via the template code. Let’s say your editor adds the following content to the publish page:

  • heading 1
  • textarea
  • heading 2
  • textarea
  • heading 3
  • textarea
  • code
  • heading 2
  • textarea
  • heading 3
  • gallery

In order to display these elements on the front-end, all you have to do is include each of the element types you want to display — only once. For example, in order to display the above, you would you have to include the following elements in your code: heading, textarea, code, table and gallery. You can use the following code to do so:

{exp:channel:entries channel="my_custom_channel"}
    {my_content_elements}
        {heading}
	    {value}
        {/heading}

        {textarea}
            {value}
        {/textarea}
        {code}
            {value}
        {/code}

        {gallery}
        {/gallery}
    {/my_content_elements}
{/exp:channel:entries}
Leave Comment

Your email address will not be published. Required fields are marked *

clear formSubmit