When i select a category to put in mysite it doesn't consider cck content type. Something missing?
thanks

CommentFileSizeAuthor
#7 cck.theme_.txt1.31 KBagentrickard

Comments

agentrickard’s picture

Assigned: zaphod280380 » agentrickard
Category: support » feature
Priority: Critical » Normal

No, you're not missing anything; though the documentation clearly states that the supported MySite release supports core modules. CCK is not core. Contributed modules are sometimes supported (find them in the /contrib folder of the download), and those are often written by people other than me.

That aside, let's address the CCK-as-feature issue.

CCK content can currently be accessed by MySite through the terms that the content is assigned to.

If you wanted additional CCK support, what would it look like? Here's a guess (and understand that I don't use CCK).

* The cck.inc would scan for all active cck types.
* Under the MySite settings, you could enable each CCK type individually.
* Users would be allowed to add content based on CCK type?

It's this last piece that I don't quite get. How would users add CCK content to their MySite page? By CCK type only, I suppose.

Consider the case of Blogs. The blog.inc file defines Blogs by User. You can add any user's blog to your MySite page. You can't currently add 'All blogs' to your MySite page. THe module simply wasn't designed that way.

In CCK, would you select content solely based on CCK Type (all cck book reviews, or all cck events, for example)? Or would you select based on CCK Types and a second value (all CCK book reviews by user #3)?

Since CCK is not core, I have not tried to solve this problem. But the module's API supports your attempts to solve it before I can, so you might try writing a cck.inc file.

Note: Only assign issues to yourself if you are working on a patch for the issue.

agentrickard’s picture

It seems to me that a case can be made that CCK support is actually generic Node support, and therefore core.

The question is, what is the functionality? The answer, I think is simple:

1) Let admins define what node types can be added to mysite.
2) Adding a node type to MySite will send all recent posts of the selected node type to a MySite page.

I think this would cover existing node type (like "All blog posts') and CCK types (and flexinode types). A little more CCK research is required.

Thoughts, zaphod?

csc4’s picture

Sounds excellent to me! +1

Would the types be all types or admin defined or types users can create?

I've also been asked my more egotistical users if they can use mysite to just show their blogs etc. So a select by type with an added select only mine tick boxes would be about perfect!

agentrickard’s picture

On the first question, the node types would be administrator defined.

The blogs implementation supports egotastic 'only mine' right now.

The big question for other node types is: Do they need a secondary organizing principle?

Perhaps that could be administrator defined as well.

agentrickard’s picture

I just took a quick look at the status of CCK. Defining the behavior of a node.inc file is defintely the way to go.

So now if we can define the features.... Start with the post above http://drupal.org/node/118934#comment-197511

agentrickard’s picture

Version: 4.7.x-3.8 » 5.x-1.x-dev

CCK and content teaser view.

OK, looking at CCK content types brings up some major issues for MySite.

Some premises:

1) MySite, by design, bypassing the normal PHPTemplate rendering system for node content. This allows MySite format files to control presenation of data.
2) MySite, by deisign, therefore does not use node_view().
3) CCK, by design, requires hook_view() in order to integrate CCK fields with $node->body and $node->teaser.

What this means is that custom CCK fields can onl be viewed in teaser elements by invoking hook_view(). I don't wnat to invoke hook_view(), though because MySite should decide you to render the content, not PHPTemplate.

Make sense?

Also upgrading to 5.x.1.x-dev because the 4.x branch is closed to new features.

agentrickard’s picture

StatusFileSize
new1.31 KB

Here's one solution, but I don't think it's the best.

Rename this file cck.theme and put it in /mysite/plugins/formats/

It will render the full CCK teaser. I don't like it because it requires an additional node_load() after the page content is loaded. Doing this defeats the MySite cache functions.

Another option: prepare two 'teaser' elements. 1) The default $node->teaser. 2) The CCK-style $node->teaser. Then let the format file choose.

Implementing this would require a change to the MySite API; updates to most of the TYPE includes and the FORMAT includes.

A second option: User hook_view() for rendering nodes in MySite. I don't do this know because not all MySite content is nodes, and I want to present all content in a standard way.

Thoughts?

agentrickard’s picture

Version: 5.x-1.x-dev » master

Solution.

I think I'll create a mysite_teaser_handler() function that will generate a full teaser based on a given $node. This will allow full-fledged support of CCK.

It will not, however, respect node.tpl.php layout changes.

I suppose there could be an option to use node_view() instead of the built-in MySite display element. Or perhaps good theme() function calls that would allow for overrides based on cck nodes.

Moving to HEAD, as this is new feature development.

pallo’s picture

Whats the current state of cck content types ?

Is there anybody working on it ?

agentrickard’s picture

Don't think so. I have some ideas about how it would work, but some things in the queue ahead of it.

agentrickard’s picture

Component: Code » - Type plugin

I'm working on this now. I've already added proper teaser creation in HEAD.

Now I'm just working out the presentation layer.

After I write this include (called node.inc) and a user include, I will likely release the first 5.x.2 version.

agentrickard’s picture

Status: Active » Closed (fixed)

This has been committed to HEAD (Drupal 5 compatible) and will be part of the 5.x.2 release.