Forum Moderators: open

Message Too Old, No Replies

Do I even need a CMS?

Not sure if a CMS will do what I want

         

illbecnu

3:52 am on Apr 22, 2010 (gmt 0)

10+ Year Member



Hello all, CMS newbie here so please forgive me if I'm confused on how a CMS could help my cause.

So I am a developer who builds custom sites using ColdFusion. There's one site where they have a graphics artist who does the site layout, another person who manages the "content" for the site, and then I build the CFM code to do what they want to accomplish.

I'm tired of getting emails with new site templates and word docs that have the edits to the existing content and being asked to implement them. I'm looking to find both a product and a set of processes that we could employ that would let the layout guy maintain and implement new templates as he wishes, while the content person can keep the 10-15 pages of content updates, but yet will allow my CF specific scripts to continue to bring in the database drive information and collect data via e-forms and such.

So is that a pipe-dream? Will/Could a CMS play a roll in any part of that? This is not a big site and right now I manage this process by hand usually but really would like to empower them to be able to keep their stuff updated like they want and leave my stuff running as is.

Thoughts?

blend27

10:09 pm on Apr 26, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Helow illbecnu, Welcome to WebmasterWorld.

Try looking into the term that is called TEMPLATING, basicaly customtags on steroids. The main theory is to have a few templates defined and then regions that pull the content from DB into regions that are in templates.

Also take a look at Mura CMS.

Hope this helps.

caribguy

10:23 pm on Apr 26, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



For a discussion on Template Attribute Language (TAL), its Extension Syntax (TALES), macro expansions (METAL) and the like you could check out the Plone documentation pages: http://plone.org/documentation/manual/theme-reference/buildingblocks/skin/templates [plone.org]. Also a quick overview on Wikipedia [en.wikipedia.org]

By the way, TAL is not restricted to Zope or Plone. There appears to be something called PHPTal (unfortunately I'm not familiar with it).

ergophobe

4:35 pm on Apr 27, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



There appears to be something called PHPTal (unfortunately I'm not familiar with it).


Me neither, but there is a PHPTAL template engine for Drupal [drupal.org], but I've not used it and there are no actual base themes yet (AFAIK).

Caribguy, do you use Plone with TAL? If so, can you give me your best case for using such a thing? As I say, I've never used PHPTAL or and TAL flavor, but I have used Smarty, which is a similar concept and, honestly, I just don't get it.

To me these template languages just force developers learn yet another syntax for the purported purpose of separating content from logic. Yet look at the example from the PHPTAL site (from what I read, PHPTAL is much friendlier than Smarty):

<div class="item" tal:repeat="value values">
<div class="title">
<span tal:condition="value/hasDate" tal:replace="value/getDate"/>
<a tal:attributes="href value/getUrl" tal:content="value/getTitle"/>
</div>
<div id="content" tal:content="value/getContent"/>
</div>


Wait, aren't "repeat", "condition" and "replace" program logic? Certainly in the PHP manual they would be listed under "Control Structures".

Yes, you are limiting the amount of damage a designer can do to the developer's code because you can't write functions and do low-level tasks, but now you need to find both a designer and a developer who know Smarty or PHPTAL, or you have to train them. Since the developer already knows PHP, it always seems easier to me to teach the designer a small subset of PHP and say, "You can only use these functions/structures in your template".

I find Smarty really hard to read as the control structures tend to be very compact and mix in visually with HTML (are there editors that do syntax highlighting for Smarty, PHPTAL et al?).

Finally, I find them harder to debug.

And then, development issues aside, at least in the case of Smarty, you have to load this pretty huge templating engine. I don't know how big the PHPTAL engine is, but it is a PEAR package so it's probably considerable.

Anyway, I know smarter people than I who swear by these things. I've never worked in an environment where you have separate teams of coders, designers, writers and so forth. For individuals and small teams, I see these as just a nuisance, but even there, I've known of solo developers who still swear by them.

[edited by: ergophobe at 7:11 pm (utc) on Apr 27, 2010]

caribguy

6:57 pm on Apr 27, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I have been using Zope with its Content Management Framework since 1999/2000. No Plone yet back then. The framework came with a set of default themes written in DTML (Dynamic Template Markup Language).

At some point, the CMF developers decided to refactor all their DTML templates into TAL. It actually took me several years to move away from DTML, since I had made a lot of customizations to the original templates for my own sites. I finally made the switch in 2007 when a big project came up, and now I just love it :)

If for instance you wanted to display a dynamic list of links, you could do this in DTML:

<dtml-if "_.hasattr(context,'myListOfLinks')">
<ul>
<dtml-in "myListOfLinks">
<li><a href="<dtml-var absolute_url>" title="<dtml-var title>"><dtml-var "description"></a></li>
</dtml-in>
</ul>
</dtml-else>
<p>Content coming soon</p>
</dtml-if>

It worked ok, but was difficult to read. With TAL it looks much better:

<ul tal:condition="exists: here/myListOfLinks">
<li tal:repeat="item here/myListOfLinks">
<a href="http://www.example.com" title="the link title"
tal:attributes="href item/absolute_url; title item/title"
tal:content="item/description">This is sample text the designer will see</a>
</li>
</ul>
<p tal:condition="not exists: here/myListOfLinks">Content coming soon</p>

I'm used to a Pythonic coding style (indentation matters), so the above <a> tag would be formatted over several lines and be easy to read.

The way I use TAL the most is by combining it with METAL macros. This allows me to write an overall template for the website (with header, masthead, content, widgets, footer and whatnot) and then let sections of the site or specific pages inherit only the parts they'll need and replace other sections with their own markup.

The use case that really works for me is when I want to make quick changes to the site as a whole or only certain parts. E.g. a while ago I decided to implement RDF microformat tags for some types of content. The whole thing took me less than an hour (including testing) for several hundred pages of content, leaving other parts of the site as they were.

Another way to speed things up with TAL is when creating your own website themes. I normally start by creating a site layout as a PSD, then code the html + css in a text editor, and add any images, backgrounds, sprites, etc. Next, I cut up the html in logical sections for the different parts of the template.

From that moment on, I have a working presentation layer and I can then incrementally insert the logic that I need without it affecting my layout. Anything from navigation menus to member profile views, database queries, etc. becomes a plugin...

You can certainly abuse "define", "repeat", "condition" and "replace" to incorporate programming logic if you want, but that's not how they were meant to be used. In the example above, myListOfLinks could have been a database query, or the output from some script. In another template I could use the same output to generate XML markup for my RSS feed, or for a printable page.

When speed becomes an issue, I check out the time required to render the various bits with a profiler. In my case, I also can set up individual sections of the template to be cached by Zope.

Hope this clarifies things a bit :)

