Getting rid of br-tags?

Discussion corner for Developers of Serendipity.
Post Reply
heddesheimer
Regular
Posts: 37
Joined: Mon Sep 12, 2005 3:44 pm

Getting rid of br-tags?

Post by heddesheimer »

Hi,

I have a problem creating a style for s9y. I want to make the links in the side bar acting like buttons having all the same width. So I have to declare a style="display:block" for the anchor-tags, so that the links can extend to the right margin.

I found, that this does not work with some elements. One of the problems is, that in include/plugin_internal.inc.php the funktion generate_content() do include br-tags after the links.

Would it be reasonable to replace these and put the tag into a div-container instead? I think it would be more convenient for style-programmers who like to change the styles for the individual links.

It should not be a big problem, I changed it in the file so far, but I would appreciate if it could go into development for the next version.

I am using 0.8.5

Marian
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Getting rid of br-tags?

Post by garvinhicking »

You can also set the "br" tag to "display: none" without needing to touch the PHP files. :)

Best regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
heddesheimer
Regular
Posts: 37
Joined: Mon Sep 12, 2005 3:44 pm

Post by heddesheimer »

Great idea. Thanks

I have learned to get my HTML as logical structured als possible. Because br-tags are normally for display purpose and don't add much too the structure, wouldn't you aggree that it's a better goal to get rid of all those br-tags in the long run?

Marian
heddesheimer
Regular
Posts: 37
Joined: Mon Sep 12, 2005 3:44 pm

Post by heddesheimer »

I jost got a note from my designer, that we will need the links as a HTML-List to make the pages better accessible for blind people. WordPress and other Blog-Scripts already have this as default.
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

You can change the markup of many plugins from within their PHP code. Some plugins like the linklist or staticpage linklist or "entry's links" already use <li>s for linklists.

Where exactly are you missing <li> in linklists?

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
heddesheimer
Regular
Posts: 37
Joined: Mon Sep 12, 2005 3:44 pm

Post by heddesheimer »

garvinhicking wrote:Where exactly are you missing <li> in linklists?
not in linklists but in the main navigation links
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

What do you mean with main navigation links exactly?

Best regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
heddesheimer
Regular
Posts: 37
Joined: Mon Sep 12, 2005 3:44 pm

Post by heddesheimer »

garvinhicking wrote:What do you mean with main navigation links exactly?

Best regards,
Garvin

Code: Select all

        <h3 class="serendipitySideBarTitle serendipity_categories_plugin">Kategorien</h3>        <div class="serendipitySideBarContent"><div><a href="/blog/categories/4-Allgemein" title="Dies und Das" style="padding-left: 6px">Allgemein</a></div>
<div><a href="/blog/categories/3-Programmieren" title="Skriptsprachen" style="padding-left: 6px">Programmieren</a></div>
<div><a href="/blog/categories/2-MySQL" title="Alles über MySQL" style="padding-left: 12px">MySQL</a></div>
<div><a href="/blog/categories/1-PHP" title="Alles über PHP" style="padding-left: 12px">PHP</a></div>
<br /><a href="/blog/index.php" title="Alle Kategorien">Alle Kategorien</a></div>
    </div>
    <div class="serendipitySideBarItem container_serendipity_plugin_staticpage">

Or:
Seen on this blog:
http://www.smartphoner.ch/serendipity/

Code: Select all

            <h2>Aktuelle Einträge</h2>            <p><a href="/serendipity/index.php?/archives/48-SonyEricsson-stellt-das-P990-vor.html" title="SonyEricsson stellt das P990 vor">SonyEricsson stellt das P990 vor</a><br /><div class="serendipitySideBarDate">Montag, Oktober 10 2005</div><br /><a href="/serendipity/index.php?/archives/46-Neue-Fotos-vom-SonyEricsson-P1000.html" title="Neue Fotos vom SonyEricsson P1000">Neue Fotos vom SonyEricsson P1000</a><br /><div class="serendipitySideBarDate">Montag, Oktober 10 2005</div><br /><a href="/serendipity/index.php?/archives/44-Geruecht-Apple-iPhone.html" title="Gerücht: Apple iPhone">Gerücht: Apple iPhone</a><br /><div class="serendipitySideBarDate">Sonntag, Oktober  9 2005</div><br /><a href="/serendipity/index.php?/archives/43-Geruecht-SonyEricsson-P1000.html" title="Gerücht: SonyEricsson P1000">Gerücht: SonyEricsson P1000</a><br /><div class="serendipitySideBarDate">Sonntag, Oktober  9 2005</div><br /><a href="/serendipity/index.php?/archives/42-Geruecht-Nokia-7380.html" title="Gerücht: Nokia 7380">Gerücht: Nokia 7380</a><br /><div class="serendipitySideBarDate">Sonntag, Oktober  9 2005</div><br /><a href="/serendipity/index.php?/archives/40-SonyEricsson-W800i-wird-zum-iPod.html" title="SonyEricsson W800i wird zum iPod">SonyEricsson W800i wird zum iPod</a><br /><div class="serendipitySideBarDate">Freitag, Oktober  7 2005</div><br /></p>
HTH
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Ah, okay.

Well, since I get this request from time to time I just took some of my time to make the Categories plugin use the Smarty features.

I committed it to version 0.9-beta2, since it does not work with 0.8 because of the new permission functions and some other new changes to the categories plugin.

If you are not using 0.9 already you can either upgrade, or you need to edit your include/plugin_internal.inc.php file and locate the "serendipity_categories_plugin" code to adapt the HTML code. It is not so hard, so you should easily be able to do it.

And for the future you can use the new plugin in 0.9 :)

Best regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
heddesheimer
Regular
Posts: 37
Joined: Mon Sep 12, 2005 3:44 pm

Post by heddesheimer »

sounds good.

Thanks

Marian
Post Reply