This forum is for module development and code related questions, not general module support. For general support, use the Post installation forum.

Add access hook to all content modules?

I was just browsing this thread (http://drupal.org/node/38830) about the difficulty of making forums only viewable by registered users. There are ways to do this with taxonomy access, but I like to use Organic Groups and the two seem to cancel each other out. Is it possible to simply add an "access forums" check mark to admin/access? Perhaps, every content module, like comments already does, could be required to have an "access" field along with the "create" and "edit" permissions most have.

problems understanding menu-handling of Drupal

Hi everybody,

I am developing several custom modules for a website I am building. One of the modules is a hardly adapted taxonomy_menu_module which uses vocabulary-names and term-names to create the paths, and some custom functions to render lists of nodes of a taxonomy-term.

For example a part of the menu looks like this

fruits
+-apples
+-peaches
+-berries
  +-strawberries
  +-.
  +-.
+-.
+-.

if the user navigates through this menu the active menu-items are rendered active. But if the user chooses a node to view, the corresponding menu-item is not rendered as active.

in hook_nodeapi/view I compute the correct path for the node and do something like this: (for example $path="berries/strawberries")

$arr = array(array('path' => $path, 'title' => t($term->name)), array('path' => 'node/'. $node->nid, 'title' => $node->title));
menu_set_location($arr);

This will expand the menu-hierarchy the right way, but it will not hilight the last menu-item. Say I am viewing a node of the listing strawberries, the menu-item strawberries gets not activated, only expanded.

I can achieve what I want with the following lines:

menu_set_location($arr);
$breadcrumb = drupal_get_breadcrumb();
menu_set_active_item($path);
drupal_set_breadcrumb($breadcrumb);

but I am loosing the local_tasks-menu (view/edit/revisons) of the node, so no easy editing for the user/admins.

A way to just pull the Taxo from ONE list and not the other?

Okay, tring to make something cool happen...

I want to know if there is a way to display the info from one list of taxos vs the other.

[Title]

[Path]

[Topic List One:]

[Topic List Two:]

[Body]

I want to list in the $terms only the ones in list one or list two, but not both. So is there something other than $terms I could be using?

Thanks!

flickr_block module: images not showing

I was trying to get some images from flickr to my test site and not working. The demo site was also not working. After searching in google, i realized that there has been little problem with the image url, maybe flickr has changed that after flickr_block development. You just have to change the one line.

Maybe this help someone. I didn't find anyplace to submit this than in forum.

anjesh

Teasers in 4.7

I have found that the length of teasers in 4.7beta appears to be governed by when you have a line break. For example if you press enter in your post to create a new line, this is where the teaser will show up to. I have found this means you can end up with really long teasers! Is this a bug or a feature? if its the later is there a way to turn it off?
Thanks

Want to create a CSS section for each Tax, and wrap Content in it?

(FYI: Good at HTML / CSS, Know very little about php and Drupal)

Okay I am tring to do something and would like a little help.

I want a banner before the TITLE of a section of content based on the catagory it is tied to...

To look something like this

=====================
Baner
=====================
Title of the Content
Submitted by me today

Content

I have a Okay solution, and the second would be an ideal solution.

Okay solution,

So I have a question, is there a way to get only ONE $terms if the content has more than one?

I ask because at best I could add to the node.tpl.php

<img src="../images/<? php print $tersm(1) ?>.png" width="63" height="63" />

I am assuming the (1) would just give me the one term, and that I would have images in the folder that would match the terms....

This is what I am tring to do, anyone have any clue how to make this happen for real, right now this is all fake...

Ideal Solution

I want to do the same thing, but I also want to wrap the whole piece of content, and wrap it into its own CSS. I want to have a CSS sheet that will have .somethings that match the catagory that I use. So some of the posts would be on a diff background.

You can see something that I am tring to do by taking a look at this WP driven http://thinkprogress.org/

Can anyone offer some help on this, expecialy the just selecting one term?

Pages

Subscribe with RSS Subscribe to RSS - Module development and code questions