Sibiraj PR
  • Member for 9 years, 9 months
  • Last seen more than a month ago
How to pass Views contextual filter via URL?
12 votes

Use Provide default value in the contextual filter. also you can use php code for getting the value from url

View answer
How can I insert PHP code in Views?
Accepted answer
10 votes

Yes you can add php code using views_php Add field in views global Then add code you need is in Output code sector. I thing here is the problem for you. you add php code to 'Value code'. Then look ...

View answer
How to include a custom menu in page.tpl
Accepted answer
5 votes

Try this <?php $menu = menu_navigation_links('menu-your-custom-menu-name'); print theme('links__menu_your_custom_menu_name', array('links' => $menu)); ?> You can also add to template....

View answer
Node authors notified by email when a comment is added using trigger module - node token not getting
4 votes

I got the token for the question i posted here. [node:author:mail] should be replaced with [comment:node:author:mail] drupal.org link to refer

View answer
How can I display a form button on top of the form?
Accepted answer
3 votes

If you use $form['actions']['my_submit'] like this, then you will get the button inside $form['actions']. $form['actions'] weight would be considered with the weight of other fields. Try the following ...

View answer
Remove an item from "menu local task"
Accepted answer
3 votes

If you need the registration feature and you need to just remove the link from the default tab, then use menu_alter hook. function modulename_menu_alter(&$item) { // Hide the "Create new account" ...

View answer
Sort nodes by latest comments on it
Accepted answer
3 votes

"Last comment time" is sort. Then use 'Sort descending'

View answer
Views relationship using taxonomy
Accepted answer
2 votes

I thing you need to sort the node using the taxonomy fields. Is it so then use the steps: Add realtionship in views Then add 'taxonomy terms on node' Then go to filter then you can find all the ...

View answer
Why is my Multi-Step form going back to the first page instead of moving to the third?
1 votes

In your code you can make a fix with step_one_form function. function step_one_form($form, &$form_state) { // Display page 2 if $form_state['page_num'] == 2 if (!empty($form_state['page_num']) ...

View answer
Removing header region
Accepted answer
1 votes

You need to change the html structure for this. Open page.tpl.php then remove the header section from there.

View answer
How to call a function on node submit in drupal 7
Accepted answer
1 votes

function MODULE_form_alter(&$form, &$form_state, $form_id) { //echo $form_id; // get the form id switch($form_id) { case 'name_of_the_form': $form['#submit'][] =...

View answer
EntityFieldQuery for getting the count of a user blog
1 votes

Try this global $user; $query = new EntityFieldQuery; $count = $query->entityCondition('entity_type', 'node') ->entityCondition('bundle', 'blog') ->propertyCondition('status', 1) // ...

View answer
#ajax response handler function
Accepted answer
1 votes

Try this (function($) { Drupal.YOUR_MODULE_NAME = { form_id: 'FORM_ID' }; Drupal.behaviors.YOUR_MODULE_NAME = { attach: function(context, settings) { for (ajax_el in settings....

View answer
How do I get Drupal to use my themes page.tpl.php template for the front page?
1 votes

Hi i think drupal will take the page.tpl.php with out any code. Look at the bartik theme structure. Here page.tpl.php is used in front page also.

View answer
how to show html content when select box item selected
Accepted answer
1 votes

In custom form you can use ajax API for this. You can find the sample code from here When you are using node form then use conditional_fields module for this purpose.

View answer
REST won't work
Accepted answer
1 votes

$endpoint = new stdClass(); $endpoint->disabled = FALSE; $endpoint->api_version = 3; $endpoint->name = 'rest'; $endpoint->server = 'rest_server'; $endpoint->path = 'rest'; $endpoint->...

View answer
How to access cookies in Views PHP Code filter?
1 votes

Checked with the views php module. Then i get the cookies stored.

View answer
My views slideshow doesn't work when the display is called from page.tpl.php
1 votes

you can try views_embed_view to call a views block programatically. views_embed_view <?php print views_embed_view($view_name, $display_id, $argument); // with single argument print ...

View answer
how to show message in popup when user register to site?
0 votes

You can check Better message module for this purpose. From the module's project page: Better Messages is a very simple module that provides "Popup-like" Drupal messages. Better Messages ...

View answer
Drupal Views Inject Content
0 votes

You can use Gmap. There is also a great screen cast that shows how to use it. You can also take a look into the OpenLayers module to add maps into nodes.

View answer
Using form_set_error in the submit handler
0 votes

function example_form_validate($form, &$form_state) { } Use this function to validate your data when submitting a form

View answer
adding multiple content to homepage
0 votes

Many ways are there to create like this. Panels module is used to design your home page like this. views module can create home page like this. If you have good coding experience then you can ...

View answer
How to display only the menu items and not the parent menu?
0 votes

You can use the Menu block module, or print sub-menus or any level menus. echo theme('links__system_main_menu', array( 'links' => menu_navigation_links('main-menu', '1'), 'attributes' => ...

View answer
Pull all articles from my Drupal Site as JSON
0 votes

You can try some module like feeds or services or views_data_export or node_export

View answer
What exactly is a theme?
0 votes

Look at this template. This will explain how the theme doing in drupal.

View answer
How to display registration form fields based on the taxonomy term?
0 votes

I think we can try with combination of two module. field_collection conditional_fields

View answer
exclude contextual filters from breadcrumb
0 votes

You can customize the breadcrumb from contextual filter.

View answer
Ajax field in products page
0 votes

There is no such default functionality in drupal commerce. Commerce Cart Ajax This module will ajaxify your cart page. If you need this in product detail page then you can build a custom module for ...

View answer
Modifying CSS class of Menu Block links?
0 votes

If you need to add class to the anchor link then use this module. menu_attributes If you need to add class in li then use theme_menu_link function YOURTHEME_menu_link__main_menu($variables){} If ...

View answer
Theming a custom form
0 votes

Try this function _my_form() { return drupal_get_form("my_form"); } function MYMODULE_theme() { $themes = array( 'my_form' => array( 'render element' => '...

View answer