I'm starting a new project and trying to decide if I should use CCK or Flexinode. I'm pretty familiar with flexinode and themeing with it, but I suspect that it will be deprecated in favor of CCK. Can CCK be themed as easily as flexinode and is there documentation for that? Are there any reasons for or against using CCK at this early stage people should be aware of? Thanks.

Comments

Bèr Kessels’s picture

IT really depends on your needs. WE aer spending a lot of effort and time to get flexinode ready for 4.7, we are almost there. Flexinode will be actively maintained for at least another cycle, I am sure. And maybe even after that.

However, CCK has a lot of advantages, most notably performance. But it also allows you to use views.module as well as far more complex fields.

I would personally summarise as:
* flexinode is therefor those who still have flexinode on older sites.
* flexinode has a lot of modules around it that add functionality.
* CCK still lacks a lot of features that flexinode offers. Sme of wich are in those extra modules, others because CCK simply does not yet have such fields.
* CCK is evolving rapidly, flexinode is not really evolving anymore. FN is only there to offer what it always offered. Not really to move forward.

However, in your very case, where you are "pretty familiar with flexinode and themeing with it", CCK might come with anohter learning curve.

jasonwhat’s picture

Thanks for the rundown. Is it possible to theme CCK nodes in a similar way? Any docs on theming them? One more questions:
1. Will there be an upgrade script to convert flexinodes to CCK when it takes over?

markus_petrux’s picture

The patch in the following issue is looking pretty cool for theming.
http://drupal.org/node/55338

jasonwhat’s picture

That does look promising. I think my question is much simpler than all that though. Basically I want to know if I can do in CCK what I can do in Flexinode, which is something like this:

I create a tpl.php file for the node type, put in whatever code that I want, and have a simple way to control where each field outputs its content. Not using the right syntax, but something like this

here's some code here's some code
print field 21 here
more code more code
print the image in field 25 here
more code more code etc...

Can I do something that simple and straight forward with CCK and are there examples anywhere to view?

JonBob’s picture

You can do precisely that. It's even a little easier with CCK, since you don't have to remember numbers for your fields. If you define a text field named field_foo, then you can theme:

print $node->field_foo[0]['view'];

The 0 is there for consistency with multiple-value fields, where [1], [2], et cetera will also be defined. The "view" attribute will contain a textual representation of the field with all output filtering already performed.

scroogie’s picture

What filename do I need? cck_#id.tpl.php?

Advodude’s picture

The file naming for cck templates is node.content-[your content title].tpl.php so for example if I created a node type called "listing" then the file would be called node.content-listing.tpl.php.

JonBob’s picture

Status: Active » Fixed

Correct, but it's a hyphen after "node," not a period.

node-content-foo.tpl.php

jasonwhat’s picture

All there any in-depth examples like those with flexinode- showing how to handle links and image for example?

JonBob’s picture

I'm working on a theming document to go along with some enhancements to the theme system I'm working on. I should be able to check it in within a couple of days.

jasonwhat’s picture

Thanks jonbob. I mentioned images as an example, but playing around with cck didn't see an image field. Is that correct that it doesn't yet exist as in flexinode?

JonBob’s picture

Correct, it isn't in the main line yet. Dopry is working on it in his sandbox; hopefully it will be checked in very soon.

My estimate on providing theme instructions was a little conservative. Instructions are now in CVS.

Anonymous’s picture

Status: Fixed » Closed (fixed)