Problems, need help? Have a tip or advice? Post it here.
4 posts Page 1 of 1
Hello.

I have globals.php file with the code:
Code: Select all
<?php require_once( '../../manage/cms.php' ); ?>

<cms:template title='Globals' executable='0'>

<cms:repeatable name='r1'  >
   <cms:editable name='p1' type='text' />
</cms:repeatable>

</cms:template>

<?php COUCH::invoke(); ?>


I have registered globals.php with super-admin. The template is visible and I can add repeatable text.

I want to show those repeatable region in index.php file. My code is:
Code: Select all
<cms:pages masterpage='globals.php'>
  <cms:show_repeatable 'r1'>
       <cms:show p1/><br />
  </cms:show_repeatable>
</cms:pages>


With tihs I get error:
Error: masterpage: "globals.php" not found

I have also tried different approach :
Code: Select all
<cms:show_repeatable 'r1'>
  <cms:get_custom_field 'p1' masterpage='globals.php' />
</cms:show_repeatable>


But this returns blank values !?

What am I missing ?

Thank you!
Hi jz,

From the way you have included Couch to your template -
<?php require_once( '../../manage/cms.php' ); ?>

- it is clear that the template resides two folders deep from your site's root.

Assuming that the two folders are /first/second/, the name of the template will now become 'first/second/globals.php' and your code will now become
Code: Select all
<cms:pages masterpage='first/second/globals.php'>
  <cms:show_repeatable 'r1'>
       <cms:show p1/><br />
  </cms:show_repeatable>
</cms:pages>

HINT: If in any doubt about a template's name (as understood by Couch) hover your mouse over the template's entry in the sidebar of the admin-panel - a tooltip will show the name.

Hope this helps.
Thank you ! That was it. Since I will be using globals.php for different applications I have moved the file to root folder.

It is working now! Thanks again !
You are welcome, jz :)
4 posts Page 1 of 1
cron