By courtney on
I've installed the (amazing!) Flexinode module for Drupal 4.4 and have run into a problem with displaying the custom fields that I've added to my new content type. When a page created with a flexinode is promoted to the front page, only the Title and Description fields are shown (not the custom drop down box or check boxes that i've added). These other fields are only displayed when you click on the Title to view the node. I have set the node setting for 'Length of Trimmed Posts' to 'Unlimited', but that didn't affect it. I'm using the chameleon theme, but see the same results with xtemplate. Has anyone else encountered this or worked around it in some way?
Comments
This is a theme issue. The th
This is a theme issue. The theme needs to be edited to display any non-standard fields in the "node preview" that is visible on the front page and any other place many nodes are displayed (e.g. taxonomy view).
Can you provide an example?
Thanks for the response. I'm not sure of how to do this though. Do you have an example that I could use in modifying my theme?
It needs to be done in PHP in
It needs to be done in PHP in whatever theme you are using. When outputting a node teaser, you'll need to check if it is of type flexinode, and then write code to output those extra fields.
One example would be so helpful...
I'm trying to use flexinode to give my users a custom header for their personal blogs. The flexinode has only one field that can be filled with HTML to create the header. It displays fine as an individual node. Its title displays at the top of the blog where I want it, but, of course, not that field. I've turned off the "submitted by." I just need to "turn on" that one field to display. The "readme" file for flexinode is of little use. Just one example of how to "turn on" the flexinode and designate the field that is to be displayed would be so helpful.
I could really use some help
I could really use some help with this too. Flexinode is a marvelous module but its use is severely restricted by the lack of help available for customizing output. If anyone could provide some samples or more detailed instructions on how to modify the theme, it would be hugely appreciated. Thanks.
There is a customized version
There is a customized version in my sandbox which supports configurable teasers. Is not yet fully working.
http://cvs.drupal.org/viewcvs/contributions/sandbox/killes/
--
Drupal services
My Drupal services
flexinode updates?
hi!
killes, can you give a short update as to what you modified flexinode module is currently able to do and whether it is stable enough to be used with Drupal 4.4.1? I've just updated my local copy of the drupal contribs folder to cvs, and I see that you're updating it regularly.
thanks.
My version creates thumbnails
My version creates thumbnails (in a not too sophisticated way) and you can configure which fields to show in the teaser. There are still some bugs with thumbnail display, though.
I am developing this only for use with cvs with no intend of a backport. But if you are lucky it still works with 4.4.
--
Drupal services
My Drupal services
2 flexinode versions hacked together, but further issues
killes,
I hacked together the original and your flexinode, selectively leaving out stuff from yours, to work for me in Drupal 4.4.1, and I'm one step further now... but not quite there.
Now, with a single tick on the content types admin page, I can put the custom fields on the front page together with the node, which is great. But I was discouraged to see that on the front page, these new custom fields show within the content flow.
I need these fields to have their custom divs within the content div so that I can theme them. The same goes for the node/view/nodeid page: although they have their own divs, but no class declaration, which makes them impossible to theme. I suspect that implementing these is a piece of cake to many people in this community, but not for me.
Also, it seems intuitive to me that if a field is left empty it should be left out completely from the node display instead of having its label and nothing beneath it. Anyone having ideas?
I'm tired of prefixing these cries for help with "my php skills are modest," and now I'm even beginning to feel guilty about it. I've spent 5-6 hours trying to address the above issues, in vain. This module seems like a blessing indeed, but the language of its install file is so pro with respect to the theming part that those of us who are not already Drupal developers can't possibly make it to work as intended in the first place.
And now my grand finale:
This goes out to anyone who is competent enough to create or enhance modules... and I know there are many of you. Please help us miserable creatures who just can't make sense of the casual developer lingo in the flexinode install file. Show us exactly how to do it. What needs to be modified--if anything--in the .theme file, the module itself, the .inc files, whatever. If someone would provide exact instructions for any of my above questions, I'd be more than grateful.
Thanks.
--added:
I just submitted my first patch ever :)
it solves the "flexinode type permissions not updating on the user permissions page" problem. But that's as far as my PHP knowledge goes :)
i'm right there with ya.
hey. i am also working on some hacks and certainly am learning SOME php, but i am not up to the level of developer. i too have felt like what i am doing could be done in about 7 minutes if i was fully competent in drupalese or even php. i have also been asking for solutions to this particular problem that you are describing. i'm glad you are working on it. this is just a post of support...
erik
flexinode custom theming capability: one solution
eric, and anyone else having an issue with flexinode custom theming. I hacked together my version of the module to be able to make custom style declarations to all custom fields generated by flexinode. See my ugly but working patches here.
I am certainly no css wizard.
I am certainly no css wizard. Can you lay out the structure of divs that you think the generated teasers and content should have?
--
Drupal services
My Drupal services
To begin with, I would like a
To begin with, I would like a div inside the content div that has a class of flexinode-n where n is the id of the flexinode-type node. so e.g
< div class="content">< div class="flexinode-1">as seen in the bookreview module. Since the bookreview module does not need patching the .theme, I would think this can be done from the module code.
Then, the install file says the following about the fields inside my proposed flexinode-n divs:
Every custom field is set as a property of the node. To create a custom presentation for your new content type, add logic in your theme's node function to switch on the node type and print out the fields in the way you choose. The fields are all named flexinode_n where n is the field ID.
Alternately, you can override the theme_flexinode_* functions to change the look of all fields of a certain type.
Currently, the node does not have a div tag identifying the node type (i.e. my flexinode-n), but inside the content div it puts as may divs as there are custom-defined fields, in the case fo textfields in the format
< div class="form-item">< label>Field title:< /label>< br />content of field< /div>What the install file proposes, I think, and me too, is a further class that identifies the fields as flexinde_n, or since this would be only slightly different from the wrapping div of flexinode-n, something like flexinode_field_n would be better, where n in this case is the id of the custom field of one flexinode node type.
by the way, the bookreview module does this already (I'm having other issues with that). it creates a div immediately after the opening content div, and it also has a distinctly named class for all fields within.
issue created for customization
killes, I created an issue for this here, if you're still willing to help, or anyone, for that matter. I think that's clearer than my post here.
your version, found in your s
your version, found in your sandbox, allows fields to be put on the front page too. But the behavior is strange, because when I set some of them to appear on the front/tax page, it messes up line breaks within the content there, but not on the node view pages. When I remove the ticks, that is, don't put any of the custom fields on the front/tax page, br tags return to the content on front/tax pages.
Page that lists all nodes of one type
I'll post here for the sake of keeping all this flexinode info in one place.
I'd like to create a PHP page node that I program to output all of the flexinodes of a certain type. Could anyone offer me a bit of advice or pseudocode that would help me do this?
It looks like all the methods I might need are right there in the flexinode.module, but it is not exactly clear what each one does, when it gets called, and what the params are.
For example, the method flexinode_page_table($ctype_id = 0) looked promising. I pasted this method into my php page, passed in 3 (to determine the flexinode type) and pressed submit. Chaos. I did see (among the chaos) a couple of fields from the node type that I was looking for, but the method obviously wasn't intended for this.
Then there is the method flexinode_view($node, $main = 0, $page = 0). This looks clear enough; it returns a themed flexinode. But the $node input parameter, is that a plain vanilla node, or the result of calling flexinode_load($node)? And how is flexinode_view intended to be used vs flexinode_content($node)?
Thanks for any help!
- Robert Douglass
-----
visit me at www.robshouse.net
Here's a start. Comments on c
Here's a start. Comments on code idiom and style are welcome. $cd represents one compact disc in my flexinode database.
[?
$flextype = "flexinode-3";
$query = db_query("SELECT nid FROM node WHERE type = '%s'", $flextype);
for($i = 0; $i < db_num_rows($query); $i++){
$result = db_result($query, $i);
$cd = node_load(array("nid" => $result));
dprint_r($cd);
}
?]
- Robert Douglass
-----
visit me at www.robshouse.net
[?php $flextype = "flexinode
Would be my version of this...
--
Drupal services
My Drupal services
Is it possible?
Hi Killes,
Is it possible to put that sql query in a node-flexinode-x.tpl.php file?
And assign custom names to each field in the fleixnode array?
i.e.
field[1]= $website_link
field[2]= $website_name
etc.
So I can use a php print statement to print out individual fields in a custom node-flexinode-x.tpl.php file...
Apologies in advance if that is a stupid question..
Dub
Currently in Switzerland working as an Application Developer with UBS Investment Bank...using Drupal 7 and lots of swiss chocolate
any progress?
hello,
I was wondering if anyone succeeded in doing the above, i.e. calling flexinode fields outside of a .tpl.php file (for doing the same in a .tpl.php file, check http://drupal.org/node/25055)...
on www.indymedia.be, I would like to use flexinode for the features on the front page. I'm using it without a problem in .tpl.php files, but can't get it to work in the front_page module (using embedded php tags). can anyone point out to me how to call flexinode fields in a php enabled block, front_page, ...
many thanks in advance..
-- bruno
Module bynodetype
I recently wrote a simple module to create a page listing nodes of a specific type (not just flexinodes) - see http://drupal.org/node/view/7817
putting flexinode fields anywhere
Just my two cents, I was trying to change theme_event_upcoming_item in event.theme to show the location of the event. What I did was dropped into the theme_event_upcoming_item function
to find the flexinode attributes for the node. I found my customer location field (field 5) and ended up with:
As my final modified function. Now the right side box has a nice display of upcoming events and their location.