Joomla! Discussion Forums



It is currently Wed Nov 25, 2009 10:16 pm (All times are UTC )

 


Forum rules

Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.



Post new topic Reply to topic  [ 14 posts ] 
Author Message
Posted: Tue Feb 21, 2006 9:48 pm 
Joomla! Apprentice
Joomla! Apprentice
Offline

Joined: Sun Oct 16, 2005 11:04 am
Posts: 5
Im runing Joomla 1.0.7 but its basic is Mambo 4.5.2 (it was upgraded by overwriting with 1.0.1). , I read somwhere there was a problem that somwhere in code was an error so its always showing basic keywords and description, ones you set in global config, no metter what page you are on, please this means very much to me.

Web page is
http://www.gotocro.com

Many thanks for help  :)

_________________
GotoCro


Last edited by Tonie on Wed Mar 15, 2006 12:06 pm, edited 1 time in total.

Top
   
 
Posted: Tue Feb 21, 2006 10:04 pm 
User avatar
Joomla! Guru
Joomla! Guru
Offline

Joined: Fri Aug 19, 2005 3:36 pm
Posts: 618
I haven't heard about this bug - which does not mean it hasn't been there, no clue really - but I can assure you that in 1.0.7 the meta tag functionality as implemented and intended is fully functioning. It is easy to test: edit an article and enter some item specific meta keywords and description. If you check the source code of that html page you will see that they have been appended to the site's global meta keywords/description.

If you are interested in content related meta tags you might be interested in these links:

- Meta-Tag Generator
  (a very nice hack that adds a "generate meta tags" button to the article's editing page, which will automatically suggest usefull keywords/description using the article's content)
- MetaFly mambot
  (a smart mambot that will create those content related meta tags automatically)

Hope this helps.

Nic