illbecnu

1:45 am on Apr 28, 2010 (gmt 0)

10+ Year Member



Thanks guys. Yes, I know a little, very little about templating but I will read more. I need to better understand how to operationally implement them as well, and how to control who has access to what in each. I mean this is a situation where you have multiple consultants in essence, each using their own tools to do their own part (design, content management, and programming) and then the programmer (me) has to pull all these pieces together into a functional site. We made it through one generation of the site like that and I'd like to not do it again, so I'm trying to put some controls in and operationally organize things so that the next generation of the site is better controlled and organized. So I'll look back at templating further and see how to apply that to my situation.

Thanks

ergophobe

2:10 am on Apr 28, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Caribguy, thanks for the details.

That sort of makes sense for Zope. The thing about PHPTAL is that, in origin, PHP is a templating language. It was, in essence, at set of routines built in C that could be used for generating pages from templates (PHP stands for PHP Hypertext Processor now, but used to stand for Personal Home Page). The language has expanded a lot, but the fundamental templating is still available. So I've never seen the need in PHP.

In other words, with Zope, you use the DTML like so
<!--#var document_title-->


In PHP, you have
<?php include('document_title');?>

caribguy

3:15 am on Apr 28, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



<!--#var document_title-->

Yes, correct. That's a deprecated notation, by the way. <dtml-var document_title> was introduced with Zope 2.0 and seems to be preferred, or you could use an entity reference syntax, e.g. &dtml-document_title;

In any case, I now find it a very clunky way of doing things. TAL on the other hand is very elegant... Ten years ago, there were not many alternatives. And, combined with Zope's acquisition magic it really rocked :)

ergophobe

7:06 pm on Apr 28, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Every once in a while I think I should look more into plone/zope/python. A friend who is a python nut once told me that when he works with programmers using any other language, it takes him less than half the time to get stuff done as a PHP or Java of whatever programmer.

For the time being, though, no python or PHP-based templating language for me.

Thanks for all the info though... one day it's going to motivate me to investigate further!