Recent Topics

editing the archives

Started by on Feb 20, 2005 – Contents updated: Feb 20, 2005

Feb 20, 2005 19:25    

hi!
i am trying to edit the look of the archives page in my evo skin but can't seem to find the original source for it. _archives.php only tells me how it should look on _main.php. does this file exist...or is threre another way to do it :?:

Feb 22, 2005 05:53

What skin are you using?

Most skins have a _archives.php file in THAT skin's folder. However, all it really does is call the _archives.php file in the /skins folder (one directory above the /skins/[custom skin] folder.

What I generally recommend doing is copying the guts of the /skins/_archives.php into the /skins/[custom skin]/_archives.php file (essentially combining both into just one).

THEN you can modify the _archives.php file for the [custom skin] that you are using & none of the other skins will be affected.

Look for:

Code

/**
   * We now call the default archives handler...
   * However you can replace this file with the full handler (in /blogs) and customize it!
   */
  require get_path('skins').'/_archives.php';

The require statement says to get the _archives.php file in the directory above.

The two files have similarities that will guide you on knowing WHICH parts to copy. Do remember to comment out the require statement after you are done (or just copy over it).

I think this is what you are looking for. :)

Oops. :oops: Maybe not. You were talking about the "look". I was talking more about WHAT is put on the page, not HOW it looks.

The trouble is that the Archive Directory gets shown just like any other page (look at the HTML code and you'll see it's in a 'bPosts' div).

What I did to gain control over mine was edit the _arcdir.php file. Can't remember if I ADDED a DIV, or just ADDED a Class name to an existing div, but either way ... It looks like:

Code

if($disp == 'arcdir') { // We have asked to display full archives:
echo '<div class="arcDir"><ul>';
/*
* This file is basically just a trick where we set the number of entries to display
* to "no limit"...
*/
$archive_limit = '';
/**
* And then... call the default archive include.
*/
require dirname(__FILE__).'/_archives.php';
unset( $archive_limit );
echo '</ul></div>';
}
?>
When you add a classed div here, you gain some CSS formatting control over the page. Get further control by classing the UL tag too, depending on what you want to do.

Likewise, you can add class statements to the <a> tag in the _archives.php file mentioned above, for even more control.

Whew ... now you're covered! ;)

Sorry for the long read. :roll:

Feb 22, 2005 23:04

wow, thank you. :)
i'm a little new to php so i'll tackle this when i get home. to answer your question, i'm using the "clean" b2evo skin. it has a nice, clean look to it. :roll:
to give more info, the site is http://www.thornhillatthemovies.com . just click on the archives link and you'll see how the layout gets a little messed up (basically the text area gets lowered due to an additional div). that's what my problem is.

another question i have regarding this topic is if it possible to make the archive link on the main page consist of the blog post title, rather than the month and year? i know it can be done, i assume through _archive.php, but what part of the code can i tweak? do i replace 'month' and 'year' with 'title' or something?

again, thanks for the assistance!

Feb 23, 2005 00:23

Actually, it should be more simple than that (assuming you have only one blog OR don't mind having ALL your blogs show sidebar archives the same way).

In the back office, go to the settings tab. Change the Display Option s "Archive Mode" to Post-by-Post. Save & you're done.

You're archives will now be done by entry, rather than however it was set before (monthly?).

Of course, it'll be the same way on your archives PAGE too.

Hope this helps.

:) -Scott

Feb 23, 2005 02:18

RE your formatting problem with archives.

The answer doesn't look like it lies in archive.php, but rather _main.php. I had a look at your site. You don't have an archives page link. You only have one months-worth of archives "February 2005 (3)"

If you look in your _main file, you'll see a section that looks like:

Code

<?php
        arcdir_title();
        last_comments_title();
        profile_title();
        single_cat_title('Category Selection: ');
        single_month_title('Entries for: ');
        single_post_title('Full View for: ');
        stats_title();
        ?>

What you're seeing, when you click 'feb 05' is the "single_month_title". Looking at your HTML page code, they can be styled using a '.bPosts h2' selector. Unfortunately, it'll grab BOTH the "archives for Feb" AND the 02/21/05 date.

You can play with the margins and padding first (add this '.bPosts h2' selector to your 'clean.css' file, type in {background=yellow} & then look, you'll see what I mean.)

Try {margin:0px 20px} ... that's scrunch things down vertically a bit. (Of course, you could do a lot more ... change fonts, colors, etc., but since it was SPACE you were worried about ;) )

IF you want MORE control ... add a <h2 class="whatever"> before the code above. THat way, you can control it even more.

Like .bPosts h2.whatever {display:none} will completely erase the "archives for feb" line ... (of course, it will erase all the other lines too, the arcdir title, the single category selection -which wouldn't affect you much, cause I don't see any categories ... etc.)

IF you REALLLLY want control, you can always put THIS in your _main.php file:

Code

<?php
        arcdir_title();
        last_comments_title();
        profile_title();
        echo '<span class="test">';
        single_cat_title('Category Selection: '); echo '</span>';
        single_month_title('Entries for: ');
        single_post_title('Full View for: ');
        stats_title();
        ?>
Which allows you to control JUST the single_cat_title('Category Selection') ... I tested it, it works. (The span code will be in there for every OTHER one too, but it ONLY wraps the single_cat_title ... so any CSS will only affect THAT one).

That's the neat thing about b2evo ... there's ALWAYS a way. (Just gotta figure out WHAT it is!) :D

Feb 23, 2005 06:33

sweet! :D
thanks, must have overlooked that little bit. now the issue is that everytime i click on an archived link, a comments box/pingbacks/trackbacks appears under the review. i'll take a look at the _main.php and see if i can figure this out, as well as incorporating your suggestion into the layout. i'll report back.
thanks a bunch again.
-jan

Feb 28, 2005 19:03

thanks stk!!!

i checked it out and decided that none of the option in my <h2> tag were really necessary at the time....so they got commented out, and then i realigned the sidebar on all pages by adding an additional <h2> tag into the sidebars dedicated <div>. mmm....customization :D

thank you for your help
- jan


Form is loading...

Build your own site! – This forum is powered by b2evolution CMS, a complete engine for your website.