1

I am new to Drupal and I've been trying to create a site to function as a lending inventory. I have so far created a new content type with my fields (describing product details) which the user fills with data every time he adds content(adds a product). I want to be able to print the saved result of the add content page to a document but not in the display that it has as a row of the table view. To be more specific I would like to print every product and its details in a customized way so that the details are displayed in two columns and above them a text of lending agreement can be put.

I am sorry in advance for the complexity of the description Does anyone have an idea?

Thank you

0

Hello @katerina and welcome to Drupal Answers.

You could use Display Suite and do the following:

  • Enable DS and DU UI modules
  • Create a new View mode for nodes, e.g. "Receipt" enter image description here
  • For your content type, go to "Manage Display" > "Custom display settings" and activate the "Receipt" view mode for your content type enter image description here
  • Now you should have, besides "Default" and "Teaser", the "Receipt" view mode available under "Manage Display" for your content type
    • Available directly under admin/structure/types/manage/PRODUCT_CONTENT_TYPE/display/receipt
  • You can now select the layout that suits you under "Layout for PRODUCT_CONTENT_TYPE in receipt", for example "Two column stacked"
  • You can use the available regions of that layout to lay the details out between the two columns
  • For the "Lending agreement" text, you would need to use a DS Code field, available under "Custom fields" > "Add a code field". You can enter your Lending agreement text in there, and then place that field in your header area.

That should be enough to cover the configuration of your custom display.

In order to get some URL access to that view, per product, you could use the View Mode Page module. Once you install it, you get a new configuration tab in your content type's "Manage Display" page, called "View mode pages". There you can do the following:

  • Enter a URL patter under "URL pattern", e.g. 'node/%/receipt'

Save that configuration, clear all caches, and try to enter a URL for an available node, e.g. node/123/receipt
This should load that node using the view mode you configured above.

Hope this helps, good luck!

  • Hello @Stefanos, it seems that the Receipt is not part of the list of the Custom Display Settings – katerina prwtogerou Mar 29 '16 at 9:42
  • Hello @Katerina, I updated my answer with 2 screenshots, can you check your configuration against mine to see if we are in agreement? Cheers – Stefanos Petrakis Mar 29 '16 at 10:15
  • Everything worked perfect. Thanks a lot for your help! – katerina prwtogerou Mar 29 '16 at 13:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.