This forum is for assistance with theme development.

How do I let users change layout from within a theme

I am building a theme in phptemplate.

I have found that by using 'display: none;' in style.css I can hide for example the right sidebar.

Now I want to be able to let users hide / show the right sidebar by pushing the sidebars left border.

How can I do that?

Do I need two stylesheets? If yes, how do I change between the two - from page.tpl.php?

If no, how do I change between two sidebar settings within one style.css?

Hope someone can help me.

Best Regards,
Lennart

PHPtemplate - Change display of secondary links

Hola !

i want to change the display the text of the secondary links from normal to

Link «

but there seem to be encoding problems, as the system makes « to «

according to the Rewriting Primary Links posting, i created a template.tpl.php with the following code

function _phptemplate_variables($hook, $vars) {
  if ($hook == 'page') {
    foreach (array('primary', 'secondary') as $type) {
      //Get the data to populate the textfields, if the variable is not an array .. try to parse the old-style link format.
      $value = variable_get('phptemplate_' . $type . '_links', ”);
      //Get the amount of links to show, possibly expanding if there are more links defined than the count specifies.
      $count = variable_get('phptemplate_' . $type . '_link_count', 5);
      $count = ($count > sizeof($value['link'])) ? $count : sizeof($value['link']);
      if (theme_get_setting('toggle_' . $type . '_links')) {
        for ($i =0; $i < $count; $i++) {
          unset($attributes);
          if (!empty($value['text'][$i])) {
            if (!empty($value['description'][$i])) {
              $attributes['title'] = $value['description'][$i];
            }
            if ($type == 'secondary') {
              $value['text'][$i] .= ' &laquo;';
            }
            $links[$type][] = l($value['text'][$i], $value['link'][$i], $attributes);
            $vars[$type . '_links'] = $links[$type];
          }
        }
      }
    }
    return $vars;
  }
}

is there a way to prevent drupal from converting the ampersand & to &amp ?

Moving comment form within phptemplate's node.tpl.php

I am trying to pull the comment submission form inside of the content of my page. However, PHPTemplate doesn't seem to have this level of granularity. As far as I can tell the content of my page and my comment form is embeded within the $content variable. Digging around in the comment.module shows me that there are theme_ functions for various parts of the comment mechanism but nothing like page.tpl.php where I could move the HTML that output the comment form up into a different part of my page.

OS X Tiger and phptemplate problem

Thhe following break occurs with phptemplate and any compatible theme on Tiger:

Fatal error: phptemplate_init(): Failed opening required '' (include_path='.:/usr/lib/php') in ./themes/engines/phptemplate/phptemplate.engine on line 55

The only clue I have yet is this may be due to Tiger PHP being built with a MySQL client API < 4.1.x.

Not sure about what to do.

Pass variables from module to phptemplate

How do I pass variables from a module to phptemplate?

I read topic Making additional variables available to your templates, created 'template.php'. I tried to add new variable and assign it some value from module hook (i need sections_in_section()). But it doesn't work, it says 'no such function defined'.

Am I stupid or it's not possible? Please, help me. Thanks in advance.

Google theme...

I think it might be very cool to create a "Google theme".

Link

The primary/secondary links could replace the links above the search bar there. Instead of the ads on the right side, you could have the links and blocks, and the search results could be replaced with the news items/nodes.

This would be great for news sites, imo.

I can start on this, but I'm wondering what theme would be the best starting point?

Thanks :)

Pages

Subscribe with RSS Subscribe to RSS - Theme development