Forum for discussing general topics related to Couch.
6 posts Page 1 of 1
There can be cases when it's not allowed for members to change some critical data in their profile, so some input fields most be disabled. How is possible this in Couch, since simple using "disabled" it's not working?
Thanks.
I think the most straightforward way in such cases would be to *not* offer the field as cms:input (type='bound') at all. Instead just show the values contained within the field as usual (e.g. <cms:show field_name />).

Do you see any problems with this approach?
KK wrote: Do you see any problems with this approach?
I didn't considered this as an option, but I could use it, as the important thing is to prohibit members from editing some data. Thanks for your suggestion KK.
KK wrote: I think the most straightforward way in such cases would be to *not* offer the field as cms:input (type='bound') at all. Instead just show the values contained within the field as usual (e.g. <cms:show field_name />).

Do you see any problems with this approach?

Sorry if this out of topic, but still in the same context of "disabled" attribute of text input field.

I try to implement simple 'page-hit counter' like in here http://www.couchcms.com/forum/viewtopic.php?f=8&t=8913.
so i create editable region:
Code: Select all
<cms:editable label='Page hits' name='page_hits' type='text' search_type='integer' />

How can i make the input "disabled" in the "edit" or "create new" page ? It is silly if we can edit the page counter and put any number in it right ?
@littlekoala,

Using editable region of type 'message', we can inject our own JS/CSS into the admin-panel edit/create screen (try searching the forum and you'll find several examples of using 'message').

For example, if we define the following editable region with the 'page_hits' region, the injected CSS will hide the 'page_hits' region completely
<cms:editable name='my_css' type='message'>
<style type="text/css">
#k_element_page_hits { display:none; }
</style>

</cms:editable>


<cms:editable label='Page hits' name='page_hits' type='text' search_type='integer' />

I'm sure you'll be able to use the same technique to disable the regions (or whatever). If required, you can use JS also.

Hope it helps.

Well i have tried that way, and it worked but i am not comfortable with such "hack", so i choose to create custom edit page with databound form and custom list page too to sort pages based on page hits.

anyway, thanks KK
6 posts Page 1 of 1
cron