The module "single_field_viewer" is simple module, which allows user to present selected CCK field on dedicated page.
User can select (in node type configuration), which fields can be displayed on separate page. Rendered HTML code depends on template. User can create template for specific field or specific field assigned to node type.
Motivation behind this module:
This module was created to solve such problem: We wanted to display images on videos on separate pages. It was important for us because SEO policy. We considered two ways: using images as separate nodes and using nodereference fields or using images as node fields. Our experiences with image as node policy were bad, because large count of image nodes leads to performance problems (in one of our project we have over 250 000 image nodes).
This module allows to display in this way all CCK field types. It's not constrained to imagefield or emfield.
Duplication:
I haven't found module with similar functionality.
Motivation behind publishing this module:
This module is quite simple piece of code, but I thing this could be usefull. More users => more feedback => Better quality of module :)
| Comment | File | Size | Author |
|---|---|---|---|
| #11 | single_field_viewer.tar_.gz | 5.21 KB | jsobiecki |
| #5 | single_field_viewer.zip | 9.87 KB | jsobiecki |
| #1 | single_field_viewer.tar_.gz | 3.01 KB | jsobiecki |
Comments
Comment #1
jsobiecki commentedAdded module code.
Comment #2
avpadernoHello, and thank you for applying for a CVS account. As per requirements, the motivation should include a description of the module features (more than two sentences).
Comment #3
avpadernoComment #4
jsobiecki commentedModule description:
Module has implements one feature. Site administrator can select CCK fields. For each of selected field type,
under path in form node/%node/field/{field_name}/{delta} field value will be displayed. HTML code is based on phptemplate templates. Templates can be created on field name level, or on field name in specific node type.
This module was designed as solution for browsing photos on site, which are stored as CCK fields. We needed to display all photos on separate pages.
Comment #5
jsobiecki commentedI attach upgraded module. I added support for pathauto and tokens modules. I wrote README file. This is a description of module:
This module allows CCK fields to be displayed on separate pages. Site builder
can select fields, which will be used in this way.
For each field assigned to specific node type, themer can prepare proper templates.
If you are using pathauto module,
this module allows to create path patterns for each of fields displayed in
this mode. This module implements also basic support for tokens (built-in
support for imagefield and emvideo title and description attributes).
Fields inherit view access right from node, so if node is unpublished or
node access denies viewing of node, CCK field will be inaccessible as well.
This module was created in order to replace old approach of media handling used
at our websites (it was image as node approach and nodereference as glue between
parent nodes (like articles) and child as images). In our case it was big impact
for performance (we got over 300 000 image nodes for only 70 000 "parent nodes")
This solution is quite lightweight (it doesn't requires views) and uses cck
content cache, so it works really fast.
This solution has some disadvantages. CCK field is not powerful like node, so
you cannot do many things like comment such nodes and do other thins.
But if you need to display fields on separate pages, with various layout. If you
need some basic support for tokens and pathauto, this module might serve you well.
Comment #6
jsobiecki commentedDo I have to prepare any additional information? I hope now everything is complete :)
Comment #7
uday4ru commentedwarning: array_merge() [function.array-merge]: Argument #1 is not an array in /home/XXX/public_html/XXXX/sites/all/modules/single_field_viewer/single_field_viewer.module on line 221
can u plz help me where it is going wrong. i need something like this ofr my website.
Comment #8
avpadernoComment #9
jsobiecki commented@uday4ru
Ok, I will check this warning message and fix it. It should be done this week.
Comment #10
uday4ru commentedThanks Sir , i,am waiting for patch. I whant seo friendly images which google can index links. This module is best method to do it.
Comment #11
jsobiecki commented@uday4ru
This version shouldn't generate reported warnings.
Comment #12
uday4ru commentedThanks for update , now error is not displaying , But i,am not able to make it work as i,am new to drupal.
http://udaymovies.com/ , i have installed modules and in cck node types i cheked it and i got
"Please select fields for which single field value can be displayed on separate page. If enabled, field value will be displayed at node/%nid/field/%field_name/%delta"
now after this how to check module is working? . what i have to type in place of delta. my plan is when users click on uploaded images it should open in page.
thanks
Comment #13
jsobiecki commented@uday4ru
Lets assume that you added CCK imagefield "field_article_image". %delta is order number of cck field value. (CCK field values are stored in database in deterministic order)
So, if you added article with set of few (lets say 3) images at field_article_image, you can display them on separate page under
node/%nid/field/field_article_image/0, node/%nid/field/field_article_image/1 and node/%nid/field/field_article_image/2.
If you need SEO friendly urls, you need to configure pathauto module (this is explained at README.TXT)
Last important thing:
I found documentation bug (missing section in README.txt, i will fix it later)
In order to display those values, you have to prepare template for those values. Proper template names are
single_field_viewer.tpl.php
single_field_viewer-{field_name}.tpl.php
single_field_viewer-{nodetype}-{field_name}.tpl.php
You can use single_field_viewer.tpl.php as generic template (you will find available template variables there)
Ok, I hope it will help :)
Comment #14
avpadernoPlease read all the following and the links provided as this is very important information about your CVS Application.
Drupal.org has moved from CVS to Git! This is a very significant change for the Drupal community and for your application. Please read the following documentation on how this affects and benefits you and the application process:Migrating from CVS Applications to (Git) Full Project Applications.
Comment #15
jsobiecki commentedI added experimental project: http://drupal.org/sandbox/harijari/1125692
Now I'm waiting for review of project ;)
Comment #16
jsobiecki commentedComment #17
sreynen commentedUpdating title.
Comment #18
jsobiecki commentedNobody interested in review?
Comment #19
jthorson commentedUpdating issue priority, as per the new application priority guidelines.
Comment #20
grendzy commentedlooks ok to me.
Comment #21
gregglesThanks for your contribution, harijari! Welcome to the community of project contributors on drupal.org.
I've granted you the git vetted user role which will let you promote this to a full project and also create new projects as either sandbox or "full" projects depending on which you feel is best.
Thanks, also, for your patience with the review process. Anyone is welcome to participate in the review process. Please consider reviewing other projects that are pending review. I encourage you to learn more about that process and join the group of reviewers.
Comment #24
avpaderno