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

Q: Is it possible to override module functions kinda like template.php?

I have been making great use of template.php lately for theme functions and I love it. However, in some cases I find that modules do not provide a function name preceded with "theme_" therefore limiting me from editing it in template.php. Is there some type of way to override a theme even if it doesn't contain theme_ at the beginning?

Thanks!

How do I create nodes from my cron-called xml-parser?

I'm trying to write an xml parser that creates event nodes, and perhaps other types of nodes too. This script should get called by cron every so often to insert or update nodes, and therefore not require a logged in user. How would I do the actual node insertion though? Say that I know that I've found my event title, start time etc., do I use event_nodeapi to create it? How exactly? Or do have to do a database insert/update...?

Announce: CCK support for import_html

Due to popular demand, I've documented how this can work.
Technically most of the functionality was there under the hood already, but now it's been tweaked to recognise CCK fields explicitly.

Import HTML - Import to CCK

The base functionality supports placing found content into the $node->body
field, not naturally into any arbitrary CCK fields, but this is also
possible.

If you have a CCK node with (eg) fields:

field_text, field_byline, field_image

and your input pages are nice and semantically tagged, eg

<body>
  <h1 id='title'>the title</h1>
  <div id='image'><img src='this.gif'/></div>
  <h3 id='byline'>By me</h3>
  <div id='text'>the content html etc</div>
</body>

A mapping from HTML ids to CCK fields will be done automatically, and
the content should just fall into place.

  $node->title = "the title";
  $node->field_image = "<img src='this.gif'/><";
  $node->field_byline = "By me";
  $node->field_text = "the content html etc";

In fact, ANY element found in the source text with an ID or class
gets added to the $node object during import, although most
data found this way is immediatly discarded again if the content type
doesn't know how to serialize it.
A special-case demonstrated here prepends field_ to known
CCK field names. Normally they get labelled as-is.

Where to start? Should I make a new module? Simpler way?

So, I'd like a form on my drupal site. It creates a new page and adds it as a primary link.

The Form has three fields:

Page Title: [ ]

Menu Title: [ ]

Body: [ ]

All the rest of the options I'd set programatically. I'll worry about moving setting the link weights next.

I could:

1) Hack a new custom version of the page module
2) Use an existing module (although I didn't see one...)
3) Use some smart tight PHP.
4) Others?

How to create themed modules

I appologize in advance. I'm sure this is covered somewhere but I swear I searched all last night and today before posting. I'm stumped.

So here's the project: http://www.jofaba.com

As you can see, I've got a theme to the modules. The only problem is that while it looks like what I want is already done, it's actually a mirage. What you see is hard coded into the page.tpl.php like this:

		<div id="right">
			<div class="boxtop"></div>
			<div class="boxx">
			
        <?php if ($sidebar_right != ""): ?>
        <?php print $sidebar_right ?>
        <?php endif; ?>

			</div>
			
			<div class="boxtop"></div>
			<div class="boxx">
        <?php if ($sidebar_left != ""): ?>
        <?php print $sidebar_left ?>
        <?php endif; ?>	
			</div>

What I'd like to do , is remove the hard coding so that each module that is generated creates it's own module theme like you currently see on my page. Obviously, right now I've got two div's with background images and I've assigned one as "left" and one as "right". If I were to put another module on the page, I'd have to assign it to inside one of those "modules", and that's not what I'm looking for.

I easily figured out how to have one image generate by using the .block value in the CSS, but there are two images, and they work in such a way that the box appears to be adjustable. In reality though, you just don't see the entire image. It works like frames (as I'm sure you know) so that the top part is cut off. The lower line image is actually 500px high, and both that you see use the same image. I'm open to do it differently though.

Interested in filamanager / fileshare modedules

I need filishare module with this features: catagories, subcategories, taxonomy, file search, commenting, rating, download statistic, *multilingual , TOP 10.... But I cant find any like that here. In Drupal ->Modeul section there are only pretty simple filemanagers.

May be somebody developing this module for Drupal or know where to find it!?

Pages

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