Add Description Meta to Gallery <HEAD> and rel=canonical to META pages - Page 2 Add Description Meta to Gallery <HEAD> and rel=canonical to META pages - Page 2
 

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]

Main Menu

Add Description Meta to Gallery <HEAD> and rel=canonical to META pages

Started by Joe Carver, April 19, 2010, 07:16:45 PM

Previous topic - Next topic

0 Members and 3 Guests are viewing this topic.

Joe Carver

Quote from: papukaija on August 28, 2010, 10:23:15 PM
I can add that code to my plugin
That would be the best course of action. This plugin would need to have that add-on as a config. option. Some users would not want it. Adding the config, lang. and db changes adds a bit of work and time that I don't have at the moment.

It probably belongs more in the the Facebook plugin too, instead of this one.

If you get really stuck and can't make something that works I can probably post a mod.

papukaija

Quote from: Joe Carver on August 31, 2010, 01:37:01 AM
It probably belongs more in the the Facebook plugin too, instead of this one.
That's what I thought but I wanted to be sure that we aren't both working on this.

Quote from: Joe Carver on August 31, 2010, 01:37:01 AM
If you get really stuck and can't make something that works I can probably post a mod.
I didn't get really stuck but however I have a small issue with it.

neil fitzgerald

I just installed v1.5 and, although it works as hoped for albums, I get empty meta description tags on category pages.
Albums is better than nothing, thanks, but fixing categories too would be even better.

