This forum is for assistance with theme development.

align form elements horizontally on settings page (4.6)

Hi,

I have some problems with creating a settings page for a module i'm developing.
I want administrators to go into settings, and choose a few starting and ending hours.
For now i have this already: http://users.telenet.be/svend/settings_problem.jpg (screenshot) in admin/settings/timetable.
But i would want the 4 dropdownlists to be on 1 line horizontally, as this current approach is taking up too much space, as a lot of hours will need to be selected.

Smarty theme engine - overriding menu generation

This is in response to http://drupal.org/node/61713
I'm placing my response here to open up discussion.

Documentation for the Smarty theme-engine is lacking -- in some ways this is appropriate as it mirrors the functionality of phptemplate in many ways but this leads to confusion. Between work and classes I haven't had time to write much doc -- I'm more than willing to accept submissions from anyone and will be sitting down to write more comprehensive documentation soon.

--------------------------------

To do custom theming of that (or any themable) function you'll need an entry in the smartytemplate.php file residing within the theme's directory.
If you'd like to do rendering with smarty as opposed to having your rendering logic in straight php within smartytemplate.php you can call _smarty_callback*() with the appropriate parameters and create a corresponding .tpl file.

/**
* Catch the theme_item_list function, and redirect through the template api
*/
function smarty_item_list($items = array(), $title = NULL) {
  // Pass to phptemplate, including translating the parameters to an associative array. The element names are the names that the variables
  // will be assigned within your template.
  return _smarty_callback('item_list', array('items' => $items, 'title' => $title));
}

This example would allow you to then make a item_list.tpl file within the theme directory and do the rendering there.

Two simple questions

I upgraded to v4.7 yesterday, and the process has gone much smoother than expected.

This is a pleasant surprise since I know almost nothing about php, CSS or programming in general. I've been going entirely from the manual and the comments I find in the forums.

Kudos to the community!

Anyhow, I have two things I'd like to fix that I'm sure will be easy for you - but I just don't know where to start:

4 blocks on the Node page for the home page

I am using Drupal 4.7.

There is a design that I want to achieve but not too sure what's the best way to do so.
What I want is to have my home page (and only the home page) to have 4 areas in the middle (ie. where the node is usually displayed). Each of those areas would have text and links to other parts of the site. Basically those 4 areas are promoting 4 type of content on my site.

Thinking about it I came to the conclusion that the easiest way would be to create a node of type Page, set the home page to that particular node. That node will have an HTML body that will contain the tables done in a way to have my 4 squares. That is ok but this is not easy for a non html person to update.

My second idea would be to create a new content type, have 4 "Body" section in that new type. And then create a new node-NEWTYPE.tpl.php that would put the 4 bodies in the 4 different areas.

something like:

    <span class="submitted"><?php print $submitted?></span>
    <span class="taxonomy"><?php print $terms?></span><?php endif; ?>
    <div class="content1"><?php print $content1?></div>
    <div class="content2"><?php print $content2?></div>
    <div class="content3"><?php print $content3?></div>
    <div class="content4"><?php print $content4?></div>

If I go for that then can someone tell me how to create that new type (the exemple I found were by just duplicating the story.module). Or maybe I could use flexinode?

Theming Seach Box with Forms API?

I am outputting a search form in my theme with print $search_box (using phptemplate) and found that theming it by having the template.php file make a callback no longer works.

I understand the the Forms API is the new way to theme forms. I have even read the Forms API guides.

But, I am just not quite getting it. Where do I stick the code to update the array? in the template.php file?

Can somone, please, give me some example code to update the look of the text field or search button and point out where to put the code.

Help with breadcrumb

I'm creating a new module, for each item menu i need a diferent breadcrumb.

I have:

function mymenu_menu(){
$items[] = array('path' => 'node/'.arg(1).'/details', 'title' => t('Details'),
'type'=>MENU_LOCAL_TASK,'access' => user_access('create example node'),'callback'=>mymodule_details);
$items[] = array('path' => 'node/'.arg(1).'/image', 'title' => t('Image'),
'type'=>MENU_LOCAL_TASK,'access' => user_access('create example node'),'callback'=>mymodule_image);

}

Pages

Subscribe with RSS Subscribe to RSS - Theme development