Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: [1]   Go Down

Author Topic: Where is "meta name="description" ..." generated ?  (Read 6850 times)

0 Members and 1 Guest are viewing this topic.

dmb0058

  • Coppermine newbie
  • Offline Offline
  • Posts: 7
Where is "meta name="description" ..." generated ?
« on: November 27, 2008, 09:40:34 am »

I can't figure this out at all - I've trawled the forums, googled and fgrepped for several hours and I'm sure it's under my nose somewhere !!

So, sorry for posting what is probably a question with a very ovbious answer but this has me beaten.

I'm using cpg1.4.19 bridged to Joomla on Ubuntu 7.10. An example of one of my image pages (I assume displayed by displayimage.php) contains the following:

Code: [Select]
...
<head>

  <meta http-equiv="content-type" content="text/html; charset=utf-8" />
  <meta name="robots" content="index, follow" />
  <meta name="keywords" content="space, coins, exonumia, medal, memorabilia, tokens" />
  <meta name="description" content="www.spacecoins.net - coins, medals and other memorabilia of Man's greatest achievement." />
...
<title>spacecoins.net Photo Gallery - Man In Space/Mercury III, Alan B. Shepard</title>
...
</head>
...

The content of the "<meta name="description" ...> tag comes from within Joomla, I would like to replace that content with the image description, as contained in the "<title>" tag, but I can't find where the information is being generated. I assumed it was the pageheader function, but no sign of any code for "meta", "description", "robots" etc. It's not in the theme files, or in the Joomla bridge ones either as far as I can see, so I'm completely stumped.

Any help appreciated.
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47844
  • aka "GauGau"
    • gaugau.de
Re: Where is "meta name="description" ..." generated ?
« Reply #1 on: November 27, 2008, 11:00:23 am »

This thread was moved in error to the bridging sub board. I moved it back. The question is not related to bridging. The meta tags are being composed individually on the coppermine page that calls the pageheader function (as a parameter). To add more meta tags or edit the existing meta tags, edit themes/yourtheme/template.html
Logged

dmb0058

  • Coppermine newbie
  • Offline Offline
  • Posts: 7
Re: Where is "meta name="description" ..." generated ?
« Reply #2 on: November 27, 2008, 11:51:35 am »

Thanks, I've had a look again at that html file. I'm using the water_drop theme, can't see any reference to the description tag.

The code in template.html for the <head> section of the displayed page doesn't contain the meta tags for "robots", "keywords" or "description":

Code: [Select]
...
<head>
<meta http-equiv="Content-Type" content="text/html; charset={CHARSET}" />
<meta http-equiv="Pragma" content="no-cache" />
<title>{TITLE}</title>
{META}
<link rel="stylesheet" href="themes/water_drop/style.css" type="text/css" />
<script type="text/javascript" src="scripts.js"</script>
<!--
    SVN version info:
    Coppermine version: 1.4.19
    $Revision: 4392 $
    $LastChangedBy: gaugau "
    $Date: 2008-04-16 09:25:35 +0200 (Mi, 16 Apr 2008) $
-->
</head>
...

Comparing this to the <head> section actually displayed (see below, sorry for the large post, thought it better not to snip out sections), it's becoming clearer to me that the CPG template.html is being merged into what I imagine is a Joomla "template" or equivalent. I had expected that the Bridge version of functions.inc.php (specifically the pageheader function) would be responsible but it doesn't appear to be so.

Code: [Select]
<head>

  <meta http-equiv="content-type" content="text/html; charset=utf-8" />
  <meta name="robots" content="index, follow" />
  <meta name="keywords" content="space, coins, exonumia, medal, memorabilia, tokens" />
  <meta name="description" content="www.spacecoins.net - coins, medals and other memorabilia of Man's greatest achievement." />
  <meta name="generator" content="Joomla! 1.5 - Open Source Content Management" />

 
  <link href="/templates/ja_purity/favicon.ico" rel="shortcut icon" type="image/x-icon" />
  <script type="text/javascript" src="/media/system/js/mootools.js"></script>


