1 of 3
1
how to display 2 columns of entries?
Posted: 22 October 2004 02:50 PM   [ Ignore ]  
Lab Assistant
Avatar
RankRank
Total Posts:  195
Joined  01-21-2004

Hello!

I have a category listing of all my entries.  see here

I’m changing it so it’s a bit more descriptive, but what I really would like to do is display it in 2 columns.

So instead of the current layout:

blah
blah
blah
blah
blah
blah

I would have something like:

blah…........blah
blah…........blah
blah…........blah

(imagine no ...... that would just be space)

I can’t even begin to think how I would do this.  Any suggestions?


TIA,

Bill

 Signature 

http://www.mackenty.org
—————————————————————
Text-based gaming is alive and well!
http://community.pennmush.org

Profile
 
 
Posted: 22 October 2004 03:07 PM   [ Ignore ]   [ # 1 ]  
Moderator
Avatar
RankRankRankRankRankRankRankRank
Total Posts:  33269
Joined  05-14-2004

Is it:

blah1 .... blah2
blah3 .... blah4

or

blah1 .... blah3
blah2 ... blah4

that you want?

the second one is a lot easier than the first. =)

 Signature 
Profile
MSG
 
 
Posted: 22 October 2004 04:15 PM   [ Ignore ]   [ # 2 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  831
Joined  04-17-2002

Wouldn’t the first one be easier? 

 Signature 

antipodean.org | uptheduff.org

Profile
 
 
Posted: 22 October 2004 04:38 PM   [ Ignore ]   [ # 3 ]  
Moderator
Avatar
RankRankRankRankRankRankRankRank
Total Posts:  33269
Joined  05-14-2004

I was just thinking of one column going down 1 2 3 4 and then a second column going down 5 6 7 8 using offset.  How would you do that in the first option?

 Signature 
Profile
MSG
 
 
Posted: 22 October 2004 04:47 PM   [ Ignore ]   [ # 4 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  195
Joined  01-21-2004

Hiya LisaJill!

Thanks for the quick reply.  Either would work…it’s asthetic, so I guess the second one would be great.

Thanks!  *fingers crossed*

 Signature 

http://www.mackenty.org
—————————————————————
Text-based gaming is alive and well!
http://community.pennmush.org

Profile
 
 
Posted: 23 October 2004 01:48 AM   [ Ignore ]   [ # 5 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  831
Joined  04-17-2002

You could just have each entry as block elements but styled as inline with a fixed width and they will just fill up the space until they have to go to the next >line< of your space. Just like inline images. I guess this might not display as intended if the elements are different heights.

I didn’t even think of offset. That would work. There might still be a layout problem if the entries are different heights though. i thought you had some magical formula to make content flow vertically from one column to the next and I wanted to know smile

There is a good newspaper style layout here, done in EE. Haven’t dissected it but I think its a very successful layout. Not sure if newspaper style is what you’re after.

 Signature 

antipodean.org | uptheduff.org

Profile
 
 
Posted: 23 October 2004 02:36 AM   [ Ignore ]   [ # 6 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  831
Joined  04-17-2002

Arghh! I just realised I didn’t read your post properly and you are talking about category headings and not entries.

i thought Lisa-Jill had some magical formula to make content flow vertically from one column to the next and I wanted to know smile

However, you could just have each list item styled as inline with a fixed width container and they will just fill up the space until they have to wrap. Just like inline images. Just add display: inline to your styles. You should also set the <li> elements to fixed width so the ‘columns’ line up.  I guess this might not display exactly as intended if the elements are different heights (if you had a long category name that wrapped for example).

I didn’t even think of offset. That would work. There might still be a layout problem if the elements are different heights though.

 Signature 

antipodean.org | uptheduff.org

Profile
 
 
Posted: 23 October 2004 08:46 AM   [ Ignore ]   [ # 7 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  195
Joined  01-21-2004

ah.

I googled css inline, and css offset, but I wasn’t able to grok the way to do this….any other sites you could point me to, or perhaps a code snipet?

Tia,

Bill

 Signature 

http://www.mackenty.org
—————————————————————
Text-based gaming is alive and well!
http://community.pennmush.org

Profile
 
 
Posted: 23 October 2004 09:33 AM   [ Ignore ]   [ # 8 ]  
Moderator
Avatar
RankRankRankRankRankRankRankRank
Total Posts:  33269
Joined  05-14-2004

I was actually thinking of the offset with the exp:weblog:entries tag - I thought you wanted this with posts, not with the category listing, as I read the title not the content (sorry ;p).  You want this with the listing of entries in each category? which tag/code are you talking about specifically?

 Signature 
Profile
MSG
 
 
Posted: 23 October 2004 09:43 AM   [ Ignore ]   [ # 9 ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  6086
Joined  08-04-2002

Random Thoughts...
Not being a programmer I can’t actually do it but these came to mind…
—————
The International Herald Tribune (pick an article) has a famous 3-column layout where the text flows from one col. to the next. It also senses your screen size and paginates the article. It’s all done with Javascript and if you search the net, the original developer has a tutorial on how he did it.
—————
Through php/query (or whatever means) get a count total, split it. Have two different css Divs where one is left, the other is either offset right or floated. The first div gets assigned and each entry is counted, when the count hits the magic halfway point it closes the first style and applies the second. Of course the code would have to account for an uneven total. You would probably be better off with the float as it would adjust when someone increased the text size.
—————
Good luck grin

Profile
 
 
Posted: 23 October 2004 09:58 AM   [ Ignore ]   [ # 10 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  195
Joined  01-21-2004

Here’s the actual code I’m using to grab the entry titles:

{exp:weblog:entries weblog="weblog1" category="29" orderby="title" sort="asc"}

<a href="{title_permalink=main/all}">{title}</a><br />

{/exp:weblog:entries}

 Signature 

http://www.mackenty.org
—————————————————————
Text-based gaming is alive and well!
http://community.pennmush.org

Profile
 
 
Posted: 23 October 2004 10:02 AM   [ Ignore ]   [ # 11 ]  
Moderator
Avatar
RankRankRankRankRankRankRankRank
Total Posts:  33269
Joined  05-14-2004

Ah, ok.  You can set up the table code so that each entry appears inside it’s own cell going downward pretty easily (though I haven’t done this, it should just be a matter of where you put the table code).  So, add a limit=“4” for one - then in the next column over use the same code but add an offset=“4” (or however many your limit is) so that it starts at the next entry.

Does that make sense?

 Signature 
Profile
MSG
 
 
Posted: 23 October 2004 01:23 PM   [ Ignore ]   [ # 12 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  326
Joined  02-06-2004

Ok I thought about this, and here’s just one of many solutions possible for this.

Here’s my actual EE code:

{exp:weblog:entries weblog="weblog1" orderby="date" sort="desc" limit="20"}
<div class="{switch="style1|style2"}">
<
a href="{comment_path="pdx/comments"}" title="permalink">{title}</a>
</
div>
{/exp:weblog:entries}

Now, you’ll need to set up the CSS as follows for the style1 and style2:

div.style1 {
    float
:left;
    
width:50%;
}

div
.style2 {
    float
:right;
    
width:50%;
}

What this will result in is:

title1…title2
title3…title4
title5…title6

Well you get the idea. It looks pretty good, I think. but again, this is only 1 way of doing things, and using just divs.

 Signature 

hello! yoshi
hello! food |

Profile
 
 
Posted: 23 October 2004 01:25 PM   [ Ignore ]   [ # 13 ]  
Moderator
Avatar
RankRankRankRankRankRankRankRank
Total Posts:  33269
Joined  05-14-2004

hrm, I never thought of switch. *blushes*

 Signature 
Profile
MSG
 
 
Posted: 23 October 2004 01:33 PM   [ Ignore ]   [ # 14 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  326
Joined  02-06-2004

Heheh yeah. Lynda taught me a while ago to use what’s there first before messing with the code. hehe. smile

 Signature 

hello! yoshi
hello! food |

Profile
 
 
Posted: 23 October 2004 01:46 PM   [ Ignore ]   [ # 15 ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  6086
Joined  08-04-2002

Yoshi, that’s great…It’s a perfect example of the “keep it simple” rule…This will come in handy grin

Profile
 
 
Posted: 23 October 2004 03:02 PM   [ Ignore ]   [ # 16 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  326
Joined  02-06-2004

yeah, sometimes the best solutions are the simple ones. unfortunately the simple ones sometimes never occur to anyone for a while. smile

 Signature 

hello! yoshi
hello! food |

Profile
 
 
Posted: 25 October 2004 12:37 PM   [ Ignore ]   [ # 17 ]  
Research Assistant
RankRankRank
Total Posts:  757
Joined  06-01-2004

@Yoshi

Wow! Thanks.

 Signature 

mode.com | schmuck.com | mode.ch | shop.ch

Profile
 
 
Posted: 25 October 2004 04:35 PM   [ Ignore ]   [ # 18 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  326
Joined  02-06-2004

Anytime, I’m glad that I was actually able to help smile

 Signature 

hello! yoshi
hello! food |

Profile
 
 
   
1 of 3
1
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 1149, on July 16, 2007 09:33 AM
Total Registered Members: 66391 Total Logged-in Users: 29
Total Topics: 84716 Total Anonymous Users: 20
Total Replies: 454701 Total Guests: 203
Total Posts: 539417    
Members ( View Memberlist )