Add support for individual "create content blocks" by content type
GregoryHeller - November 13, 2008 - 05:38
| Project: | Create Content Block |
| Version: | 5.x-1.2 |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Description
I have used the following php code snipit to create a "create content block" that i can display in specific places, like a "create a blog" block when a user is viewing blog content, or a list of blogs.
<div id="explain">
<?php
$types = node_get_types();
print $types['blog']->description;
?></div>
<div id="create">
<?php
global $user;
if ($user->uid) {
print l('Post a Job Listing.', 'node/add/blog');
}
else {
print l('Login', 'user?destination=node/add/blog') .' or '. l('Register', 'user/register') .' to create a blog post';
}
?>
</div>It would love to see a similar feature for the create content block module.
From the admin screen an admin could enable "create content blocks" for each content type and customize the block title and the button title. In the code above, a description of the content type is pulled from the content type description. I would like to see the inclusion or exclusion of this description in the block as a setting. The css ids allow for styling of the "explanation" text and the "create" text.
A user could then use normal block visibility settings to place the block as necessary, though perhaps there could be a setting to "always include block when viewing content of same type"
