How to prevent the entire page from reloading?
Good day.
I am creating a theme for Drupal 7, and everything seems to be going well so far. A couple of questions have arisen.
A bit about my theme.
There is a main menu in the primary_link region (where the content type is selected) (and in the header region)
there is a navigation menu for articles of a specific type, which changes based on the main menu. (in the left_column region) and (in the main-wrapper region)
and there is a content column where specific content types are displayed depending on the main menu. (in the right_column region) and (in the main-wrapper region)
The first question.
How can I make it so that when selecting in the primary link, only the region below in the structure reloads? Accordingly, the main-wrapper region
then when selecting in the left_column region, only the right_column region reloads.
I understand that I need to use AJAX here, but I haven't found anything clear on this topic.
The second question
How can I make it so that a specific content type is displayed in the left column? (a special view - form) The lists are different for each item in the main menu and accordingly in the right column depending on the selected element in the left column.
The third question
I made three columns and they are of different heights. I want them to be the same height. I am using Div for formatting.
In page.tpl.php I am using Drupal 7
the following piece of code
<script language="JavaScript" type="text/javascript"> function setEqualHeight(columns){ var tallestcolumn = 0; columns.each(function(){ currentHeight = $(this).height(); if(currentHeight > tallestcolumn){ tallestcolumn = currentHeight; } } ); columns.height(tallestcolumn); } $(document).ready(function() { setEqualHeight($(".container > div")); }); </script>
Finally figured out this hassle after dinner :) It turns out in Drupal 7, it doesn't like when you write $
it needs to be replaced with jQuery and everything worked immediately with just a click.
As I read, the reason is that jQuery works in noConflict mode
it should look something like this:
jQuery(document).ready(function() { setEqualHeight(jQuery(".container > div")); });
So everywhere replace $ with jQuery and happiness will come to you.
I hope this information will be useful to someone.
The first two questions remain open.