Posted on: 05/03/05 09:46pm
By: jason559
I posted this question at one time, but since I've done an upgrade I need help with this again.
I'd like to have the story body and intro text not listed on the index page (or any story category page). I want only the story title to be a link to the full-page story page.
I was told at one point to remove {story_introtext} from storytext.thml in my theme directory. But, this removes the text from the full article/story page as well....
I only want it not listed on the front page/category page... Is there anything I can do?
I was using 1.3.7sr1, now 1.3.11 but, even copying over my old theme files does not put it back to the way it was...
Remove story text from homepage
Posted on: 05/06/05 03:50am
By: jason559
Can anybody please help me? I'm desperate!
Remove story text from homepage
Posted on: 05/06/05 06:24am
By: Robin
I'll try to answer your question however don't promise any quick wins
If you take a look at index.php you will notice that articles/stories are called by this STORY_renderArticle function. Modifying the templates doesn't solve your request indeed.
Therefore you need to go to lib-story.php, find STORY_renderArticle and modify it.
Remove story text from homepage
Posted on: 05/06/05 07:11am
By: jason559
I really appreciate your reply... I'm not really sure what you mean by modifying STORY_renderArticle, do you think you could elaborate? Thanks
Remove story text from homepage
Posted on: 05/06/05 12:28pm
By: machinari
find line 205 in lib-story.php (i'm using v 1.15 2004/12/31 10:31:35). it should be beginning an "else" statement. This else statement contains that info that you will want to edit to accomplish your goal.
Within the section, lines 206 - 311, comment out those variable that you do not want to show up in your index and category pages.
for example: find lines 208 and 209 and comment them out like this:
original:
$article->set_var( 'story_introtext', $introtext );
$article->set_var( 'story_text_no_br', $introtext );
commented:
//$article->set_var( 'story_introtext', $introtext );
//$article->set_var( 'story_text_no_br', $introtext );
this shouldn't have any effect on what displays via article.php (the full article).
Remove story text from homepage
Posted on: 05/06/05 04:14pm
By: Robin
Unfortunately it's not that simple machinari. However after a quick search here I found a solution
here[*1] .
It needs a little bit of updating but it really works as you can check
here[*2]
Remove story text from homepage
Posted on: 05/06/05 06:25pm
By: jason559
I found STORY_renderArticle in lib-story.php, now I'm not exactly sure what I should be doing... Is there anyway you can tell me how I can modify the lines to make it work? I really appreciate your help
Remove story text from homepage
Posted on: 05/06/05 09:03pm
By: machinari
[QUOTE BY= Robin] Unfortunately it's not that simple machinari. However after a quick search here I found a solution
here[*1] .
It needs a little bit of updating but it really works as you can check
here[*2] [/QUOTE]
strange, it works quite well for me. perhaps i've misunderstood the question then.
Remove story text from homepage
Posted on: 05/07/05 04:11am
By: jason559
Machinari,
I used your solution, but now I have a page of titles and borders and # of comments, and number of times viewed. But, I'm unsure how to remove those without effecting the full paged article. Also, I need the title to be a link to the full story... Any ideas on how to do this?
Remove story text from homepage
Posted on: 05/07/05 01:33pm
By: machinari
[QUOTE BY= jason559] Machinari,
I used your solution, but now I have a page of titles and borders and # of comments, and number of times viewed. But, I'm unsure how to remove those without effecting the full paged article. Also, I need the title to be a link to the full story... Any ideas on how to do this?[/QUOTE]
as i suggested earlier, all the template variables set within that "else" statement together produce the article on the index/topic pages. In order to remove the byline, the date posted, etc., you will have to comment out the appropriate lines withing that "else" statement mentioned above. I only showed you an example of two lines.
You might have an easier time if you just created a new template file for what you would like to see in the article space of the index page and implement that file and its variables via that "else" statement.. In this way you will have all the control over what appears in the article space on the index page and, in the future, will only have to edit the template file to affect any content redistributions. ...and this seems to be the solution Robin has suggested.
/me looks at Robin's suggestion just now. nice--seems that geeklog is all set up to do this already. You just need another template file (edit it how you like) and in index.php change the two instances of STORY_renderArticle ($A, 'y') to look like STORY_renderArticle ($A, 'y', 'yournewtemplate.thtml').
Remove story text from homepage
Posted on: 05/08/05 02:41am
By: jason559
I'm not sure how to create a template file. Is there one I can copy and modify?
Perhaps if you have the time you could post an example?
Remove story text from homepage
Posted on: 05/08/05 03:33am
By: jason559
Well, to solve this, this solution should work, at least for 1.3.11:
This is what my frontstorytext.thtml looks like:
<table width="100%" border="0" cellspacing="0" cellpadding="2">
<tr>
<td colspan="2" align="left" bgcolor="#e1e2e5"><span class="articleTitle"><a href="{site_url}/article.php?story={story_id}">{story_title}</a></span></td>
</td>
</tr>
</table>
And, all I had to do was: edit my index.php and change the two instances of STORY_renderArticle ($A, 'y') to look like STORY_renderArticle ($A, 'y', 'frontstorytext.thtml').
Thanks for everyones help!