This forum is for assistance with theme development.

Integrating Drupal header into SMF forum

Hi,

My website consists of Drupal providing the content and a SMF (Simple Machines) forum. I am wanting to include the Drupal header at the top of all forum pages so I have a consistent header throughout my site.

I am able to edit the Simple Machines template files so that I can insert the header code from Drupal. What I would like to know though is the best way to access the Drupal variables required in the forum template, these would be $logo, $site_name, $site_slogan and $primary_links.

Any help would be much appreciated, thanks, fondie

Advice on theme with two-column layout

Hi,

I am in the process of turning my website into a Drupal site and implementing a new design. I want it to be a two column layout however I do not plan to use any blocks (if possible) and I wonder how to implement this. This is the layout (ignore the typo! :) ):
http://putfile.com/pic.php?pic=11/31316105140.png&s=x11

For the first page (main page of site):
A. Recent stories posted.
B. General information about the site, "welcome blah blah", I want this editable as a Page preferably.
C. Static navigation, this will be a Flash movie and will be static and coded in the template.

For news and blog subpage:
A. This is where the story is shown.
B. Past stories, show calendar or list of stories.
C. -same-

Other pages (generic content):
A and B. Using Page type nodes for full-width text or two columns (50%/50%).

Any idea how I could achieve this?

Secondly, I am unsure how I would go about administering this site lacking a blocks menu. Could I use an otherwise unused DIV for the lefthand menu and use the full-width area (A and B) for content or would I have to designate two separate DIVs below the other elements? Could I use another theme only available to me so that I can administer the site easily?

I want members to be able to contribute and create content, in this case comments on Pages, Stories (and/or Blog entries) and I realize this could be hard without any space for Blocks. I would only need a small area for these links so I am thinking of implementing these Blocks as boxes/paragraphs in column A.

spreadfirefox theme and page numbers

Is there a way to get the spreadfirefox theme to display the page numbers (eg "first page previous page 1 2 3 next page last page") below the last article on the page instead of below the lowest side block? The footer should remain below the lowest block. The interlaced theme does it this way. Spreadfirefox puts it below the lowest block (just above the footer) which can be quite a distance from the bottom of the last article causing some to overlook the fact that there are more pages available.

Workaround: block translation using flexinode and i18n

Hi,

Using flexinode.module and i18n.module I have managed to create multilingual blocks.

Here's what I've done and I'm looking forward to some comments, as I want to know how useful this workaround might be and what kind of polishing it needs :) I'm not a programmer, so please keep your comments simple and understandable...

It started with my wish to have some kind of news / sidenotes / links in the sidebar of my website. Therefore I needed: title, link, date, content.

First I created a flexinode called "sidenote", which got id 2, so let's say flexinode-type 2. As flexinodes are connected with their nodedata, I already had a title and a date. Therefore I defined two additional flexinode fields: link (which was given id 16) and content (which was given id 18). Now I was able to enter the necessary content just as easy as stories, blogposts, et cetera.

Second I had to create some php for the block. Using php I wanted to take care for both logic and themeing. First time ever... But I got it done, wooohaaa! For explaining the basic idea, I will suffice with quoting my code, as the comment lines will explain the logic. I implemented this code as part of a new block, which has been made visible in the right sidebar. Now all content of type sidenote (type 2) is showed as short stories with a title, link, date and content in the right sidebar and, moreover, in the right language as well! I also added a link at the bottom of the sidebar, which links to an overview page using taxonomy terms (this part needs some polishing definitely...).

The result can be found here:

NOTE
At the bottom of the code there are a lot of comment lines; these are for future use, when I want to show certain sidenotes in certain sections, using sections.module.

As said before: I'm looking forward to some feedback, thanks in advance!

Marc


<?php

// determination of the site's language using i18n.
$site_language = _i18n_get_lang();

// definition of flexinode-type for creating content:
// - 2 = custom defined type for nodes in sidebar (sidenotes).
$flexinode_type = 2;

// defintion of flexinode-type fields providing content:
// - 16 = custom defined field for storing weblink;
// - 18 = custom defined field for storing content.
$flexinode_field_link = 16;
$flexinode_field_body = 18;

// initialization of sidebar's block.
$block_initialized = FALSE;

// query:
// selecting (flexi)node data
// where the flexinode-type is the one for sidenotes
// and the node's language is the site's language
// and the node's status is published
// sorted by date created.
$result_fn = db_query
(" SELECT *
FROM {node} n
, {flexinode_data} fn_d
, {flexinode_field} fn_f
, {flexinode_type} fn_t
WHERE fn_t.ctype_id = '$flexinode_type'
AND fn_t.ctype_id = fn_f.ctype_id
AND fn_f.field_id = fn_d.field_id
AND fn_d.nid = n.nid
AND n.language = '$site_language'
AND n.status = 1
ORDER BY n.created DESC
");

// loop for every row of the query above.
// NOTE: one node will have multiple rows,
// namely one for every flexinode field.
// rows for one node are next to each other,
// because of ordering by date and time created.
// the transition from one node to another
// will be determined by comparing:
// - $previous_node;
// - $current_node.
while ($row = db_fetch_object($result_fn))
{
if ($block_initialized == FALSE)
{
// at the start of the first loop,
// the block needs to be initialized:
// row defines $current_node and $previous_node.
$previous_node = $row->created;
$current_node = $row->created;
$block_initialized = TRUE;
}
else
{
// at the start of other loops,
// row defines $current_node only.
$current_node = $row->created;
}

if ($current_node < $previous_node)
{
// if $current_node and $previous_node are not equal,
// the query has just entered the data of another node,
// so the gathered content needs to be printed
// and $previous_node needs to be updated.
print ' ' . $titel . '' . '

A "sexy" administration interface. Is it possible?

Hei.

I'm fairly new to drupal, but have setup a couple of sites now. I really like it, but I miss something very important (in my customers eyes): A more "sexy" administrator interface with a custom look and feel. I have tried the control panel module, but this is really just a simple table with some images that link to the different administrator tasks. It's a start, but I need to:

- Customize the appearance of the "add content" forms. Changing style on the form elements etc, kan be done with CSS, but what if I want to change the order of the elements or simply create a totally different layout on the entire page containing the form? I cannot see how I can do this with themes and my current knowledge of drupal :)

- Maybe even display the entire administrator interface in a completely separate layout, making sure I can use the entire window width for editing etc. without worrying about users using a "small-width" theme which makes the FCK-editor narrow, making adding articles and other content cumbersome...

My experience with drupal so far is that once you get the hang of it, it's fast, scalable and easy to use, but every time I show it off to people I get the same response: "What's up with that evil text-based administrator menu? It looks like something made by computer engineers made for computer engineers! I want it to be more sexy to be able to enjoy using it in my day to day work!". I guess it's quite true. Remember that people are used to administrator interfaces like the ones found in mambo and seagull.

How to use primary & secondary links on any theme

Hi,

I am tying to use the links and everytime i get this error. It is happened on any selected themes which have these links. I don't know how to use them. I would appreciate if someone can help me on this and it would be helpful to have code samples if i need to any theme files.

Fatal error: Only variables can be passed by reference in /var/apache2/www/modules/system.module on line 649

Thanks

Pages

Subscribe with RSS Subscribe to RSS - Theme development