Oh no! Where's the JavaScript?
Your Web browser does not have JavaScript enabled or does not support JavaScript. Please enable JavaScript on your Web browser to properly view this Web site, or upgrade to a Web browser that does support JavaScript.
Not a member yet? Click here to register.
Forgot Password?

How to remove site title from article titles ?

Asked Modified Viewed 5,067 times
M
motorola
M
  • Member, joined since
  • Contributed 79 posts on the community forums.
  • Started 16 threads in the forums
  • Started this discussions
asked
Member

Can someone tell me how to remove site titles from articles titles ?

I have found this thread http://www.phpfusion-mods.net/forum/viewthread.php?thread_id=1807&pid=9523 and made like it is for custom pages but now my article title is : ,, - Articles : Article name "

How to remove ,,-Articles" from the title? Is it possible ?
0 replies

14 posts

V
vRBa
V
vRBa 10
  • Junior Member, joined since
  • Contributed 26 posts on the community forums.
  • Started 1 thread in the forums
answered
Junior Member

No problem, just enjoy in PHP Fusion :)
0 replies
V
vRBa
V
vRBa 10
  • Junior Member, joined since
  • Contributed 26 posts on the community forums.
  • Started 1 thread in the forums
answered
Junior Member

Quote

motorola wrote:
@vRBa - If I use your solution my article titles is now ,, : Article title "


find in articles.php arround 62 line:
add_to_title($locale['global_201'].$article_subject);


change to:
add_to_title($article_subject);


That should work B)
Edited by vRBa on 20-10-2010 15:46,
0 replies
W
WEC
W
WEC 10
  • Veteran Member, joined since
  • Contributed 946 posts on the community forums.
  • Started 5 threads in the forums
answered
Veteran Member

Well, it works for me in English version with this site name set in admin settings:

Pariuri sportive online | Ghid pariuri online | Biletul zilei | Livescore | Clasamente fotbal

So you need to experiment with you formatting to get a match that will be stripped.
0 replies
M
motorola
M
  • Member, joined since
  • Contributed 79 posts on the community forums.
  • Started 16 threads in the forums
  • Started this discussions
answered
Member

Quote

WEC wrote:
Ok, you got reserved character | in your site title and non English locale, so try this one where the reserved character is escaped by \ and your locale file $locale['400'] used:

include LOCALE.LOCALESET."articles.php";

if (strstr($start_page,'articles.php?article_id=')){
$target = "Pariuri sportive online \| Ghid pariuri online \| Biletul zilei \| Livescore \| Clasamente fotbal"." - ".$locale['400'].": ";
$replace = "";
replace_in_output($target, $replace);
}


You may have to adjust the spaces, - and : if your locale file is not formatted with the same spaces, - and : as the English locale file.



Using this one I dont see any changes, the title remaine the same :)
0 replies
W
WEC
W
WEC 10
  • Veteran Member, joined since
  • Contributed 946 posts on the community forums.
  • Started 5 threads in the forums
answered
Veteran Member

Ok, you got reserved character | in your site title and non English locale, so try this one where the reserved character is escaped by \ and your locale file $locale['400'] used:

include LOCALE.LOCALESET."articles.php";

if (strstr($start_page,'articles.php?article_id=')){
$target = "Pariuri sportive online \| Ghid pariuri online \| Biletul zilei \| Livescore \| Clasamente fotbal"." - ".$locale['400'].": ";
$replace = "";
replace_in_output($target, $replace);
}


You may have to adjust the spaces, - and : if your locale file is not formatted with the same spaces, - and : as the English locale file.
0 replies
M
motorola
M
  • Member, joined since
  • Contributed 79 posts on the community forums.
  • Started 16 threads in the forums
  • Started this discussions
answered
Member

Quote

WEC wrote:
Suggestion that doesn't require any modification of core file.

Add a panel with this code only:

if (strstr($start_page,'articles.php?article_id=')){
$target = $settings['sitename']." - Articles: ";
$replace = "";
replace_in_output($target, $replace);
}


