Welcome to Geeklog, Anonymous Thursday, March 28 2024 @ 07:26 am EDT

Geeklog Forums

Change "read more" link to something more descriptive


Status: offline

RickW

Forum User
Full Member
Registered: 01/28/04
Posts: 240
Location:United States
indifferent
I would like to modify the "read more" link to say "Read More: The Title of the Story" and have it be bold. It's inconspicuous right now.

How do I do this?
www.antisource.com
 Quote

Status: offline

Robin

Forum User
Full Member
Registered: 02/15/02
Posts: 725
First look into english.php and find "read more" and change it to Read More:.
Then I'd say you need to modify a storytext.thtml, of the layout of yours. Find {readmore_link} add {story_title} right after it embrace it with bold tags. Let me know if it works.
Geeklog Polish Support Team
 Quote

RickW

Anonymous
Quote by Robin: First look into english.php and find "read more" and change it to Read More:.
Then I'd say you need to modify a storytext.thtml, of the layout of yours. Find {readmore_link} add {story_title} right after it embrace it with bold tags. Let me know if it works.


Close but didn't work.

If I put {story_title} in storytext.thtml, it's not within the link anchor - plus if there isn't any more story to read, it still shows up. So I tried putting {story_title} into the {readmore_link} text in English.php. Doesn't seem to work. Also tried {$story_title} because I saw some other variables used as such but nope.

Any other ideas?
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
See the documentation for a list of variables you can use in a story.

bye, Dirk
 Quote

Status: offline

Robin

Forum User
Full Member
Registered: 02/15/02
Posts: 725
Quote by RickW:Close but didn't work.
Any other ideas?


Ok forget the first solution. Check here if that's what you had in mind.
Geeklog Polish Support Team
 Quote

RickW

Anonymous
Quote by RickW:
Quote by Robin: First look into english.php and find "read more" and change it to Read More:.
Then I'd say you need to modify a storytext.thtml, of the layout of yours. Find {readmore_link} add {story_title} right after it embrace it with bold tags. Let me know if it works.


Close but didn't work.

If I put {story_title} in storytext.thtml, it's not within the link anchor - plus if there isn't any more story to read, it still shows up. So I tried putting {story_title} into the {readmore_link} text in English.php. Doesn't seem to work. Also tried {$story_title} because I saw some other variables used as such but nope.

Any other ideas?


Well it's a little better now - still not 100% what I want but it will do for now. The solution was to use {readmore_link}{start_readmore_anchortag}{story_title}{end_readmore_anchortag} in storytext.thtml.

Had to still ues the readmore_link because if I entered just the text it would show up even if there wasn't more to read. Plus if there isn't more to read, I still end up with the story_title showing up but I guess I'll let that go.

 Quote

RickW

Anonymous
Quote by Robin:
Quote by RickW:Close but didn't work.
Any other ideas?


Ok forget the first solution. Check here if that's what you had in mind.


Yes, but does that work if you don't have any body text?
 Quote

Status: offline

Robin

Forum User
Full Member
Registered: 02/15/02
Posts: 725
Quote by RickW:Yes

OK. Here's what you need to do:
1. Edit your lib-common.php (but first back it up) and find this bit:
Text Formatted Code
            $article->set_var( 'readmore_link', '<a href="' . $articleUrl . '">'
                    . $LANG01[2] . '</a> (' . $numwords . ' ' . $LANG01[62]
                  . ') ' );
 

2. Highlight it and overwrite with this bit:
Text Formatted Code

