Hello,

Here is a patch that adds the option to exclude by content type. This solves the problem of having to add nodes manually, as typically a node with dynamic content will be of a special content type.

Hope people find this usefull :)

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Crell’s picture

Title: Exclude by content type (patch) » Exclude by content type
Status: Active » Needs work
Issue tags: +Needs usability review

From a usability standpoint, would it be better to have a separate on/off radio on each node type's form to say whether it should be cached or not? Not sure.

Also, code calls things "node", not "content", so the variable should be cacheexclude_node_types, or something like that.

eabrand’s picture

Version: 6.x-2.1 » 6.x-2.x-dev
Status: Needs work » Needs review
FileSize
1.97 KB

Here are the fixes: checkbox instead of select box & changed from "content" to "node"

Crell’s picture

Status: Needs review » Needs work

If I'm reading the patch correctly, this removes the ability to exclude by path. Not cool. :-) We just want to add the additional functionality.

eabrand’s picture

Status: Needs work » Needs review
FileSize
2.13 KB

Oh sorry about that. Here you go:

Crell’s picture

1) There should be an underscore in the name of the saved variable between the prefix and the node name. It should also be "node_type", not "node".

2) What's with the array('', '') as the default value for the node types to exclude? That makes no sense at all.

3) "Pages to exclude from caching" is the wrong name for the new form element. That's just copying and pasting from the first textarea, and is wrong. Please update it.

4) "Check all that apply" is a useless #description text. It should be something descriptive and informational, explaining what checking a box there actually does.

Crell’s picture

Status: Needs review » Needs work
Crell’s picture

Also, make sure all comments have a proper period at the end so that they're a full grammatically correct sentence.

eabrand’s picture

Status: Needs work » Needs review
FileSize
2.17 KB

Here is the updated patch!

Crell’s picture

Status: Needs review » Needs work

The variable_get() calls do not match up, so the variable will never be found.

eabrand’s picture

Status: Needs work » Needs review
FileSize
2.31 KB

Here is a tested patch. The reason for the array is because the checkboxes are stored as an array in the form.

drupert55’s picture

Hello.

Is this patch needed in 6.13? I too want to exclude a content type from showing up in Recent Posts, searches, etc.

Thanks.

Crell’s picture

drupert: What you're describing has nothing to do with this module whatsoever. You need to deal with access control for that. This module is just about caching.

Crell’s picture

Status: Needs review » Fixed

Cleaned up #10 some. It still had "node" in the UI, and we can strip down the list of types when checking using array_filter(), which is more PHP awesome. :-) Committed the modified version.

Thanks everyone!

Status: Fixed » Closed (fixed)
Issue tags: -Needs usability review

Automatically closed -- issue fixed for 2 weeks with no activity.