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

Filters and trimmed content on frontpage

Hello,

I'm developping a filter for my drupal website and am facing some difficulties. For reasons of simplicity, I'll refer to the footnotes filter which is also causing me some problems, for the exact same reason.

I find disturbing having some footnotes appearing on my frontpage, when only a short trimmed version of my article's content is displayed. I am wondering if there is a way to modify the way my filter works when it is applied to the full article and when it's only used in the trimmed version.

From what I understand after searching a bit on the forums, there is no way of achieving this...
(actually the kind of solution I need is something like the ability to define an input-format for the full article and one for the trimmed version [even though I doubt that's the best way to deal with it]).

One thing I can do is convert my module to a node one, but once again I don't feel it's the right way to deal with this...

Another idea could be to put a special tag in the end of the text (that wouldn't be in the trimmed version, considering that the article is long enough), and change the behaviour of my module.

Anyway, there are some workarounds, but I don't want to start tweaking around. Is there a correct/clean way of doing this (not necessarily in my module, since as I said I want to apply this to `footnotes` too) ? If not, any suggestions on how to achieve this ?

Location API doesn't seem to insert or update...

Hi Folks,

I've developed a 'student' node module with which I'm trying to use the Location API to save its address information. In my student_form() hook I use the location_form() hook to collect the student's address like this:

$form['address']['address'] = location_form(array('street', 'additional', 'city', 'province', 'postal_code', 'country'), $node->location ? location_api2form($node->location) : array(), array('street', 'city', 'province', 'postal_code', 'country'));

The Problem

The location form displays nicely within my student form but the location data never seems to save. I've tried calling location_nodeapi() in my student_insert() hook but that didn't do the trick either (I didn't think I had to explicitly call location_nodeapi() anyway so I was pretty sure that wasn't the problem). I've combed through location.module, location_API.txt, location.inc and much of drupal.org but can't get my hands on an answer.

What I Do Know

I know the location.module is alive and well though because it saved just fine when I tested it with a custom content-student node I built using the CCK. Also, location_nodeapi() does fire its validate, prepare, view and load operations when I create and edit students, so, I'm getting some response from it, just no 'insert' or 'update'. For what it's worth, I'm also trying to get the Image Assist API to work in the same way and am having the same problem with it.

Abyss web server and Scriptaculous

** I apologize for posting this here in "module development" instead of "post installation.. **
** Somehow this forum seems more appropriate for my particular scripting question **

I cannot get the Spajax module working properly on my local web site. It works great on my remote site.

Q: Create new page like $items[] callback

I think it's awesome how you can create a page by creating a callback that points to a function via the menu_hook. I was wondering if this same type of thing is possible without creating it inside the menu_hook as a callback. Can I just call some type of function on my page that allows me to do this same type of action?

Thanks!

Accessing new DB tables

Hi Everybody,
This is probably an easy question to answer for most...

I've created a new DB table (contactform_users) and want to output data from this.

If I create a page and add code such as the following:

  $result1 = pager_query(db_rewrite_sql("SELECT contactform_users.employeename FROM contactform_users"));
  while ($node = db_fetch_object($result1)) {
    $output .= node_view(node_load(array('employeename' => $node->employeename)), 1);
  }
  print $output;

I get the following error:

Q: Add timestamp to uploaded files?

Is it possible for me to add a timestamp to files that I upload so I can keep track of the date for each of them?

Thanks!

Pages

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