Node referencing: How do you display (with VIEWS) a node(edition) with all its references (articles)? - drupal-7

Ingredients:
Drupal7 + References + Views module installed 2 content types:
magazine issue + magazine articles (for each issue)
Article c-type has a reference field: issue_no which displays the
issue it belongs
I made a Views to display me a plain list of issues only.
Requirements
1. When I click on the issue in the issue list I want to see all its references nodes(=articles) attached
2. I need to highlight the latest issue in the list by creating a separate page VIEW on the frontpage that contains articles of the latest view.
I would appreciate any help.

Recently I have done something similar for a project. In article view page go to advanced-> add a contextual filter of issue no. In magazine issue view page in fields-> add -> add a custom text field -> rewrite results -> select Output this field as a link to link it to your article view page with argument as issue no.
For example if your article list view page is article_list, you can add a rewrite result in custom text as article_list/[field_issue_no]; where [field_issue_no] is your issue no field.

Related

Overview page of elements from a Typo3 page tree

I'm primarily a UI and graphic designer and, eventhough I have some experience with Typo3, I'm completely stuck at the following problem:
I have a large page tree with single pages for items from a catalogue (one item per page), the layouts for these items are built with Armin Vieweg's beautiful "Dynamic Content Elements" extension (DCE).
Now I want to create an overview page where I reference some of those items automatically - ideally I want to check a box in each element I want to display there (I would add a field catalogueItemPreview to the item DCE which authors can check or uncheck).
Unfortunately, I have no concrete idea of how the database is structured and how I could build a query (where would I even do that? in a custom-made plugin?).
This is how I imagine it could work: On the overview page I use a plugin/an extension in a Content Element that does the following:
search Typo3 DB for content elements with a field called "catalogueItemPreview"
return fields "catalogueItemTitle", "catalogueItemShortDescription", "cataloguePreviewImage"
use a template to render previews of all those elements on the overview page
I'm happy for ANY pointers towards a solution as currently I'm completely in the dark about where even to begin ...
Schematic screenshot from the Typo3 backend
thanks for using my DCE extension :)
Well the fields you have defined and their values in content elements are stored as XML, because the current version of DCE is based on Flexforms.
This makes it very very difficult to do MySQL queries using one of the field properties in WHERE clause. You could check for a xml string in the field pi_flexform but this is not recommended.
Instead I would use another property of content elements (tt_content) to mark the items as "Show on frontpage". For example you could create a new layout or section_frame value for that. Then it is very easy to just output the elements you want, using TypoScript.

In Drupal 7 views how to give external link (another website) to a title?

Iam new to drupal 7 views.
I have a content type contains title, description fields. I want the content title's to scroll at the top of the page, so that i created a view and it works fine.What is my question is, i want to link a content (eg: 1st content (title) in a scroll) to another website instead of content page, the remaining contents linked to the content page. Is it possible?.If it is possible how it can be done?..
Thanks in advance,
A.John Melchior.
Yes, it's possible.
One way to do it, would be to use the Link module to create a link field in your node.
Use the link field to input the external link value.
In views add the link field, before the title ( order is important ) and exclude it from display
Add the node title field in the views and in the rewrite field output option, use one the link field token as your path.
I'm not looking at the Views UI right now , but you should find at least a couple of ways to redirect content when the node title is clicked. You should have the Rewrite field output and the Output this field as a link.
You could make use of Display Suite coupled with the description above.
Create a link field for your nodes.
Create 2 view modes for your content type via Display Suite. View Mode 1 will show the link field as the first data element, View Mode 2 will show the title as the first element.
Configure your view to show output using Display Suite, configured to show the first record using View Mode 1, all others using View Mode 2.

Drupal 7: Adding content/nodes from custom content type pages to another page

I'm working on a Drupal site an need to implement the following:
I have created an about us page template (page--about.tpl.php) and a custom content type for the about us page and linked the 2 using suggestions. I also have a custom content type for staff profiles that I need to add on the about us page in a tabbed format.
I can't seem to find a way to get the staff content to display in the about us page. I would ideally like it to render it the same manner as blog posts would display in a blog page.
So my question is, what code do I use to render all the nodes of the staff profiles content type in the about template page?
p.s I'm a bit of a Drupal noob, done a lot of reading but come up empty on this one.
If you already created content type About us (that is what i understood from mockup and explanation) then maybe you could use Views with EVA. That will enable you to have view as field in content type.
You can set it up with manage display or print it in template as all other fields. For example:
<?php print render($content['your_view_entity_view_1']); ?>
Other way would be to embed view in template. For example:
<?php print views_embed_view('your_view', 'block'); ?>
You can use the excellent Views module to create a block to list all your staffs.
Then you need to place the block that you had created with the help of view module in about-us page.
The Views module will give you suggestions to about which template to use.
EDIT: After the op provided the following image.
After you create a view to show all the Team member nodes you could simply print the view in your about us specific page template using following code.
$view = views_get_view('view name');
print $view->render('display_id');
Another option to do the same thing is, make blocks for all the content, viz. The Firm, The Team, Awards, Technonogly, Services and use quicktabs to display the content.
Yet another option to show a view as a field for a node is use EVA
Going the quicktabs way you can provide a lot of flexibility of showing teaser in about us page and leading to details about the same. For example each award can be a node in itself.

displaying a particular field of a related node with Entity Reference

Using Drupal 7, using views i have created a related 'videos' block for various page nodes. I can get the title to show but i can't see how i can just choose to show the 'thumbnail' field for related videos. I'm using the entity reference module. Is this possible within the view?
heres the example...http://testing.odvod.ca/bishop/what-we-do/our-approach
i figured it out...
in the view i created a relationship choosing:
--Entity Reference: Referenced Entity
--A bridge to the Content entity that is referenced via field_related_videos
The added the field to view and chose the reference the desired field content with the relationship drop down.
this tutorial helped: Using Entity Reference in Views

Create content in drupal7

Is it possible to have a create content link (node/add) specific to the node/page being viewed.
As an example, on a blog page user gets add/blog link on an article page - add/article.
And a similar question for taxonomy terms, on a page of term A any content that has been added automatically gets tagged with that term. On a page of term B - tagged with term B.
I don't want users manually select terms and content types each time they post.
Thank you.
You can inject or alter node and comment links to link directly to the add page for the current content type via hook_node_view_alter and hook_comment_view_alter.
If you are viewing a term page (for term foo) which lists multiple content types including the article type and you want a link to the node-add page for the article type and automatically populate it with the term foo, then you will need a combination of hook_node_view_alter to inject a link to node/add/article?term=3 (where 3 is the term ID of the current node / page) and hook_form_alter which alters the node form to read the tid from term=3 and selects the related term.
Hope that made sense :)

Resources