_________________
[ Joomla! StatsCleaner - a free tool to reset ALL Joomla! stats - http://www.nab-design.de/devcorner/ ]


Top
  E-mail  
 
Posted: Tue Feb 21, 2006 10:21 pm 
Joomla! Apprentice
Joomla! Apprentice
Offline

Joined: Sun Oct 16, 2005 11:04 am
Posts: 5
Thanks on fast reply but as I said Meta tag generator is already implemented :( and on all pages Im getting the same meta tags :(

Once more thanks on such quick reply but it seems I will need to search further

Thanks

B

_________________
GotoCro


Top
   
 
Posted: Wed Feb 22, 2006 12:21 am 
User avatar
Joomla! Ace
Joomla! Ace
Offline

Joined: Fri Aug 19, 2005 2:26 am
Posts: 1802
Location: Lancaster, Lancashire, United Kingdom
Hi,

I think you have more pressing issues to be honest. On first visit your site is painfully slow - so I thought i would see why.
http://www.websiteoptimization.com/serv ... tocro.com/

Apart from the fact that the page is over 300KB in size

Total HTTP Requests: 49
Total Size: 322705 bytes

and that the download time is:
56K  65.11 seconds

you have a few missing elements that are redirected back onto new instances of the script - scaling your database load by about 400%

The clue is here:
1  13191  CSS IMG  http://www.gotocro.com/templates/gotocr ... ullet1.gif
1 13185 CSS http://www.gotocro.com/css/com_estilos.css
1 13183 CSS IMG http://www.gotocro.com/templates/gotocr ... search.gif
1 13182 CSS http://www.gotocro.com/css/template_css.css
1 13178 HTML http://www.gotocro.com/

Notice all those files that are within a few bytes of the size of the HTML - those are the missing files being redirected to a new instance of the script.

The solution is to amend your .htaccess file to prevent this cycling.
There is a new solution available somewhere in the forums - but the .htaccess supplied with Joomla has a 'solution' that works for many.

The first line is the key - when added immediately above the other lines - it should stop the script from being called when files with those prefixes are missing: Add the line and try and load one of the missing files in your browser - you should see a 404 file not found error rather than seeing your site.
Code:
RewriteCond %{REQUEST_URI} !\.(jpg|jpeg|gif|png|css|js|pl|txt|ico)$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*) index.php


Of course the size of your flash and other graphics is also problematic.
23KB is very large for the 'small' left3 and right3 graphics.

Hope that gives you some pointers.

Dean.

_________________
Dean Marshall - Mambo and Joomla Consultant
Dean Marshall Consultancy Limited - http://www.deanmarshall.co.uk/


Top
   
 
Posted: Tue Mar 14, 2006 5:31 pm 
Joomla! Apprentice
Joomla! Apprentice
Offline

Joined: Sun Oct 16, 2005 11:04 am
Posts: 5
Many thanks for help Dean, I’m going to fix it now, but do you have a clue why on every page first comes Global Meta Keywords and Description, and after them that particular site description/keywords

_________________
GotoCro


Top
   
 
Posted: Wed Mar 15, 2006 12:23 am 
User avatar
Joomla! Guru
Joomla! Guru
Offline

Joined: Fri Aug 19, 2005 3:36 pm
Posts: 618
bananaman wrote:
Many thanks for help Dean, I’m going to fix it now, but do you have a clue why on every page first comes Global Meta Keywords and Description, and after them that particular site description/keywords


If you want to reverse your meta tag order from "site meta - content meta" to "content meta - site meta" you simply need to change one line in file includes/joomla.php (backup first!):

Search for this line:
Code:
$this->_head['meta'][$i][1] = $content .', '. $this->_head['meta'][$i][1];


and change it to:
Code:
$this->_head['meta'][$i][1] = $this->_head['meta'][$i][1] .', '. $content;


Or if you want only content meta on content items (i.e. no site meta is displayed on content items) change that line to this instead:
Code:
$this->_head['meta'][$i][1] = $this->_head['meta'][$i][1];


Hope this helps.

Nic

_________________
[ Joomla! StatsCleaner - a free tool to reset ALL Joomla! stats - http://www.nab-design.de/devcorner/ ]


Top
  E-mail  
 
Posted: Wed Mar 15, 2006 11:13 am 
Joomla! Apprentice
Joomla! Apprentice
Offline

Joined: Sun Oct 16, 2005 11:04 am
Posts: 5
Thank you so much on your quick reply, I solved the problem differently but this solution is also great, I found on mamboserver one old post and used code from there to fill global tags when there are none generated for the page, and if the page has its own meta tags then to use its own, without using global. This is the code and files I edited:

in /includes/joomla.php after function appendMetaTag I have added

Code:
function addIfEmptyMetaTag( $name, $content ) {
                $name = trim( htmlspecialchars( $name ) );
                $n = count( $this->_head['meta'] );
                for ($i = 0; $i < $n; $i++) {
                        if ($this->_head['meta'][$i][0] == $name) {
                                $content = trim( htmlspecialchars( $content ) );
                                if ( $content ) {
                                        if ( !$this->_head['meta'][$i][1] ) {
                                                $this->_head['meta'][$i][1] = $content ;
                                        } else {
                                                return;
                                        }
                                }
                                return;
                        }
                }
                $this->addMetaTag( $name , $content );
       }


and changed in /includes/frontend.php

$mainframe->appendMetaTag( '...

to:

$mainframe->addIfEmptyMetaTag( '...

This is exactly what I needed, but your solution would also do.

Many thanks once more :)

_________________
GotoCro


Top
   
 
Posted: Tue Apr 25, 2006 11:15 pm 
Joomla! Intern
Joomla! Intern
Offline

Joined: Tue Apr 04, 2006 10:58 pm
Posts: 58
Nic-
Thanks for this post. I had this modification done in Mambo, but lost it in the conversion to Joomla.

Excellent. Thanks!

Chris


Top
  E-mail  
 
Posted: Sat May 13, 2006 8:18 pm 
Joomla! Fledgling
Joomla! Fledgling
Offline

Joined: Sat May 13, 2006 8:00 pm
Posts: 2
Nic wrote:
bananaman wrote:
Many thanks for help Dean, I’m going to fix it now, but do you have a clue why on every page first comes Global Meta Keywords and Description, and after them that particular site description/keywords


If you want to reverse your meta tag order from "site meta - content meta" to "content meta - site meta" you simply need to change one line in file includes/joomla.php (backup first!):

Search for this line:
Code:
$this->_head['meta'][$i][1] = $content .', '. $this->_head['meta'][$i][1];


and change it to:
Code:
$this->_head['meta'][$i][1] = $this->_head['meta'][$i][1] .', '. $content;


Or if you want only content meta on content items (i.e. no site meta is displayed on content items) change that line to this instead:
Code:
$this->_head['meta'][$i][1] = $this->_head['meta'][$i][1];


Hope this helps.

Nic


i have tried this method and show no change in the order of my meta tags.
do i need to change anything other than that code mentioned above?

thanks
JS


Top
   
 
Posted: Sat May 13, 2006 8:22 pm 
Joomla! Fledgling
Joomla! Fledgling
Offline

Joined: Sat May 13, 2006 8:00 pm
Posts: 2
one more question
not only would i like to change the order but i would also like to use a keyword phrase
instead of the site name, is this possible?

thanks again
JS


Top
   
 
Posted: Thu May 18, 2006 11:11 pm 
User avatar
Joomla! Apprentice
Joomla! Apprentice
Offline

Joined: Sun Nov 27, 2005 2:46 am
Posts: 16
bananaman wrote:
Thank you so much on your quick reply, I solved the problem differently but this solution is also great, I found on mamboserver one old post and used code from there to fill global tags when there are none generated for the page, and if the page has its own meta tags then to use its own, without using global. This is the code and files I edited:

in /includes/joomla.php after function appendMetaTag I have added

Code:
function addIfEmptyMetaTag( $name, $content ) {
                $name = trim( htmlspecialchars( $name ) );
                $n = count( $this->_head['meta'] );
                for ($i = 0; $i < $n; $i++) {
                        if ($this->_head['meta'][$i][0] == $name) {
                                $content = trim( htmlspecialchars( $content ) );
                                if ( $content ) {
                                        if ( !$this->_head['meta'][$i][1] ) {
                                                $this->_head['meta'][$i][1] = $content ;
                                        } else {
                                                return;
                                        }
                                }
                                return;
                        }
                }
                $this->addMetaTag( $name , $content );
       }


and changed in /includes/frontend.php

$mainframe->appendMetaTag( '...

to:

$mainframe->addIfEmptyMetaTag( '...

This is exactly what I needed, but your solution would also do.

Many thanks once more :)



I use metafly and this hack, all works greatful about contents but I would use this option with other components too, I think it could be so useful...is it possible?
How to do it?


Top
   
 
Posted: Sun Dec 23, 2007 3:23 pm 
User avatar
Joomla! Apprentice
Joomla! Apprentice
Offline

Joined: Mon Mar 06, 2006 10:26 pm
Posts: 22
Location: Rosario
Nic wrote:
bananaman wrote:
Many thanks for help Dean, I’m going to fix it now, but do you have a clue why on every page first comes Global Meta Keywords and Description, and after them that particular site description/keywords


If you want to reverse your meta tag order from "site meta - content meta" to "content meta - site meta" you simply need to change one line in file includes/joomla.php (backup first!):

Search for this line:
Code:
$this->_head['meta'][$i][1] = $content .', '. $this->_head['meta'][$i][1];


and change it to:
Code:
$this->_head['meta'][$i][1] = $this->_head['meta'][$i][1] .', '. $content;


Or if you want only content meta on content items (i.e. no site meta is displayed on content items) change that line to this instead:
Code:
$this->_head['meta'][$i][1] = $this->_head['meta'][$i][1];


Hope this helps.

Nic
Very Thanks NIC... this post is very helpfull, thanks


Top
   
 
Posted: Sat Apr 11, 2009 9:39 am 
Joomla! Apprentice
Joomla! Apprentice
Offline

Joined: Mon Mar 30, 2009 5:04 am
Posts: 10
Thanks very much, Nic, that's exactly what I need. Got it. Great. I think, it will be more useful for SEO

Nic wrote:
bananaman wrote:
Many thanks for help Dean, I’m going to fix it now, but do you have a clue why on every page first comes Global Meta Keywords and Description, and after them that particular site description/keywords


If you want to reverse your meta tag order from "site meta - content meta" to "content meta - site meta" you simply need to change one line in file includes/joomla.php (backup first!):

Search for this line:
Code:
$this->_head['meta'][$i][1] = $content .', '. $this->_head['meta'][$i][1];


and change it to:
Code:
$this->_head['meta'][$i][1] = $this->_head['meta'][$i][1] .', '. $content;


Or if you want only content meta on content items (i.e. no site meta is displayed on content items) change that line to this instead:
Code:
$this->_head['meta'][$i][1] = $this->_head['meta'][$i][1];


Hope this helps.

Nic


Top
  E-mail  
 
Posted: Thu Sep 03, 2009 11:11 am 
Joomla! Intern
Joomla! Intern
Offline

Joined: Wed Sep 02, 2009 10:36 am
Posts: 54
Hi,

It's Very simple way to display customize Meta Tags and Keywords ...

This concept will wont work if the content are coming from article ..
This for Joomla1.5.X
$document =& JFactory::getDocument();
$document->setTitle($document->getTitle() . ' | ' . "Webmaker");
$document->setMetaData("keywords", "Webmaker,web developer, css designer, cd presentation,logo designer");
$document->setDescription("Webmaker is the website developer whoe makes and create website static ,dynamic");
$document->setGenerator("This is Generated by Webmaker.co.in");


Hope this helps.


Top
  E-mail  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 14 posts ] 

Quick reply

 



Who is online

Users browsing this forum: No registered users and 18 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group