Detecting article type for proper news style in headline

Discuss news styles, css code, and other Coranto customizations in here...the possibilities are endless, so have at it!

Moderator: Spunkmeyer

Detecting article type for proper news style in headline

Postby officeslave » Fri Oct 04, 2002 5:06 am

Ugh, what a horrible subject for this thread.

I have several categories on my site. I'm setting it up so that if you click on a "news" item, the item is displayed using viewnews.cgi and the "news" style. If you click on an "article" item, the item is displayed with viewnews.cgi using the "articles" style. All well and good and easy to do after reading the docs.

Now, I"d like to make a "recent submissions" list that would link to the 10 most recent items from the news and articles categories (and any other categories I add). However, I need to make the "recent" news style detect the category and choose an appropriate news style to insert into the hyperlink. I know there's some if/then scripting I can do, but I'm not sure where to begin. I don't really know cgi.

I figure if I could figure out how to do that, I could probably do a listing of submissions filtered by author as well. I couldn't find a tutorial on this, so I apologize if I'm missing something obvious. Thanks.

EDIT: okay, I guess I did miss something obvious, the style doc under official files. I might actually be able to figure that If stuff out after all.
officeslave
 
Posts: 125
Joined: Tue Apr 23, 2002 11:23 am

Postby Sumaleth » Fri Oct 04, 2002 6:50 am

Code: Select all
<If: Field: Category eq "blah">
Style Code 1
</If>
<If: Field: Category eq "apple">
Style Code 2
</If>

If you're using Tintinubalum you need to change it a bit, but it sounds like you're using News Categories so that above will work.
Sumaleth
 
Posts: 1366
Joined: Thu Jul 11, 2002 4:31 pm

Postby officeslave » Fri Oct 04, 2002 10:27 am

Thanks. I do have Tint running, but I haven't had occassion to set an article to multiple categories yet. (Hadn't even considered the implications with the If stuff.) I had planned on using it to fake subcategories, but I think I'll just use profiles and XMultiSubmit to get the desired effect.

Will the Else command still work with multiple Ifs? <If></IF><If></If><If><If: Else></IF>? It hasn't come up yet, but I imagine it will. Seems to default to viewnews.tmpl when none's specified, so it probably won't hurt anything if that won't work.
officeslave
 
Posts: 125
Joined: Tue Apr 23, 2002 11:23 am


Return to Customization

Who is online

Users browsing this forum: No registered users and 1 guest

cron