Problems, need help? Have a tip or advice? Post it here.
15 posts Page 2 of 2
KK,
Works fine on all the paths I could find. There is not a lot of cross-linking on the site which makes navigation and maintenance a lot easier.

Looks good.

KK wrote:
I just want to communicate potential issues
We appreciate your doing it, Graham :)

BTW, the docs are now at the new location - http://docs.couchcms.com/tags-reference ... cedit.html

http://www.couchcms.com/docs/ should redirect to http://docs.couchcms.com/

Please check and let us know if you find anything out-of-place.

Thanks.
Graham
Thanks Graham :)
Tim,
After thinking about it for a while I have actually reverted to the CSS approach for coding efficiency. I am using this optional image setup throughout the site and a couple of lines of CSS vs a lot of inline code feels better. In terms of page efficiency it is probably a wash.

tim wrote: You can use Couch's if tag to output that image only if it exists, saving yourself the CSS shenanigans.
Graham
I think I'm going to have to disagree with you, Graham. Of course, it's your code. You have to write and maintain it. You should do what's comfortable and makes sense to you. Both methods work.

But just for the sake of discussion, I'd say it's better to create well-formed pages server side than it is to create ill-formed pages server side then correct them in the browser using CSS.

The CSS method scatters empty image tags around your webpages then relies on a specific CSS selector with a class name and attribute declaration to hide them on the rendered page. In terms of page efficiency, it's not so clearly a wash, especially if you use Couch's caching feature. It takes time for the browser to process; milliseconds, but the milliseconds quickly add up when it comes to page rendering. And broken pages patched up with CSS don't necessarily play nice with assistive technologies and search engines.

There's more to code efficiency than just number of characters typed, or lines of code. Like you are doing in this case, one tends to repeat patterns of use throughout a code base. Copying and pasting a chunk of code here and there is the same whether there's an if statement in the chunk or not. I can't see how it's preferable to maintain a styling rule that affects the logic and structure of the page instead. If you continue to use the same pattern in different contexts, the problem multiplies.

One of the things that attracted me to Couch initially is that it doesn't boss you around. You can use it where you want, and it doesn't interfere where it's not needed. At first I used Couch pretty sparingly. I already had solutions for many Couch features and saw no reason to change. I used php includes rather than the cms:embed tag, I had my own HTML forms and processing scripts, I didn't even bother using editable regions for most of my static content. The alien and unfamiliar <cms:tag> tags seemed awkward and jarring in my code, and I kind of avoided using them.

But in time I learned to appreciate the power and logic of Couch's feature set, beginning particularly with the cms:if tag. I overcame my prejudices. Couch's tags and logic and preferred solutions became more natural to me. I settled into the Couch and got more comfortable there. I would suggest that your preference for the CSS solution in this case is influenced by that same sense of discomfort and unfamiliarity. But in principle, the server side solution strikes me as being preferable in every way.
Tim,
Thanks for taking the time to write a detailed response. Your assessment of the source of my discomfort is pretty much spot on. I have no previous experience with server-side scripting and I was thinking as if both processes were browser based. Even at the cost of some additional HTML it clearly (with your explanation of the process) makes more sense to send a clean page to the browser than fill it with junk and clean up on arrival. I will keep learning and follow your lead in making more extensive use of Couch - once I understand it better....
Graham
15 posts Page 2 of 2