How to move content to drupal 7 region? - drupal-7

I have created a region named "footer" in my drupal 7 template.
I have created a content type named "footer-article".
I have created a block called "footer-block".
What I want to do is:
whenever I create an article of "footer-article" content type
I want it to automatically reside in the "footer" region in all of my pages/ or some of the pages?
What is the most efficient and simplest way to do it?
because I was thinking that I always need to create new blocks and put article inside this block in order for me to position it in my desired region?
I am a newbie in drupal 7
Thanks for your help.

Install the views module. Always install the views module.
http://drupal.org/project/views
It will allow you to make a list of a content type, which you can then export as a block and add to your region. This will automatically update the block when ever you add a new "footer-article".
You can set the view to show full posts, teasers or certain fields.
It's the best module for Drupal in my opinion and is a must have for any Drupal sites.

Related

Drupal 7 Views related query

I have a Page and a Block both are created using Views.
I want to display this Block along with the Page i.e. on Left hand side, Page's content will be shown and on the Right hand side this block's content but at the same time I don't want to configure this block from the administrative settings. How can I achieve this ?
You can create 'page' template file for your view and use module_invoke() function to call your block into it.
Page template can use following pattern -
page--[path].html.twig
module_invoke() documentation -
https://api.drupal.org/api/drupal/includes%21module.inc/function/module_invoke/7

Drupal 7 basic page with a dynamic block with arguments

Can anyone guide me to a route to take as far as making a basic page in drupal 7 and then having that page load a block with images inside based on URL path.
So I have a content type that is for 1 type of pages and another content type for another type of page. Each content type has 30 pages. I don't want to create 30 pages for 1 page that will have the same content over and over but with a different logo.
http://www.example.com/contenttype1name/%/staticname
I need to make the menu have an argument passed and then based on what is passed go get the correct image.
Sorry if this is confusing. Thanks for your help.
You should look into the views module - it allows you to easily create a view with dynamic parameters (contextual filters) that allow you to easily tackle things like this.
I used contextual filters on views and nodesymlinks along with panels that was already installed.
Modules Used:
Views
Nodesymlinks
Panels
Step 1: admin > Modules > Add Modules/Enable.
Enable Nodesymlinks
Enable Panels and panelizer
Step 2: admin > Structure > Views > Add View.
Make view, name it and check block not page (I used Fields).
Step 3: admin > Structure > Views > your view.
Add filtered Criteria - Content type = your type.
Content should be Published only.
Add contextual filter: title.
Configure contextual filter: Content: Title.
Provide default value. Select Raw Value from URL.
Path component select 2. You can add it where you want in the URL.
Use path alias and check it.
Under More you need to check this box: Transform spaces to dashes in URL.
Check it in Views and save.
Step 4: admin > Content > Add Page.
Add a basic page.
On the bottom of the page you will see: Provide a menu link. You want to check that box. Now you will be able to add all the menu links that you wish this page to show up on. Add links/Paths and titles. Make sure you use argument 2 in your link to be your content on the views block in step 3.
Step 5: admin > config > content > panelizer.
You want to go into this pages panelizer, could be basic or whatever your content type would be. Add your views block and save.
Step 6:
Test it. If it doesn't work then you need to check your titles in argument 2 in the URL. Worked for me. Saved me a ton of time.

Drupal dynamic Taxonomy term values

I'm new to Drupal, and somehow miss a feature. (or I guess just don't know how to activate it)
Let's say I have a content type which is using the term reference (taxonomy field type)
Is it possible to have it filled dynamically (e.g. with already existing content from my site?
I don't want to type in all possible Tag/Term options, but instead want some kind of dynamic category choice for an author, e.g. feeded by existing content (articles/pages) from the drupal site itself.
Is there a certain module I need or how is it done?
If you want to add to your nodes a reference to another node in your site you need to use a node reference field and not a term reference. To be able to add that kind of field to your content type, you need to install References module, and probably Views to show pages that leverage your references. If you provide some details of your requirements I can be more specific.

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.

Nested Content Type in Drupal 7

as everybody can see i am new in drupal. So... i have a new site that has so much pages, and i had identified some blocks of information that are repeated in some of these pages . So... i had created my own content types trying to make them reutilizables. But my question is... Is any way to make a content type B that contents one ore more content types B? or i must create a content type for every page i have.
Other question i have is, a content type defines the structure(what fields are in) of an information part of a page, but how i then order and define where they must apear and how the must apear.
Thank you in advance.
You might try the Entity Reference module: http://drupal.org/project/entityreference

Resources