Author |
Message |
srhh
Involved
![Involved Involved](modules/Forums/images/ranks/4stars.gif)
![](modules/Forums/images/avatars/45eb2b5645331193ef430.gif)
Joined: Dec 27, 2005
Posts: 296
|
Posted:
Tue Oct 24, 2006 9:16 am |
|
I want to make an image that says "Featured Articles" right above where the News starts on my homepage. I found if I put it right as the first thing in themes/story_home.html, it does what I want, except it puts the image above every news story in the index and I just want it at the top of the first.
How would I do this? |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
srhh
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Tue Oct 24, 2006 10:59 am |
|
Nevermind. Just decided it'd be easier to make a small little block to put on top of the news. |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
fkelly
Former Moderator in Good Standing
![](modules/Forums/images/avatars/gallery/blank.gif)
Joined: Aug 30, 2005
Posts: 3312
Location: near Albany NY
|
Posted:
Tue Oct 24, 2006 11:20 am |
|
I wish I had an easy answer. Let me explain the difficulty first. The news module reads all the news articles or at least it reads the number you have set in your storyhome variable or the site default number of stories in home if the storyhome variable isn't set. Then it goes thru all kinds of formatting permutations and finally calls the themeindex function of whatever theme you are using ONCE FOR EACH STORY.
The themeindex then does some more theme specific formatting and uses the story_home.html file as a "template" for presenting the story. So anything you stick in story_home will be repeated once for each story. The html file doesn't have any PHP logic in it so you can't say "just do this row once per news page presentation" by setting a flag. I guess you could hack the theme and create another html file that only gets presented once every time the news page is loaded. Or you could stick the image in the themeheader but only have it presented if you are in the news module.
The problem with any of these approaches is that they are non-standard and they will only work for a single theme that you've modified and so you'd have to modify a bunch of themes if you give users a choice. And some of the themes are structured differently (they don't use the html files) so you'd have to hack two different kinds of themes.
Maybe someone else can help you with a better approach than I've outlined but if I were you I'd forget the idea. Aside from the problems I've outlined you'd also have to take into account that when a new release comes out you'll have to reintegrate your hacks into the new version of code. |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
evaders99
Former Moderator in Good Standing
![](modules/Forums/images/avatars/803d73f6452557b947721.jpg)
Joined: Apr 30, 2004
Posts: 3221
|
Posted:
Tue Oct 24, 2006 12:06 pm |
|
The block there is the easiest approach.
You could also edit the main theme.php |
_________________ - Only registered users can see links on this board! Get registered or login! -
Need help? Only registered users can see links on this board! Get registered or login! |
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
srhh
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Tue Oct 24, 2006 12:23 pm |
|
I am at one with the Path of the Lazy, and my guru hath given me this key:
Code:<?php
if (eregi("block-featured.php",$_SERVER['PHP_SELF'])) {
Header("Location: index.php");
die();
}
$content .= "<center><img src=\"images/featured.gif\"BORDER=0><br>Below are the five latest articles.<br><a href=\"content.html\">Click here for the archive of all the past featured articles and for other relevant content in the Library.</a><br ><a href=\"submit.html\">Or click here to submit your own article or news piece.</center>";
?>
|
Thanks for the info though. Its interesting to know how this stuff works.
I still will not convert to your blasphemous ideals of work. ![Wink](modules/Forums/images/smiles/icon_wink.gif) |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
Guardian2003
Site Admin
![](modules/Forums/images/avatars/125904890252d880f79f312.png)
Joined: Aug 28, 2003
Posts: 6799
Location: Ha Noi, Viet Nam
|
Posted:
Tue Oct 24, 2006 4:18 pm |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
srhh
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Thu Oct 26, 2006 10:54 am |
|
Never too bored for new shiny toys!
Thanks for the link! |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
fkelly
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Thu Oct 26, 2006 2:03 pm |
|
So you are using content and not news? That's what the code looks like. I'm just curious because I was thinking about this and I believe that if news is the module in home then it will be positioned automatically right below the message and I'm not sure how you'd stick another block in between them. I was thinking that a possible "hack" solution might be to put the text you want in the second message (you can have two of them) and that would appear right above the news block. |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
srhh
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Thu Oct 26, 2006 5:04 pm |
|
No, I just made the block with the featured articles graphic and placed it as 'center up' so it only shows on top of the five articles I have in home, which is what I was trying to do without making a block. But it looks prettier this way.
The MetHomepage and MetTopic modules look pretty cool and I'll probably end up switching over to them. |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
|