Skip to Content

Quick Faqs

Q - How do I create dynamic URLs that will change when I move the site?
A - Use php print ...

Simply alter the link:

<link type="text/css" href="themes/dropdown10/page-front.css"  rel="stylesheet"/>

to become...
<link type="text/css" href="<?php print base_path() . path_to_theme() ?>/page-front.css" rel="stylesheet"/>

don't forget to alter the input format to PHP.
============================
Q - How do I get the Event listing block to only use one line per event?
A - In Drupal 5 use display:inline...

Force the event-timeleft to display inline and then putting some margin space between them by adding the following to style.css:
#block-event-1 .event-timeleft {
  display:inline;
margin-left:5px;
}

In Drupal 6 this is built into Views 2
============================
Q - How do I create a semi transparent div containg a node title?
A - Use normal CSS with a special type of image...

First create your view that returns the node title, then create the div containing the view eg:
<div id="bottomrighttext">
<?php
$view_name
= 'picrighttext'; //name of view
$limit = 1; // number of returns
$view_args = array();
$view = views_get_view($view_name);
print
views_build_view('page', $view, $view_args, FALSE, $limit);
?>

Now create a small .png file that has opacity using photoshop's alphachanel settings. Next create the css that will control the div:
#bottomrighttext .view-data-node-title {
position:relative;
top:-136px;
right:-260px;
border:0px solid #FFD300;
background:transparent url(transparent.png)
repeat scroll 0px 0px;
padding: 7px;
height:100px;
width:100px;
}

This will not work with ie6 without further tweaking. We are working on a way of doing this just using the opacity property, more to follow.
============================
Q - What is the syntax for embeding a block within a Div?
A - Go to /admin/build/block and click on the [configure] link of the block you would like to embed. For example 'Who's online' block has the url /build/block/configure/user/3 ...

Add overflow:hidden; to your div as in the example below:
<div id="topcenter">
  <h4> <a title="Who's online" rel="tag" href="/user">Who's online...</a></h4>
<?php
$block
= module_invoke('user', 'block', 'view', 3);
print
$block['content'];
?>

</div>

If you were using a feed then the url might be block/configure/aggregator/feed-3
and the block code would be:
$block = module_invoke('aggregator', 'block', 'view', feed-3);

============================
Q - I am using Divs and sometimes the content overflows, help?
A - Use Overflow property...

Add overflow:hidden; to your div as in the example below:
#middleleft {
background:transparent none repeat scroll 0% 50%;
color:#FFFFFF;
float:left;
height:149px;
overflow:hidden;
padding:5px 5px 5px 10px;
position:relative;
width:240px;
}

============================
Q - In Views, how can I avoid duplications?
A - Use Node: Distinct...

In /admin/build/views [relevant view] there is a filter section. Simply > add filter > Node: Distinct and [Save]
============================
Q - How do I force the Topic box further down the node add form?
A - DON'T alter the taxonomy.module! as you can now use http://drupal.org/project/nodeformcols ...

Find the following line and altser the weight from -3 to 1, that way it will appear below the body text box:
      $form['taxonomy']['#weight'] = 1;

============================
Q - layout looks great in Firefox but slightly out in IE7?
A - Use IE style sheet...

In your theme create a file called fix-ie7.css (you will see one in there already called fix-ie.css, which fixes ie6). In page.tpl.php add the lines
    <!--[if IE 7]>
    <style type="text/css" media="all">@import "<?php print base_path() . path_to_theme() ?>/fix-ie7.css";</style>
    <![endif]-->

now add a duplicate of the lines you wish to tweak into the new css file. eg
#bottomright li, #bottomcenter li {
margin-top:7px;
}
#total {
margin:75px 59px;
}