Problems, need help? Have a tip or advice? Post it here.
3 posts Page 1 of 1
First project with couchcms, and the help here has already been invaluable. Thanks.

I have been building a simple member directory or contact book for a site which will be maintained by an admin. (ie. all the details are added by the admin not a member) I set up a simple cloneable template, and a new page will be created for each individual.

After looking through all the tags I decided on the following plan.

1. Set up 26 virtual folders A-Z and so each member profile will rest in a folder based on the first letter of the last name.

2. Set up a page that out puts links A-Z (using zebra) to those individual folders.

3. Clicking on the letter for the desired last name, will load the page view, and using the page tag, will list the members and contact details sorting them alphabetically by last name. (I have the last name field set up to replace the title field so I can order the results by page_title.)

What do you think, is this the best way to do it, or is there a better way I have over looked?

Also is there any way of ordering the pages by alphabetical order in the admin panel rather than the order they were entered so if details need to be changed the name can be found more easily?
Hi skribe,

You could also use the 'folders' tag for #2 if you wanted; it would allow you to check whether there are any pages in a folder (e.g. <cms:if k_folder_totalpagecount>...</cms:if>) and only output the link if so.

3. Clicking on the letter for the desired last name, will load the page view ...
I think you meant to say 'folder view' here?

Depending on the amount of contacts I might have choosen to instead use the page title for the full name and then have separate editable regions for first, middle, and last names. This would better handle duplicate last names and still work with your approach because the 'pages' tag output can be sorted based on the contents of editable regions:
Code: Select all
<cms:pages orderby='last_name, first_name, middle_name' order='asc, asc, asc'>

Nevertheless, I think your plan is sound and just about as good as can be achieved. Let me know if you need anything further. ;)

There currently is no way to sort cloned pages alphabetically in the admin panel. It is however certainly planned for a future release. You could make use of your own front-end to more easily find a specific contact and add an 'Edit Contact' link only for admin users: viewtopic.php?f=8&t=7256
Ah thanks! The using a conditional statement with folders tag is an excellent idea. Much better than having some links that lead to empty pages because there are no Zahns or Zaleskis as members.

Also yes, folder view would obviously be what I would need, I just had not thought it through completely.

The admin_link will do nicely. Plus now I will be making use of it else where now that I know it exists. Note to self: When I have more downtime, finish reading the documentation. ;)
3 posts Page 1 of 1
cron