Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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
Comment #1
Bèr Kessels CreditAttribution: Bèr Kessels commentedIT 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.
Comment #2
jasonwhat CreditAttribution: jasonwhat commentedThanks 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?
Comment #3
markus_petrux CreditAttribution: markus_petrux commentedThe patch in the following issue is looking pretty cool for theming.
http://drupal.org/node/55338
Comment #4
jasonwhat CreditAttribution: jasonwhat commentedThat 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?
Comment #5
JonBob CreditAttribution: JonBob commentedYou 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:
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.
Comment #6
scroogie CreditAttribution: scroogie commentedWhat filename do I need? cck_#id.tpl.php?
Comment #7
Advodude CreditAttribution: Advodude commentedThe 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.
Comment #8
JonBob CreditAttribution: JonBob commentedCorrect, but it's a hyphen after "node," not a period.
node-content-foo.tpl.php
Comment #9
jasonwhat CreditAttribution: jasonwhat commentedAll there any in-depth examples like those with flexinode- showing how to handle links and image for example?
Comment #10
JonBob CreditAttribution: JonBob commentedI'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.
Comment #11
jasonwhat CreditAttribution: jasonwhat commentedThanks 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?
Comment #12
JonBob CreditAttribution: JonBob commentedCorrect, 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.
Comment #13
(not verified) CreditAttribution: commented