Enable the panel.

More on core function used:

http://code.starefossen.com/infusions..._in_output



I have this site title "Pariuri sportive online | Ghid pariuri online | Biletul zilei | Livescore | Clasamente fotbal" and this article title : Article title 18 october

Using your solution my title became now |||| Clasamente fotbal -:18 october
Edited by motorola on 19-10-2010 22:50,
0 replies
M
motorola
M
  • Member, joined since
  • Contributed 79 posts on the community forums.
  • Started 16 threads in the forums
  • Started this discussions
answered
Member

@vRBa - If I use your solution my article titles is now ,, : Article title "
Edited by motorola on 19-10-2010 23:26,
0 replies
V
vRBa
V
vRBa 10
  • Junior Member, joined since
  • Contributed 26 posts on the community forums.
  • Started 1 thread in the forums
answered
Junior Member

cool, @WEC give you the better solution. Enjoy :)
0 replies
W
WEC
W
WEC 10
  • Veteran Member, joined since
  • Contributed 946 posts on the community forums.
  • Started 5 threads in the forums
answered
Veteran Member

Suggestion that doesn't require any modification of core file.

Add a panel with this code only:

if (strstr($start_page,'articles.php?article_id=')){
$target = $settings['sitename']." - Articles: ";
$replace = "";
replace_in_output($target, $replace);
}


Enable the panel.

More on core function used:

http://code.starefossen.com/infusions..._in_output
0 replies
V
vRBa
V
vRBa 10
  • Junior Member, joined since
  • Contributed 26 posts on the community forums.
  • Started 1 thread in the forums
answered
Junior Member

That isn't possible without changing function (add_to_title) from:
/includes/output_handling_include.php

But it'll change title on all your pages, you can do it on your own:
(before doing any changes please backup your files!)

Find:
function add_to_title($addition=""){
    global $fusion_page_title;
   
    $fusion_page_title .= $addition;
}


Change to:
function add_to_title($addition=""){
    global $fusion_page_title;
   
    $fusion_page_title = $addition;
}


Please answer if this work B)
0 replies
M
motorola
M
  • Member, joined since
  • Contributed 79 posts on the community forums.
  • Started 16 threads in the forums
  • Started this discussions
answered
Member

When I delete that line, my article title is Site Title : Article Title

I want only to have the title ,,Article Title" without the site title
0 replies
V
vRBa
V
vRBa 10
  • Junior Member, joined since
  • Contributed 26 posts on the community forums.
  • Started 1 thread in the forums
answered
Junior Member

Delete that line:

add_to_title($locale['global_200']);
0 replies
M
motorola
M
  • Member, joined since
  • Contributed 79 posts on the community forums.
  • Started 16 threads in the forums
  • Started this discussions
answered
Member

Thanks for your answer. Now my article title is : Site Title - : Article Title.

My question is : How to remove ,, Site Title - : ". ?

Thanks
0 replies
C
Craig
C
Craig 14
  • Fusioneer, joined since
  • Contributed 4,462 posts on the community forums.
  • Started 212 threads in the forums
answered
Fusioneer

articles.php

Look for...

add_to_title($locale['global_200'].$locale['400']);


Change it to...

add_to_title($locale['global_200']);
0 replies

Labels

None yet

Statistics

  • Views 0 views
  • Posts 14 posts
  • Votes 0 votes
  • Topic users 4 members

4 participants

C
C
Craig 14
  • Fusioneer, joined since
  • Contributed 4,462 posts on the community forums.
  • Started 212 threads in the forums
W
W
WEC 10
  • Veteran Member, joined since
  • Contributed 946 posts on the community forums.
  • Started 5 threads in the forums
M
M
  • Member, joined since
  • Contributed 79 posts on the community forums.
  • Started 16 threads in the forums
  • Started this discussions
V
V
vRBa 10
  • Junior Member, joined since
  • Contributed 26 posts on the community forums.
  • Started 1 thread in the forums

Notifications

Track thread

You are not receiving notifications from this thread.

Related Questions

Not yet