How to add login/logout link in secondary links or user menu in drupal 7?

How to toggle between login/logout link the user menu or secondary links in drupal 7?I am using bartik theme.

Overriding theme links

I want to override the theme_links() function but only for the 'node' part of the page rather than every single menu item on the page.

This is my code in the template.php at the moment (I've commented my changes):


function bsc_theme_links($variables) {
$links = $variables['links'];
$attributes = $variables['attributes'];
$heading = $variables['heading'];
global $language_url;
$output = '';

if (count($links) > 0) {
$output = '';

if (!empty($heading)) {
if (is_string($heading)) {

$heading = array(
'text' => $heading,

'level' => 'h2',
);
}
$output .= '<' . $heading['level'];
if (!empty($heading['class'])) {
$output .= drupal_attributes(array('class' => $heading['class']));
}
$output .= '>' . check_plain($heading['text']) . '';
}

// adds clearfix class to

    $attributes['class'][] = 'clearfix';

    $output .= '

      ';

      $num_links = count($links);
      $i = 1;

      foreach ($links as $key => $link) {
      $class = array($key);

      if ($i == 1) {
      $class[] = 'first';
      }
      if ($i == $num_links) {
      $class[] = 'last';
      }

views, use contextual filter to filter results by a field from a 'related' node

Hi everyone, I hope the title of this post makes some sense. I have built a some content types with node references and am trying to sort based on a referenced node's fields in views.

For example i might have a content type of 'country', this content type contains fields for things like population and native language. I then have two other content types with node references to the country type 'person' and 'city'. I want to be able to set up a contextual filter to sort 'city' or 'people' by the native spoken language so ideally the url would be something like:

www.mywebsite.com/language

this would will return people and citys that speak the language,

ideally then i could go to

www.mywebsite.com/language/city

or

www.mywebsite.com/langage/person

to return a single entry

Does anyone know how i would set this up in views?

Right now I have a views that shows me all the 'people' and 'citys' in one list but i cant get it to refine the results by the 'language', I tried to add a contextual filter of the 'country' language field, but i get no results when i test it out. I have set the relationship up in the relationship menu, so it has field_country-nid in the menu and have tried setting the filter with 'use relationship' drop down to be set to the 'country' or to the default and nothing returns any results.

File output

Hi,

I want to create a menu callback and output a file on that. For example:

Overriding style.css

Hi,
I want the default style.css to load in my theme then based on the template type I want an additional css file named main.css to be loaded in my page.

I did it in template.php using the preprocess_page and drupal_add_css() now the problem is as per css the style.css comes last hence it overrides the main.css and I want it the other way around. is that possible ?

Cheers,
vishal

No updates are registering

I am having strange problems updating everything in my Drupal installation

Pages

Subscribe with RSS Subscribe to RSS - Drupal 7.x