Hey guys,

Using Content Construction Kit (CCK) and trying to figure out how to pick out individual elements from CCK nodes (in the same way that could be done with Flexinodes) for node layout.

Below is the standard way a field would be recalled into a theme from a flexinode.

<?php print $node->flexinode_9 ?> 

It looks like CCK fields aren't created in the same numeric way and flexinode fields.

Does anyone know how I would recall an element like "field_example"?

Cheers,

Alex

Comments

DallyBoy’s picture

From what I understand it is just like flexinode, except that you can reference the field by the name you called it. So taking your example field name it would be:

<?php print $node->field_example ?> 
merlinofchaos’s picture

Close. It's actually print $node->field_example['view'];

-- Merlin

[Point the finger: Assign Blame!]
[Read my writing: ehalseymiles.com]
[Read my Coding blog: Angry Donuts]

-- Merlin

[Read my writing: ehalseymiles.com]
[Read my Coding blog: Angry Donuts]

DallyBoy’s picture

Aha! That's it! :) Thanks Merlin.

ALT83’s picture

Yeah I had originally assumed just replacing flexinode_1 with field_example but it didn't work (now I know why).

Just out of interest are there any other functions other than ['view'] either existing or planned and is all this documented anywhere?

Thanks,

Alex

merlinofchaos’s picture

Unfortunately I am not sure offhand. I don't think it is (yet) documented, but it likely will be when CCK is more complete.

-- Merlin

[Point the finger: Assign Blame!]
[Read my writing: ehalseymiles.com]
[Read my Coding blog: Angry Donuts]

-- Merlin

[Read my writing: ehalseymiles.com]
[Read my Coding blog: Angry Donuts]