Problems, need help? Have a tip or advice? Post it here.
9 posts Page 1 of 1
I've run into a rather puzzling little quirk, where previously added cms:editable fields still show up even though they've been deleted from the template. I have a clonable page called 'training.php'. In my first pass of this, I had a cms:editable field with the name 'title', forgetting that Couch automatically gives you one already. So I deleted it from the template and activated my changes. But when I go to add a new cloned page from the template in the admin area, I find that my entry form has two title fields, so the old one is obviously still there. How do I completely clear this and flush all the changes?
This can happen if somehow you had a relation editable on the template. Please, revisit as super-admin a cloned page also, not only template. This can be done by 'view' button or clicking on magnifying glass in list of cloned pages. Any page would be just enough. After that refresh the page in admin panel and the editable should be marked for deletion.
As a side note, there is nothing wrong in having an editable named 'title' :)
Join COUCH:TALK channel here https://t.me/couchcms_chat
Ryazania — a framework to boost productivity with Add-ons viewtopic.php?f=2&t=13475
Support my efforts to help the community https://boosty.to/trendo/donate
Thanks for that, I'll remember it for next time. In the meantime I deleted the page and created it afresh, which worked OK.

As regards having an editable named 'title', doesn't that mean you automatically have two fields of the same name?
As regards having an editable named 'title', doesn't that mean you automatically have two fields of the same name?
The name of the system title field is actually 'k_page_title'. Couch wouldn't allow you to create a custom editable region of this name so no worries about two fields with the same name.
But in the admin area, k_page_title is automatically displayed with the label 'Title', as would a separate 'title' field, unless one chose a different label for it (in which case there would probably be no point naming it 'title' in the first place). This is potentially confusing for the user.
Johnny2R wrote: But in the admin area, k_page_title is automatically displayed with the label 'Title', as would a separate 'title' field, unless one chose a different label for it (in which case there would probably be no point naming it 'title' in the first place). This is potentially confusing for the user.

Yeah, that's confusing. Better use some meaningful name.

If someone needs a second title it can be labeled 'Alternative title' or 'Second title', as you pointed out. The name of the editable is available without restrictions, so if a developer wants to name it 'title' and use in his code then there is no problem with that.
Code: Select all
<cms:if lang='en' ><cms:show k_page_title /><cms:else /><cms:show title /></cms:if>

In the above sample I wouldn't like to have 'title', better noen_title/alt_title or something else. End-user has little interest in the way some variable is named. So you, as developer, can do with names whatever you feel right and appropriate.
Join COUCH:TALK channel here https://t.me/couchcms_chat
Ryazania — a framework to boost productivity with Add-ons viewtopic.php?f=2&t=13475
Support my efforts to help the community https://boosty.to/trendo/donate
Hm, this is not working as it should - I keep getting the same problem with old fields, on different pages from the original one (and it's nothing to do with relations, which I'm not using). Some update is not occurring which needs to happen to make the state of the system internally consistent. And my clunky solution from before of deleting the template file isn't even working now.

As an example, I have a template for a clonable page, 'forthcoming-race.php'. I had a 'name' field, which I realised was redundant as it duplicates the automatic title field, so I removed it and went to /forthcoming-race.php while logged in as super-admin. Back in the admin control panel, I did a refresh and then went to add a new cloned page of 'forthcoming-race.php', and the 'name' field was still there. So I deleted the 'forthcoming-race.php' file and refreshed the admin control panel. To my surprise the Forthcoming Race item was still there, and allowing me to edit! What do I have to do to get rid of it?
This is getting very sad. PM me creds if it's not on localhost.
By the way, you didn't mention that after removing editable from the template, revisiting at as superadmin, refreshing cloned page, you actually saw that couch offered to delete that field. Did you actually delete that editable field in the cloned page of the template in question in the admin panel?
Join COUCH:TALK channel here https://t.me/couchcms_chat
Ryazania — a framework to boost productivity with Add-ons viewtopic.php?f=2&t=13475
Support my efforts to help the community https://boosty.to/trendo/donate
Unfortunately it is on localhost, although I'll be able to upload it to another server shortly and PM you credentials if I don't get this solved.

I didn't get the option to delete any fields. I have seen such a message in the past, I'm sure, but not this time. My feeling is that something in the database has got out of sync with the current state of the PHP files. If I knew which tables/columns, I could probably delete it in the database.
9 posts Page 1 of 1