<link rel="stylesheet" href="http://www.spacecoins.net/templates/system/css/system.css" type="text/css" />
<link rel="stylesheet" href="http://www.spacecoins.net/templates/system/css/general.css" type="text/css" />
<link rel="stylesheet" href="http://www.spacecoins.net/templates/ja_purity/css/template.css" type="text/css" />
<meta name="verify-v1" content="YnfNhg8EeWqw0/nLCOlomISCDVJHUj4/zQETfpKKIT0=" />
<script language="javascript" type="text/javascript" src="http://www.spacecoins.net/templates/ja_purity/js/ja.script.js"></script>

<script language="javascript" type="text/javascript">
var rightCollapseDefault='show';
var excludeModules='38';
</script>
<script language="javascript" type="text/javascript" src="http://www.spacecoins.net/templates/ja_purity/js/ja.rightcol.js"></script>

<link rel="stylesheet" href="http://www.spacecoins.net/templates/ja_purity/css/menu.css" type="text/css" />


<link rel="stylesheet" href="http://www.spacecoins.net/templates/ja_purity/styles/background/lighter/style.css" type="text/css" />
<link rel="stylesheet" href="http://www.spacecoins.net/templates/ja_purity/styles/elements/black/style.css" type="text/css" />

<!--[if gte IE 7.0]>
<style type="text/css">
.clearfix {display: inline-block;}
</style>
<![endif]-->

<style type="text/css">
#ja-header,#ja-mainnav,#ja-container,#ja-botsl,#ja-footer {width: 97%;margin: 0 auto;}
#ja-wrapper {min-width: 100%;}
</style>

<!-- +++++++++++++++++++ Script head +++++++++++++++++++ -->

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Pragma" content="no-cache" />
<title>spacecoins.net Photo Gallery - Men in Space Series 2 (Danbury Mint)/First Lunar Exploration (Reverse)</title>

<meta name="keywords" content="kw_Apollo"/><link rel="start" href="displayimage.php?album=17&amp;pos=0" title="Return to start" />
        <link rel="last" href="displayimage.php?album=17&amp;pos=12" title="Skip to end" />
        <link rel="prev" href="displayimage.php?album=17&amp;pos=5" title="See previous file" />
                                <link rel="next" href="displayimage.php?album=17&amp;pos=7" title="See next file"/>
                                <link rel="up" href="thumbnails.php?album=17&amp;page=1" title="Return to the thumbnail page"/>
       
<link rel="stylesheet" href="themes/water_drop/style.css" type="text/css" />
<script type="text/javascript" src="scripts.js"></script>
<!--
  SVN version info:
  Coppermine version: 1.4.19
  $Revision: 4392 $
  $LastChangedBy: gaugau $
  $Date: 2008-04-16 09:25:35 +0200 (Mi, 16 Apr 2008) $
-->

</head>

Logged

dmb0058

  • Coppermine newbie
  • Offline Offline
  • Posts: 7
Re: Where is "meta name="description" ..." generated ?
« Reply #3 on: November 28, 2008, 12:19:15 am »

OK, I sorted this out. It's sort of a bridging issue - Joomla creates the start of the page, then the bridge modifies the html that's already been created, and then it adds on the html generated by CPG.

In case it's of use to anyone else, what I did was to essentially change the bridge code to remove the Joomla-generated <meta name="description" ...> tag, and then as suggested above, modify the Coppermine theme template so that it provides the tag instead.

My fixes:

1. Change bridge/joomla15.integ.php so that the Joomla meta tag is removed:

Code: [Select]
....
 //remove joomla's title will be overridden by script's one
  $finalOutput=preg_replace('#<title([^>]*)>.*?</title>#si','',$finalOutput);

  // Add this line to scrub the <meta name="decscription" ... tag, use the theme/template.html one
  $finalOutput=preg_replace('#<meta([^>]*)name="([^>\"]*)description"([^>]*)>#i','',$finalOutput);

...

2. Add a line into cpg1419/themes/water_drop/template.html:

Code: [Select]
...
<meta http-equiv="Pragma" content="no-cache" />
<!-- Add the next line so that the image title is displayed as metadata -->
<meta name="description" content="{TITLE}" />
<title>{TITLE}</title>
...

With these changes, all non-CPG pages produced by Joomla wil use the Site|Global Configuration|Metadata Settings values for the description meta tag.
...

Logged
Pages: [1]   Go Up
 

Page created in 0.016 seconds with 19 queries.