Forum for discussing general topics related to Couch.
13 posts Page 1 of 2
Hi,

I am continuing through your tutorial, setting up the about page.

I have added the suitable tags to establish a template page and editable regions.

Was having trouble isolating the required div, so I have reloaded about.php file to start again, not happy with original code.

Now I cannot refresh about.php in the admin.

The new about.php file has NO open and closing tags, NOR tags for any editable region, yet it still shows the original editable region from my first attempt.

I have cleared the cache, refreshed the page, logged in and out multiple times, even restarted my computer.... it still shows the old editable region.
The new about.php file has NO open and closing tags
Please add the enclosing <?php require_once( 'couch/cms.php' ); ?> and <?php COUCH::invoke(); ?> to the new about.php to make Couch recognize it as a managed template.
After which, Couch will sense that the originally defined editable regions are missing and will prompt you to remove them.

Hope this helps.
Thanks,

I added those tags, but the admin still shows a previously defined editable area of text...

No prompt for edit tags and no edit tags in the html.

Just stuck ?
And you visited that template (in the same browser) while logged in as super-admin...?
I'd like to pick up this thread, because I constantly have this trouble while developing templates.

I'll create a template, visit the page as super-admin, and everything's good. Then I decide to make a change to the template. Let's say I change a region from type "text" to type "nicedit", or change the preview_width attribute for an image. Refresh the template page as super-admin again and... nothing. No changes in the admin panel or on the page.

At this point I'll just bump around blindly and eventually get something to work, but it really slows down the work flow, and I can't ever reproduce the magic formula. It's the same thing on my local machine and on an external server.

Things I've tried are quitting and restarting the browser; adding an intentional error to the page, refresh, fix the error, refresh again; turn off the computer entirely and start up again; remove the template file entirely and delete it from the admin panel. This last one is interesting because Couch then won't recognize the template at all unless I change it's name.

Clearly there's something I don't understand about modifying templates in Couch. Any information to help me understand what's going on would be appreciated.
@tim,

You sure seem to have to go to great lengths :!:

I cannot think of any reason, however, for this kind of problem (except, of course, not being logged-in as super-admin - but that I trust is not something you'd have missed).

The only time a comparable behaviour is seen is when one *deletes* existing fields.
It very often happens that even after refreshing the template, the deleted fields simply refuse to go away.
The reason for this is that 'deletion' takes effect *only* when you refresh a template in *page-view*.
An easy way of ensuring this is by clicking the magnifying glass icon next to any cloned page in admin-panel.

I suggest that next time you run into the same problem, please try the method mentioned above - i.e. go to the admin-panel and click the magnifying glass icon so as to visit a cloned page of the template (incidentally, this method also ensures that you visit the template as super-admin - something that is usually 99% of times the cause of this behaviour).

Hope this helps.
Of course, I've made quite certain that I'm logged in as super-admin. Is it possible that one or another of these things can be causing the issue:

    The page is not executable (executable="0")
    Pretty URLs are enabled
    editable regions contain data
    some sort of PHP caching on the server

To give a real world example, this particular template is currently resisting change. I've tried calling the page by name (site.com/news-column.php) and clicking the "View" button in the admin panel. It doesn't matter how major or trivial the change is, it isn't reflected in Couch. Not in the admin panel, and not on the generated page.

Code: Select all
<?php require_once( 'manage/cms.php' ); ?>

<cms:template title='News Column' executable='0' order='5' ><!-- BEGINNING OF COUCH CMS TEMPLATE -->

<cms:repeatable name="news_column" label='News Column' >
   <cms:editable name='heading' label="heading" col_width='180' type="text" />
   <cms:editable name='news_item'
      label='News Item'
      buttons='italic, bold, ol, ul, link, unlink'
      type='nicedit' col_width='250' />
   <cms:editable
        name="placement"
        label="Image Placement"
        opt_values='above| |below'
        type='radio'
        col_width='60' />
   <cms:editable name='item_image'
      label="Item Image"
      desc="max. 180 pixels wide"
      col_width='200'
      show_preview='1'
      input_width='195'
      type="image" />
</cms:repeatable>
</cms:template>   <!-- END OF COUCH CMS TEMPLATE -->

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

Thanks,
Tim

EDIT -->
On the same server, different site, executable template, Pretty URLs off: no trouble.
Tim,

Can you please grant me access to the site?
I'd like to see the problem for myself.

Thanks.
After playing with this some more, it seems like a problem with some sort of aggressive browser caching in combination with Pretty URLS. If I switch to a fresh computer, I can make changes normally once or twice. But eventually when I try to refresh the page, it seems to cycle through the Pretty URL version - site.com/news-column/ - without activating the actual page - site.com/news-column.php.

At least that's how it seems to me. I'll PM you so you can try it yourself.
Hi Tim,

Thanks for granting me access to your site.

I had a look at the problematic template you mentioned (news-column.php) and found the following behaviour -
PrettyURLs being on, accessing the template from the admin-panel always redirects to http://www.yoursite.com/news-column/. This is normal behaviour.
What follows is not.

http://www.yoursite.com/news-column/ always results in 404.
Which means that news-column.php never gets executed.
Which in turn means that any changes you do to the template cannot be picked up by Couch.

OK, so what caused the 404?
PrettyURLs rely on .htaccess.
I found that you have made some heavy modifications to your .htaccess.
This is usually fine but the statements below "#DO NOT EDIT BELOW THIS" should not be fiddled with.
However, I see that you have changed the order of the templates (your original .htaccess can be found on the server as .htaccess_orig where you can see this).

The .htaccess generated by Couch's gen_htaccess.php outputs the templates in a very strict sequence that cannot be changed.
Placing news-column.php at the wrong position caused the template never to be found and ergo the 404 error.

I regenerated the .htaccess and have tested everything for quite sometime.
All changes seem to be picked up as expected.

Please check and verify.

Thanks.
13 posts Page 1 of 2