Forum

Thread tagged as: Question, Problem, Runway

Shared HTML Content in Layout in runway

Not sure what i am doing wrong but i am trying to get a shared content region and place it in a layout (dealing with the <header> section of my page. If i use the code based perch_content then i can see the region appear in the admin for a page (which i can make shared etc) but i need that region to be a html editor.

Followed the instructions to add TinyMCE, changed the tag to an inline one, but the region no longer shows up and no errors are returned, but no region either, and i can't seem to find if i can set the same properties on the perch_content to force the editor to be TinyMCE.

for clarity:

This gives me an editable region but can't force it to be HTML:

<?php perch_content('Header Phone'); ?>

This doesnt do anything:

<perch:content id="text" type="textarea" label="Header Phone" editor="tinymce" html="true" />

Also not sure if the docs i am looking at are for Perch or Runway, or if that even matters.

Roberto Modica

Roberto Modica 0 points

  • 6 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

Have you edited the content since changing the template?

Hi Drew,

I have refreshed the page but not directly edited any content.

I can get the region to show up if i use the code based tag, but the perch:content tag doesn't seem to do anything. This is specifically in a global layout.

Drew McLellan

Drew McLellan 2638 points
Perch Support

Can you show me the code that works, and then the code that doesn't?

Hi Drew,

sure its something i am doing wrong:

Works:

<header id="page-header">
  <a href="/" class="logo">Opalion</a>
  <nav class="primary">
       <?php
          // Main navigation
          perch_pages_navigation([
              'levels'=>1
          ]);
       ?>
   </nav>
   <div class="umbrella">
    <?php perch_content('Header Phone'); ?>
   </div>
   <?php
      perch_search_form()
   ?>
</header><!--/@page-->

Doesn't

<header id="page-header">
    <a href="/" class="logo">Opalion</a>
    <nav class="primary">
         <?php
            // Main navigation
            perch_pages_navigation([
                'levels'=>1
            ]);
         ?>
     </nav>
     <div class="umbrella">
        <perch:content id="text" type="textarea" label="Header Phone" editor="tinymce" html="true" />
     </div>
     <?php
        perch_search_form()
     ?>
</header><!--/@page-->
Drew McLellan

Drew McLellan 2638 points
Perch Support

That doesn't work because you're using a template tag in a page. Template tags go in templates.

See if this helps: https://docs.grabaperch.com/video/v/creating-a-perch-template/

Yep, that's it. Knew it was something i was doing.