Hi

I would like to add some features to DDBlock, but I'm having a little difficulty in reconciling two good resources that I found.

Let's go:

1) Choose what content to publish in the DDBlock:

I followed the instructions of the topic http://drupal.org/node/716808 and now I can choose which content to be displayed with the DDBlock. This is very good.

For this feature to work, I created a new text item called field_show. Everything is perfect.

2) Various types of content:

I am studying a way to reconcile this feature (information at: http://ddblock.myalbums.biz/faq#14n809) with the added feature in 1 above.

I know I shall create new fields with new names and duplicate the "if" statement using the names that I created earlier. Then, I know that the View "News Item slideshow" allows me to choose other types of content to publish with DDBlock. So far so good.

But I can not, for example, have the field_show field (as in 1 above) repeated in other form. Drupal does not allow it.

So I need to create a way to choose which content to publish with multiple content types.

Is it possible? How?

Again, thanks for the guidelines.

CommentFileSizeAuthor
#2 template.txt11.62 KBastutonet
#2 debug.txt1.02 KBastutonet

Comments

ppblaauw’s picture

Status: Active » Postponed (maintainer needs more info)

You can not add the same field twice but you can add an existing field.

You can add the same "field_show" to the other content-types you have, by adding an existing field (field_show) to these content types. In the view, you filter content on the multiple content types and have field_show set.

You will still use you existing view. No need to create another if statement in the preprocess functions.

Hope this helps you further, please let me know.

astutonet’s picture

Status: Postponed (maintainer needs more info) » Active
StatusFileSize
new1.02 KB
new11.62 KB

Live and learn ...

Really, I have a lot to learn about Drupal with the community. I had seen the option to use existing fields in other forms, but I have to confess: I did not know their functions. Now I know. Thank you.

Reuse fields are perfect and do not change my content. Better than that, can I use two, three or more types of content.

However, there is a problem: after entering the fields in the type of content that already existed, enable the display of the content on each existing item and add the new filter the content of the View "news_item", the images and text field "field_slide_text" are not displayed (the title of the slide has been hidden by choice).

I should clarify that the content is displayed correctly in preview of the view, showing even the contents of the new content type added. As usual, the cache was cleaned.

I removed the comments from the template.php and the debugging output follows below, along with the template.php file.

IMPORTANT: In the only article of new type of content is adding a table. I do not know if this can interfere with DDBlock. I think not.

Can you help me?

ppblaauw’s picture

Status: Active » Postponed (maintainer needs more info)

I thought first you had already the fields like image, slide-text, pager-text etc in the other content types.

If you add a cck field (which was only in one content type) and add this existing field to another content type, cck cannot keep the data in the content type table and will create a separate table for this field and the fieldname will change.

You will need to make the field names the same in the preprocess functions as shown in the debug lines

for example:

all instances of:
node_data_field_pager_item_text_field_image_fid
should become
node_data_field_image_field_image_fid

Check also the other fieldnames if they are the same in the debug_lines and preprocess functions.

see also faq: http://ddblock.myalbums.biz/faq#19n881

Hope this helps you further.

astutonet’s picture

Status: Postponed (maintainer needs more info) » Active

Works for me.

I changed the following lines:

from: node_data_field_pager_item_text_field_image_fid
to: node_data_field_image_field_image_fid

and

from: node_data_field_pager_item_text_field_slide_text_value
to: node_data_field_slide_text_field_slide_text_value

I don't know if it was necessary, but I was careful to test with several templates. Now everything is working perfectly.

Thanks.

ppblaauw’s picture

Title: Choose which content to publish with multiple content types » Choose which content to publish with multiple content types (Fixed)
Status: Active » Fixed

Great it works now!
Always curious at the results.
Set status to fixed.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.