By Nithyanantham on
I have created module.I want to display the images and my text on my custom page with my own style.How to display the images and text?
I have created module.I want to display the images and my text on my custom page with my own style.How to display the images and text?
Comments
hook theme
If you have created the custom module, you can create a menu item and callback in which you can call a theme function using
hook_theme
You can place tpl file in your module folder, In tpl file you can render the image and text.
Hope this will help you.
How to create .tpl.php???
Thank sir for response.I am beginner for module development.i have doubt in template file creation.how to create template and if i want to create template what are the functions i want to use in the .module file.If I created template file for the particular page how its identify this template file for this page????
For creating a page
For your better understanding let me put down the code in detail, hope this will help you. For creating a page you can create a menu item using hook_menu
To create a template file you first need to register the theme using hook_theme, you can keep (YOUR_TPL_FILE.tpl.php) file in your module folder and place under templates folder.
Menu item will call below function, In which you are calling the registered theme which in turn refer to the template file.
how to change the full layout
how to change the full layout for single page??I have created simple theme.how can i use the theme for the single page of my site??
pls help me.
hook_preprocess_page
I think you can use hook_preprocess_page
Generate template file
After specifying theme suggestion, you need to create template file with the same name. In name of theme suggestion one needs to replace "_" with "-" while creating template, e.g. maintenance-page.tpl.php
I already told you how to do
I already told you how to do this in your other thread: https://www.drupal.org/node/2341187
Contact me to contract me for D7 -> D10/11 migrations.