Can we get a Content Type Path Filter like have in FCKediteor.
Example

Path structure: content_type@path.element_id

or content_type@path.*

CommentFileSizeAuthor
#4 visibility_api_check_request_q.patch961 bytessdsheridan

Comments

q0rban’s picture

Sorry I'm just now responding to this, I realized I wasn't subscribed to issues on this module! ;)

So, can you describe more what you're talking about? You want to be able to, say, hide things depending on which node type you're looking at, but not use php code?

// Hide if viewing a node of type foo.
return (!(($node = menu_get_object()) && $node->type == 'foo'));

Edit: Realized my logic was incorrect.

bsztreha’s picture

Is there any activity? I need some similar feature at region_visibility, hide region if view node type of foo.

q0rban’s picture

Honestly, I think this module is deprecated. If you need a way to control the visibilty of certain things, depending on conditions, you should probably be using Context module.

sdsheridan’s picture

StatusFileSize
new961 bytes

This does provide a nice simple interface, though, and is relatively light-weight.

I solved this problem in a slightly different way, which was to also look at $_REQUEST['q'] when doing the comparison in function visibility_api_visible. For certain valid patterns, drupal_get_path_alias($_GET['q']) won't retrieve a valid aliased path, particularly if there is a sub-path alias being used. So, I changed the function to also incorporate the test of $_REQUEST['q'] as follows:

      if ($path != $_GET['q']) {
        $page_match = $page_match || drupal_match_path($_GET['q'], $record['pages']);
      }
      elseif ( $path != $_REQUEST['q'] ) {
        $page_match = $page_match || drupal_match_path($_REQUEST['q'], $record['pages']);
      }

How this helps is that I have via pathauto URLs that start with a content type, and I also use subpath_alias, so the links to edit a content type, for example, would look like content_type_machine_name/[title-raw]/edit. With the change above, I can use a pattern like content_type_machine_name/*/edit, and it works.

I've attached a patch.

Shawn