I am trying to set the Front Page of my Drupal website via a custom module I created. I think it should be noted that I also have a theme applied to my website.
I have looked around and it appears the solution has something to do with page--front.html.twig. I have located this file inside themeFolder/templates but I dont know what to do with it.
I tried literally creating this file inside myModule/templates/page--front.html.twig, with no success.
Don't know, right topic I choose or not, but here we are.
I have a problem with user auth via ajax. Here is a code:
function logInUser($uid) {
global $user;
$user = user_load($uid);
$login_array = array('name' => $user->name);
user_login_finalize($login_array);
}
Send to array uid. When ajax called there is no errors, in watchdog I see "session for user USER is opened" and user setted to USER. But there is no auth.
I am trying to add a template I have defined in my custom module to a region on my theme programatically.
I see there are regions defined in my theme .info.yml file, but I havent the slightest idea of how I would go about adding content to these specific regions programatically? I know I can create a custom block and place it in a region via the UI, but I am trying to add content to these regions via code.
Hello and sorry for my bad English. I am using Drupal 8 and i want to make a menu with categories. The menu title has to be CATEGORIES and when someone click on it, the menu has to show the categories with a drop down. So i've created categories. Then i created a menu called - CATEGORIES and i marked "show as expanded". In the menu link i added - route:<nolink> . So now i have Categories menu with drop down listing categories, but when i click on it, the page is refreshed. I dont whant the page to be refreshed everytime i clikc on CATEGORIES.