//readmore + story title hack
                        $article->set_var( 'readmore_link', '<a href="' . $articleUrl . '">
                        ' . $LANG01[2] . '</a> ' );
            $article->set_var( 'readmore_link_title', '<a href="' . $articleUrl . '">
                        ' . $A['title'] . '</a> (' . $numwords . ' ' . $LANG01[62]
                    . ') ' );
//readmore + story title hack
 

3. Save your lib-common.php
4. Edit english.php and change read more into e.g. Read More:
5. Edit storytext.thtml and after {readmore_link) add this bit
{readmore_link_title}. Embrace them with bold tags.
6. Save all files
6. Enjoy the hack.
Geeklog Polish Support Team
 Quote

RickW

Anonymous
nerdy
Quote by Robin:
Quote by RickW:Yes

OK. Here's what you need to do:
1. Edit your lib-common.php (but first back it up) and find
Text Formatted Code
            $article->set_var( 'readmore_link', '<a href="' . $articleUrl . '">'
                    . $LANG01[2] . '</a> (' . $numwords . ' ' . $LANG01[62]
                  . ') ' );

 

2. Highlight it and overwrite with this bit:
Text Formatted Code

//readmore + story title hack
                        $article->set_var( 'readmore_link', '<a href="' . $articleUrl . '">
                        ' . $LANG01[2] . '</a> ' );
            $article->set_var( 'readmore_link_title', '<a href="' . $articleUrl . '">
                        ' . $A['title'] . '</a> (' . $numwords . ' ' . $LANG01[62]
                    . ') ' );
//readmore + story title hack

 

3. Save your lib-common.php
4. Edit english.php and change read more into e.g. Read More:
5. Edit storytext.thtml and after {readmore_link) add this bit
{readmore_link_title}. Embrace them with bold tags.
6. Save all files
6. Enjoy the hack.
this bit:

This hack should become a permanent change in the Geeklog distribution.

thanks for your help!
 Quote

Status: offline

jnordquist

Forum User
Full Member
Registered: 03/14/03
Posts: 129
Location:Kenosha
What site is this working on? I'd really like to see this. Thanks!


John Nordquist,
Applications Specialist, medical Technologies
 Quote

RickW

Anonymous
Quote by jnordquist: What site is this working on? I'd really like to see this. Thanks!



here

I'm still using my first result, maybe tonight I'll follow Robin's instructions to clean it up.
 Quote

Status: offline

Robin

Forum User
Full Member
Registered: 02/15/02
Posts: 725
Quote by jnordquist: What site is this working on? I'd really like to see this. Thanks!

E.g. here
Geeklog Polish Support Team
 Quote

RickW

Anonymous
Okay now a new question. Still on the theme of using the variables though.

In my header I want to use:

Text Formatted Code
<META NAME="keywords" CONTENT="{story_topic_name}, antivirus, spam, computer virus, email filtering, virus scanning">
<META NAME="description" CONTENT="{story_topic_name}: {story_title}">
 


Per the GL Doc, those variables are only available in the story files. Is there anything I can do to reference them?

A suggestion for Geeklog2, if you guys can add a Keywords field to stories, so I can enter "antivirus, symantec, virus signatures" or whatever pertains to the article - then this field could be referenced by a variable called "meta_keywords". The What's Related block could also cross reference this field with other articles, or have a seperate block called Related Articles.

In fact it would be nice if there was a set of meta variables. meta_keywords, meta_description, meta_abstract, meta_author, meta_revisit, meta_rating, etc. usable in the header file.


 Quote

Status: offline

Robin

Forum User
Full Member
Registered: 02/15/02
Posts: 725
Quote by RickW:In fact it would be nice if there was a set of meta variables. meta_keywords, meta_description, meta_abstract, meta_author, meta_revisit, meta_rating, etc. usable in the header file.



Correct me if I'm wrong, you're worried about pages indexing. From experience I can tell (beats me why) but Geeklog sites are getting indexed so well that you'd never believe.
E.g. I put an example ad on my site. A picture of Henri Cartier Bresson. The other day I was checking the referrers and there was a query on Google looking for "Henri Cartier Bresson" to my surprise my site was on the third place. See here.
For example my site is No. 1 in Google under Geeklog (this is of course for Polish language only)
Geeklog Polish Support Team
 Quote

RickW

Anonymous
Quote by Robin:
Quote by RickW:In fact it would be nice if there was a set of meta variables. meta_keywords, meta_description, meta_abstract, meta_author, meta_revisit, meta_rating, etc. usable in the header file.



Correct me if I'm wrong, you're worried about pages indexing. From experience I can tell (beats me why) but Geeklog sites are getting indexed so well that you'd never believe.
E.g. I put an example ad on my site. A picture of Henri Cartier Bresson. The other day I was checking the referrers and there was a query on Google looking for "Henri Cartier Bresson" to my surprise my site was on the third place. See here.
For example my site is No. 1 in Google under Geeklog (this is of course for Polish language only)


There are more search engines besides Google. Also if you have a meta description tag then Google uses that in the search results.
 Quote

Wayne

Anonymous
{readmore_link_title}. Embrace them with bold tags.


For some reason this is not working for me. I did not make all the changes above as all I wanted to do was change "read more" to "read more" in bold.

I used:

Text Formatted Code
<b>{readmore_link}</b>
 


Yet I still see it in plain non bold for some reason. I also removed the center tag to have it left justify by default and yet it's still centered. Here is the code with my changes:

Text Formatted Code
<table border="0" cellpadding="0" cellspacing="0" width="100%">
    <tr>
      <td width="100%" class="story-title"><img src="{site_url}/images/speck.gif" width="1" height="0" alt=""><h2><a href="{article_url}" class="non-ul">{story_title}</a></h2></td>
      <td class="story-title" width="5%" align="right" nowrap> {email_icon} {print_icon} {pdf_icon}</td>
    </tr>
    <tr>
      <td class="story-box" colspan="2"><table border="0" cellpadding="3" cellspacing="0" width="100%"><tr><td class="story-information" width="100%">{story_date}<br>{lang_contributed_by} {start_contributedby_anchortag}{contributedby_user}{end_contributedby_anchortag}<br>{lang_views}: {story_hits}</td></tr>
                           
                                <tr>
                                    <td>
                                        <p>{story_anchortag_and_image}{story_introtext}</p>
                                    </td></tr></table>
                                        <table border="0" cellpadding="3" cellspacing="0" width="100%">

                                               
                                                        <tr>{edit_link}<br>
<b>{readmore_link}</b>{start_comments_anchortag}{comments_text}{end_comments_anchortag}<br>
{recent_post_anchortag}<br></tr>
                                                       
                                                        </table></td>
    </tr>
  </table>
<table cellspacing="0" cellpadding="0" align="center" width="100%" class="block-divider"><tr><td><img src="{site_url}/images/speck.gif" width="1" height="2" alt=""></td></tr></table>
 


Any thoughts?
 Quote

Wayne

Anonymous
disregard the above, it's working, it just does not work with the featured article for some reason.
 Quote

Status: offline

matthewcox

Forum User
Junior
Registered: 12/11/03
Posts: 31
Location:Asheville, North Carolina
Quote by Wayne: disregard the above, it's working, it just does not work with the featured article for some reason.


Wayne,

Don't forget, whatever changes you made to storytext.thtml should also be made to featuredstorytext.thtml
Same goes for storybodytext.thtml -> featuredstorybodytext.thtml

-Matthew Cox
 Quote

All times are EDT. The time is now 07:26 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