V
V
Vlad1712015-09-25 02:03:44
Drupal
Vlad171, 2015-09-25 02:03:44

How to override the 'content' region in my theme?

Three days, three questions. Drupal is not easy for me. What am I talking about... My own theme from scratch. Regions defined in page.tpl. There are three regions in the center - content and 2 sidebars on the sides. 2 new types of material have been created, output templates have been redefined for them. A module has been created that displays a block with materials of only one type in the left sidebar without using Views. The problem is that all newly created materials appear in the content block. As planned, only one type of materials should be displayed in three regions. You can make custom blocks for each type of material. But the content block is mandatory in Drupal 7, it can be defined to another region (not content), but it should be. Accordingly, the materials will again be duplicated there. Gloom, in a word ... On the other hand, in the content block, the full text of the material is displayed at the teaser link. What if you want the full material to open in the same block as the list of teasers. Anyone willing to help?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
H
heartdevil, 2015-09-25
@Vlad171

Hello)
1 way. Go to admin. There you go to the Content section. In the list of entries, click on edit for the required entry. In edit mode, at the very bottom there is a block with settings. You need Publishing options. Namely Promoted to front page. Uncheck the box and the entry will not be displayed on the main page.
2 way. In the previous option, you prohibited the recording of only one specific article. If you need to disable the display of a whole type of material on the main page, say, news, then in the admin go to the Structure->Content types->Publishing Options section and uncheck the Promoted to front page option.
3 way. The most flexible, but also gemorno. This friend has xandeadx.ru/blog/drupal/104there is an excellent site with different chips on drupal. Climb at your leisure. The bottom line, as I already wrote to you, is to use the preprocessing functions.
A couple of secrets. In Drupal, the most important object is $node. Put it in var_dump on any page and it will display the contents of the current node, which you can easily work with. It is also important to understand how Drupal works in general. read about hooks in drupal. Everything is tied to them. Roughly speaking, hooks are provided for all functionality in drupal. You only need to find them and hang up your handler (function). Here, for example, the page is rendered. There is also a hook for this event. There is also a hook for predrawing and so on.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question