(e.g. http://www.neilfitzgeraldphoto.co.nz/gallery/index-17.html)

Thanks,

Joe Carver

Your site just timed out so a re-check was not possible. However earlier today....
Quote from: neil fitzgerald on September 09, 2010, 12:18:12 PM
I get empty meta description tags on category pages
Your site returned this:
Quote<meta name="description" content="" />

Which showed the plugin is working and...you have no content in the field "Category description" in catmgr.php.

It might be an effect from your SEF urls plugin, something I can not fully test, but doubt is the case.

[edit] Your site went back up, (still slow though) there appeared to be no descriptions visible in your category pages either [/edit]

neil fitzgerald

Thanks Joe, but the problem is that I do have content in the Category Description fireld in Cat manager, and, even if I didn't would it not default to the category title?
Yes, I thought SEF urls might be part of it, but since it works for Albums I hoped not.
Sounds like my host needs a kicking... then I'll try turning SEF urls off.

Joe Carver

Quote from: Joe Carver on September 09, 2010, 11:58:13 PM
there appeared to be no descriptions visible in your category pages either

This still seems to be the case, but from here your site keeps timing out. Your category pages have no visible text for the category except for the title. If the Category description text does not show up in the cpg page then perhaps your theme is interfering.

Quote from: neil fitzgerald on September 10, 2010, 01:09:50 AM
........ would it not default to the category title?
Intentionally not - exact duplicate content is something I wanted to avoid when I wrote this plugin.

neil fitzgerald

Quote from: Joe Carver on September 10, 2010, 02:21:12 AM
This still seems to be the case, but from here your site keeps timing out. Your category pages have no visible text for the category except for the title. If the Category description text does not show up in the cpg page then perhaps your theme is interfering.
Yes, I don't have the cat description in my theme. So, I guess I need to dig into my theme to resolve this.
QuoteIntentionally not - exact duplicate content is something I wanted to avoid when I wrote this plugin.
Right, I misunderstood the docs.

Server has apparently had a hardware infarction...
Thanks for the nice plugin and help.
Neil.

neil fitzgerald

Quote from: Joe Carver on September 10, 2010, 02:21:12 AM
Intentionally not - exact duplicate content is something I wanted to avoid when I wrote this plugin.
We may be misunderstanding each other. If the category title is not a fall back if there is no category description, what does this in codebase do:
else  {
            $new_meta = <<< EOT
<meta name="description" content="$this_title" />


I ran through all the basic themes and none produce a meta description, using category title or description, on any category pages. Could this be because none of them actually show a category description for the current category, only with the thumbnails of child categories? Anyway, if it doesn't work for the standard themes it has me thinking there is something else involved.
I can point you to my test site off the board if you like.

Joe Carver

Quote from: neil fitzgerald on September 11, 2010, 01:53:41 AM
what does this in codebase do:
It returns an empty "" as you have seen.

To quote from the doc.
QuoteThe plugin will be most effective when you add descriptions to your content and pages.

I suppose I could change it to return nothing at all. A default/configurable/single description would not make sense. It would be repetitive for the categories where the user doesn't take the time to fill in some content for the category. Maybe I'll take a look for the next release.

Quote from: neil fitzgerald on September 11, 2010, 01:53:41 AM
if it doesn't work for the standard themes
Does for me. I have now just uploaded all of the cpg 1.5.8 themes to my test/demo gallery. Curve is slightly modified, the others are straight from the download. On cat. pages with a description you get a description meta when you go to the category. It matches what the description was on the previous page. On categories with no description there is no meta. On a second cpg 1.5.8 gallery I have tried this going three deep into subcategories - it works there too.

Quote from: neil fitzgerald on September 11, 2010, 01:53:41 AM
I can point you to my test site off the board if you like.
It doesn't work like that here. The moderators of this forum want a link to be publicly posted with help requests. Keep that in mind for the future.
For the moment here is the link to my test gallery where the plugin works with all of the themes I have tried.
http://photos-by.joe-carver.com/index.php

neil fitzgerald

Ok, I set up a clean new install, cpg158 (new download, new DB), and 1.4 of this plugin.
(http://www.alpha.neilfitzgeraldphoto.co.nz/cpg15x/)
Albums work fine (as for my working site) but categories only give whatever is entered into the plugin config, including "" if it is left blank.
???

Please excuse my ignorance, but this does help me learn; could you not just omit $this_title from the code I copied above and have content="" if all you want is an empty ""?

Thanks for your help.

Joe Carver

Sorry, I can not reproduce the problem. I have just removed 13 plugins from my second test gallery to confirm that it works ok - it did. If I find something in the future I will post a solution. Perhaps someone else can shed some light on it too.

Maybe the copy of the plugin you have downloaded is corrupted.

You can always modify the code to suit your wishes - it is open source.

Joe Carver

@ neil fitzgerald,

If you can, please turn on debug and show notices to everyone in your test gallery. I will tale a look over the next day to see if it shows anything helpful as to why this works differently for you.


Joe Carver

Do you have notices turned on?    Config  >> Maintenance settings  >> Display notices in debug mode

It might be how $cat is being read or not.

Since I don't see the same issue you will have to test if this fixes it for you. It works fine without noticeable change on my test gallery.

Download the text file, rename it to codebase.php and upload it to - plugins/description_metas/.

[edit] delete attachment

neil fitzgerald

Sorry, I turned on debug for everyone but not notices. Have done that now and it's telling me "Undefined index: dbcharset".
Will try the new file, thanks.

neil fitzgerald

Well, that codebase file killed it completely. Reverting now.
"Warning: Unexpected character in input: ''' (ASCII=39) state=1 in /hsphere/local/home/neilfitz/alpha.neilfitzgeraldphoto.co.nz/cpg15x/plugins/description_metas/codebase.php on line 340 Parse error: syntax error, unexpected $end, expecting ']' in /hsphere/local/home/neilfitz/alpha.neilfitzgeraldphoto.co.nz/cpg15x/plugins/description_metas/codebase.php on line 340 "

Joe Carver

Quote from: neil fitzgerald on September 13, 2010, 02:18:24 AM
"Undefined index: dbcharset".
That is meaningless in this context so will some other notices that will show from time to time.

Quote from: neil fitzgerald on September 13, 2010, 02:23:04 AM
Well, that codebase file killed it completely. Reverting now.

I found one error, although it should have not have quit so rudely....

Try this, try to make sure the file remains as UTF-8 without B.O.M. .

[edit] deleted attachment

If it doesn't work then I will take another look later on in a day or do.

neil fitzgerald

Your files were missing the last few lines. Added from original codebase (as attached) and we now have some progress. Categories now have the category title in meta description, but still no category description.
Appreciate your time on this.



[edit] file removed - Joe Carver

Joe Carver

Quote from: neil fitzgerald on September 13, 2010, 03:36:39 AM
Your files were missing the last few lines.
Strange, I don't understand where that came from - they will all be deleted in two seconds.

Try this, otherwise I have to give it a rest.
[edit] file removed - Joe Carver