Topic: req: extensions need to add a css class to their content block

It's virtually impossible to style with the existing class names all being the same.

For example, the comment extension is nearly the same as the top sites extension with respect to html + css classes...
A comment I want to display differently than top sites (ie: no thumbnail for a comment).

something simple like the extension id used as a css class on the top level html element would work:

change:

<div class="openld-content">

to:

<div class="openld-content link_comments">

The class name can be pulled from the extension.xml as:

<extension>
    <id>link_comments</id>

I think this should be the standard behavior and the underlying extension framework should automatically add this class based on the extension's id.

Last edited by chovy (2009-12-27 20:39:34)

http://www.optimseo.com - Directory Owners Forum

Re: req: extensions need to add a css class to their content block

Problem is when you have multiple extensions installed, the design will overlap.

<div class="openld-content link_comments guestbook extension_3 extension_4 extension_5...">

Re: req: extensions need to add a css class to their content block

I thought each extension created it's own div container....

and if you have multiple classes (if there's no other way) that is fine.

http://www.optimseo.com - Directory Owners Forum

Re: req: extensions need to add a css class to their content block

Aha, now I get your point.

Well it is a solution for themes to manage the default extensions. Let me think about it.

Re: req: extensions need to add a css class to their content block

I think there is a better solution to this problem; adding an extension folder to the themes and then having a folder for each extension the theme needs to manipulate. And the extension will print html code from the folder if it exist. Otherwise it will work normally.

Re: req: extensions need to add a css class to their content block

that would be doable -- I'm just wondering though, in the short-term I think what we really need is a way to simply wrap extensions in a container so designers can target them easily.

<div class="extension" id="<the_extension_name>">
<!-- all code from the extension goes here -->
</div>

This should be the standard for all extensions. Your point about being able to override is a good one, but I'm thinking simple improvements to the main extension with respect to its code would make the need to override them less.

http://www.optimseo.com - Directory Owners Forum

Re: req: extensions need to add a css class to their content block

Here's what I am working on:

function ext_theme_include($ext_name, $short_path)
{
    global $settings;
    $theme_file = 'themes/' .$settings['template_path']. 'extensions/' .$ext_name. '/' .$short_path;
    $ext_file = 'extensions/' .$ext_name. '/default_theme/' .$short_path;

    if(file_exists($theme_file))
        require $theme_file;
    elseif(file_exists($ext_file))
        require $ext_file;
    else
        error($ext_file. "is missing");
}


function ext_theme_page($ext_name, $short_path)
{
    global $settings, $page;
    $theme_file = 'themes/' .$settings['template_path']. 'extensions/pages/' .$ext_name. '/' .$short_path;
    $ext_file = 'extensions/' .$ext_name. '/default_theme/pages/' .$short_path;

    if(file_exists($theme_file))
        $page = '../../' .$theme_file;
    elseif(file_exists($ext_file))
        $page = '../../' .$ext_file;
    else
        error($ext_file. "is missing");
}

This lets you create an extension path in your theme if you want to have a different style on some extensions. Lets say you create 'extensions/link_comments/pages/index.php' you can design your own page for displaying comments.

Re: req: extensions need to add a css class to their content block

ok.

http://www.optimseo.com - Directory Owners Forum