Hi all... thanks for taking a look at this.

I'm developing a website for the journal I work for. Using flexinode.module, I created Issue and Article nodes, and using tagnode.module, I create relationships between the nodes, so that Articles are associated with Issues.

When viewing an Issue node like this one, tagnode generates at the bottom a list of associated articles, with links. (Ignore the static content above the link). What I need is to be able to display the author's name along with the title.

Because "Author" is just a field in my flexinode type, I thought it would be impossible to extract the contents of that one field (because of the way I thought flexinode stored its data)... that is, until I stumbled upon the flexinode type's tabular view. This somehow fetches the author field of each article for display.

So I thought that maybe if I could just tweak the tagnode output (or, as suggested by tagnode's author, "override one of tagnode's theme functions") and mix in some of the code that flexinode is using to generate it tabular view, it could work.

The Code (I couldn't post it here).

Unfortunately, I have almost no idea what I'm looking at. I'm very much a newbie with PHP and SQL. So I thought I'd post here and see if anyone might be able to help. Is it possible? How might I go about it? Any hints you can give me would be immensely appreciated.

Thanks very much,

craig

Comments

travischristopher’s picture

hi Craig,

the Epublish module might work better for you then trying to roll your own, especailly if you are new to php and drupal. http://drupal.org/project/epublish

Epublish uses sections and topics, kind of like how you would like to use issue and articles. Use the locale module to customize the strings in the epublish module to work for your terminology.

nice looking site so far, it's clean.

czheng’s picture

I started with e-publish, and it's a great module, but it doesn't quite do what I need it to do. Bottom line is that I'm not going to be the one maintaining the site very long, and using ePublish necessitates too many extra steps for my colleagues.

I don't need to roll my own, just tweak the output created by tagnode. Just add one simple little field. hopefully, it won't be too hard.

And thanks for the positive feedback. After hours and hours of coding and tweaking, encouragement is always nice.

travischristopher’s picture

Sorry, i'm not a module developer so i can't help you there, but it doesn't sound like too hard of a mod...

On the other hand It is possible to create custom blocks for simpfying admin tasks or at least giving your users a shove in the right direction. I've offered to give the author of epublish some feedback, he seems prettty responsive to improving the module, or at least figuring out if there's a better way to go about certain issues which are unclear with the functionality.

I'm doing a pretty sizable project and was planning on using epublish, so...

czheng’s picture

There are a few reasons I decided not to use Epublish for my project. It didn't enable me to manage and organize my content the way I'd wanted. First, I didn't want editors to have to create a node AND a term for every issue. Tagnode does this automatically, AND it joins the two together. It also dynamically links all tagnodes (Issues, for me) with all of their taggees (Articles). I'd need to use multiple modules to create this same or a similar effect.

There were also some minor things with overall presentation and organization, so I decided to see if I could find a more appropriate solution. The combination of flexinode and tagnode has been everything I needed, just this pesky little thing about the author field.

NaSPA1’s picture

Hi Craig -
Just wanted to let you know you're not alone in this quest. I too looked at ePublish and found the same issues you encountered which is why I am attempting to use flexinode & tagnode like you are.
As I've explored the flexinode capabilities, I have often thought it would be great if a flexinode table display could "included' via some sort of reference in a node. Making it easy for a non-technical user to compose some instructional narrative, then imbed a flexinode table view.

Is anyone out there trying cook up something like this?

Radi

bjaspan’s picture

Craig,

Looking at the issue node you refererenced, the last four articles (starting with "The Latino Diaspora") are listed with their authors. Did you figure out how to do this automatically?

I am about to try to figure out how to override tagnode themeing (I also need access to more/different flexinode fields in the tagnode output) but if you have already figured it out, that would be great.

Thanks,

Barry

czheng’s picture

Sorry I haven't been back... Yes, I did figure out how to do it. I just made a slight modification to tagnode.module around what was, for me, line 350.
You'll have to modify the specific references

function theme_tagnode_taggee_item($taggee) {
        $itemhtml = "";

        if ($tagged_to_type = "flexinode-2")
        {
        $itemhtml = l($taggee->title,"node/$taggee->nid") . " | by " . 
$taggee->flexinode_4;
        }
        else
        {
        $itemhtml = l($taggee->title,"node/$taggee->nid") . "<br>";
        }
 
        //for events: show start time
        if ($taggee->start_format) $itemhtml.= $taggee->start_format . "<br>";
        
        //if image: show image
        if ($taggee->images) $itemhtml.= l(image_display($taggee, 'thumbnail'), 
'node/'.$taggee->nid, array(), NULL, NULL, FALSE, TRUE);

        return $itemhtml;
}
bjaspan’s picture

I switched from Tagnode to the Relativity module which seems much better implemented to me. I set up the parent/child relationships via the admin panel and said the parent should include the "teaser.". Then, in my node-parenttype.tpl.php file, I put the code:

 <?php print theme('relativity_show_children', $node); ?>

In my node-childtype.tpl.php, I have

<?php if ($main): ?>
  <!-- what I want the teaser to look like -->
<?php else: ?>
  <!-- what I want the full page to look like -->
<?php endif; ?>

All the $node->flexinode_* fields are available in the child .tpl.php page so I can make the teaser and full page look however I want.

Oh, one other thing. The Relativity call in the parent page puts a FIELDSET tag around all the children. So I added this to my style.css:

FIELDSET {
  border: 0;
}
FIELDSET LEGEND {
  display: none;
}

This is very clean, simple, and flexible. Yipppee.