Problems, need help? Have a tip or advice? Post it here.
7 posts Page 1 of 1
Hi everybody,

I have been playing with CouchCMS a few days and it's wonderful. Its simplicity fits perfectly with the site I'm working on for my college faculty.

One of the things I want to add is a dynamic list of academics, and I want to use the Title field for the name and the Name field for the email user (as is a kind of public universal id in my university)
The site will be managed by different people, and I want to leave clear indications that these fields are for that info.
Also, I will be using that list in a many-to-many field and I need to see the names.

Is there a way to change their labels/descriptions? I tried defining a editable tag for k_page_xxxx with the label attribute, but as expected, it didn't worked.
If there is no other options, I could use a editable type=message, but I would prefer a cleaner way.
I don't think there is any straightforward way to accomplish what you're asking, and I wouldn't use the Name field for an email address at any rate. Couch does some parsing on the name that would be incompatible with email addresses.

In a situation like this where you want to carefully control the user experience, DataBound Forms (http://www.couchcms.com/docs/concepts/d ... forms.html) are probably the best solution.

I perfectly understand that in a situation where a wide range of possibly untrained users will be managing data, you want to leave no room for confusion. You'll have to weigh that against the extra effort of creating a custom solution.

@KK, This use of the clonable template as a sort of a database where the pages are never meant to be rendered as pages is quite common and very useful. In this situation, the system's Name field ends up being just clutter. Perhaps it would be a useful feature to be able to hide that field. I don't know, add a parameter render_pages='0' or hide_name_field='1' to clonable templates. We know CMS users are easily confused. Such a feature would be a small step further in ameliorating their difficulties.
I knew that part could be misinterpreted.

Where I said 'email user', I meant the part of an email address before the @.
In the university's intranet, that part is an identificatory username for email and other services, and that could be a great option to use it as URL in a directory page with info for every academic.

My intention is to render every profile in a URL like http://faculty.univ.tld/academics/username/, and the name field does exactly that with the clonable pages and pretty URLs.
My other suggestion would be to dig through the Couch files to find the place where those labels are rendered in the admin panel and change them at the source. You could possibly use some "if" language to change the labels for this template and not others. Sorry, but I can't tell you where to look for that (a multi-file search tool would help).

But again you've got a customization, and this way you're responsible for maintaining it through updated versions of Couch.

Like I said before, I don't know of any simple and straightforward way to change those labels. I don't believe there is one.
I checked the DataBound Forms and the last section explains how to customize the entire edit page for each template.
In the end requires a little more of work, but I achieved what I was looking for, and now I can add CSS and organize some fields in columns.
It's great, but I'm slightly worried as the restyling of the admin panel in the next versions could make it look bad.

The more documentation I read, the better this CMS gets.
@tim
I agree that the system 'Name' field is bothersome in certain cases.
I used the following technique a couple of times I ran into such situation to hide the field -
Code: Select all
<cms:editable name='my_css' type='message'>
    <style type="text/css">
        #k_page_name{
            display:none;
        }
    </style>
</cms:editable>
As you can see, I am using type 'message' to inject a very simple CSS rule into the template that hides the name field.

@uniplex - welcome :)
I think the solution above can be modified a bit to inject some JS and manipulate the DOM to achieve the effect you want.

Cheesypoof suggested the following solution (you can device your own if required) -
Code: Select all
<cms:editable name='my_css' type='message'>
   
    <script type="text/javascript">
        window.addEvent('domready',
            function(){
                var k_page_title = document.getElementById("k_page_title");
                var k_page_title_desc = document.createElement("span");
                var k_page_name = document.getElementById("k_page_name");

                k_page_title_desc.className = "k_desc";
                k_page_title_desc.innerHTML = "<i>(Description)</i>";

                k_page_title.getElementsByTagName("b")[0].innerHTML = "Full Name:";
                k_page_title.insertBefore(k_page_title_desc, k_page_title.getElementsByTagName("br")[0]);
                k_page_title.insertBefore(document.createTextNode("\xA0\xA0"), k_page_title_desc);

                k_page_name.getElementsByTagName("b")[0].innerHTML = "Username:";
                k_page_name.getElementsByTagName("i")[0].innerHTML = "(Description)";
               
            }
        );
    </script>
   
</cms:editable>

At the moment all solutions are pretty hackish but this should change in the next version of Couch that we are currently working on.

Hope this helps.
I thought the editable message only admitted text strings, but now I see that writes all the content in literal form.

This will be helpful with other ideas I was thinking to add.

Thanks.
7 posts Page 1 of 1