Welcome to Geeklog, Anonymous Wednesday, May 22 2024 @ 06:18 am EDT

Geeklog Forums

Remove story text from homepage


Status: offline

jason559

Forum User
Regular Poster
Registered: 03/31/03
Posts: 83
freakingout
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... Banging your head
 Quote

Status: offline

jason559

Forum User
Regular Poster
Registered: 03/31/03
Posts: 83
Can anybody please help me? I'm desperate!
 Quote

Status: offline

Robin

Forum User
Full Member
Registered: 02/15/02
Posts: 725
I'll try to answer your question however don't promise any quick wins Wink
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.
Geeklog Polish Support Team
 Quote

Status: offline

jason559

Forum User
Regular Poster
Registered: 03/31/03
Posts: 83
I really appreciate your reply... I'm not really sure what you mean by modifying STORY_renderArticle, do you think you could elaborate? Thanks
 Quote

Status: Banned

machinari

Forum User
Full Member
Registered: 03/22/04
Posts: 1512
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:
Text Formatted Code

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).
 Quote

Status: offline

Robin

Forum User
Full Member
Registered: 02/15/02
Posts: 725
Unfortunately it's not that simple machinari. However after a quick search here I found a solution here.
It needs a little bit of updating but it really works as you can check here
Geeklog Polish Support Team
 Quote

Status: offline

jason559

Forum User
Regular Poster
Registered: 03/31/03
Posts: 83
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
 Quote

Status: Banned

machinari

Forum User
Full Member
Registered: 03/22/04
Posts: 1512
Quote by Robin: Unfortunately it's not that simple machinari. However after a quick search here I found a solution here.
It needs a little bit of updating but it really works as you can check here

strange, it works quite well for me. perhaps i've misunderstood the question then.
 Quote

Status: offline

jason559

Forum User
Regular Poster
Registered: 03/31/03
Posts: 83
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

Status: Banned

machinari

Forum User
Full Member
Registered: 03/22/04
Posts: 1512
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?

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').
 Quote

Status: offline

jason559

Forum User
Regular Poster
Registered: 03/31/03
Posts: 83
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?
 Quote

Status: offline

jason559

Forum User
Regular Poster
Registered: 03/31/03
Posts: 83
Well, to solve this, this solution should work, at least for 1.3.11:


This is what my frontstorytext.thtml looks like:
Text Formatted Code

<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! Big Celebration
 Quote

All times are EDT. The time is now 06:18 am.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content