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 [2] 3 4   Go Down

Author Topic: Add Description Meta to Gallery <HEAD> and rel=canonical to META pages  (Read 89759 times)

0 Members and 1 Guest are viewing this topic.

Joe Carver

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 1545
  • aka 'i-imagine'
    • Home Page
Re: Add Description Meta to Gallery <HEAD> and rel=canonical to META pages
« Reply #20 on: August 31, 2010, 01:37:01 am »

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

  • Contributor
  • Coppermine frequent poster
  • ***
  • Country: 00
  • Offline Offline
  • Posts: 333
Re: Add Description Meta to Gallery <HEAD> and rel=canonical to META pages
« Reply #21 on: September 01, 2010, 10:34:13 pm »

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.

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.
Logged

neil fitzgerald

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 26
Re: Add Description Meta to Gallery <HEAD> and rel=canonical to META pages
« Reply #22 on: September 09, 2010, 12:18:12 pm »

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,
Logged

Joe Carver

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 1545
  • aka 'i-imagine'
    • Home Page
Re: Add Description Meta to Gallery <HEAD> and rel=canonical to META pages
« Reply #23 on: September 09, 2010, 11:58:13 pm »

Your site just timed out so a re-check was not possible. However earlier today....
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]
« Last Edit: September 10, 2010, 12:18:24 am by Joe Carver »
Logged

neil fitzgerald

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 26
Re: Add Description Meta to Gallery <HEAD> and rel=canonical to META pages
« Reply #24 on: September 10, 2010, 01:09:50 am »

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.
Logged

Joe Carver

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 1545
  • aka 'i-imagine'
    • Home Page
Re: Add Description Meta to Gallery <HEAD> and rel=canonical to META pages
« Reply #25 on: September 10, 2010, 02:21:12 am »

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.

........ 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

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 26
Re: Add Description Meta to Gallery <HEAD> and rel=canonical to META pages
« Reply #26 on: September 10, 2010, 03:08:57 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.
Quote
Intentionally 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.
Logged

neil fitzgerald

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 26
Re: Add Description Meta to Gallery <HEAD> and rel=canonical to META pages
« Reply #27 on: September 11, 2010, 01:53:41 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:
Code: [Select]
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.
Logged

Joe Carver

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 1545
  • aka 'i-imagine'
    • Home Page
Re: Add Description Meta to Gallery <HEAD> and rel=canonical to META pages
« Reply #28 on: September 11, 2010, 04:32:42 am »

what does this in codebase do:
It returns an empty "" as you have seen.

To quote from the doc.
Quote
The 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.

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.

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

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 26
Re: Add Description Meta to Gallery <HEAD> and rel=canonical to META pages
« Reply #29 on: September 11, 2010, 06:26:02 am »

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.
Logged

Joe Carver

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 1545
  • aka 'i-imagine'
    • Home Page
Re: Add Description Meta to Gallery <HEAD> and rel=canonical to META pages
« Reply #30 on: September 11, 2010, 02:13:14 pm »

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

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 1545
  • aka 'i-imagine'
    • Home Page
Re: Add Description Meta to Gallery <HEAD> and rel=canonical to META pages
« Reply #31 on: September 12, 2010, 01:29:46 pm »

@ 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.

neil fitzgerald

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 26
Re: Add Description Meta to Gallery <HEAD> and rel=canonical to META pages
« Reply #32 on: September 12, 2010, 10:22:36 pm »

On, thank you.
Logged

Joe Carver

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 1545
  • aka 'i-imagine'
    • Home Page
Re: Add Description Meta to Gallery <HEAD> and rel=canonical to META pages
« Reply #33 on: September 13, 2010, 01:57:32 am »

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
« Last Edit: September 13, 2010, 03:55:26 am by Joe Carver »
Logged

neil fitzgerald

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 26
Re: Add Description Meta to Gallery <HEAD> and rel=canonical to META pages
« Reply #34 on: September 13, 2010, 02:18:24 am »

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.
Logged

neil fitzgerald

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 26
Re: Add Description Meta to Gallery <HEAD> and rel=canonical to META pages
« Reply #35 on: September 13, 2010, 02:23:04 am »

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 "
Logged

Joe Carver

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 1545
  • aka 'i-imagine'
    • Home Page
Re: Add Description Meta to Gallery <HEAD> and rel=canonical to META pages
« Reply #36 on: September 13, 2010, 03:19:32 am »

"Undefined index: dbcharset".
That is meaningless in this context so will some other notices that will show from time to time.

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.
« Last Edit: September 13, 2010, 03:54:26 am by Joe Carver »
Logged

neil fitzgerald

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 26
Re: Add Description Meta to Gallery <HEAD> and rel=canonical to META pages
« Reply #37 on: September 13, 2010, 03:36:39 am »

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
« Last Edit: September 15, 2010, 02:11:09 am by Joe Carver »
Logged

Joe Carver

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 1545
  • aka 'i-imagine'
    • Home Page
Re: Add Description Meta to Gallery <HEAD> and rel=canonical to META pages
« Reply #38 on: September 13, 2010, 03:53:34 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
« Last Edit: September 15, 2010, 02:10:30 am by Joe Carver »
Logged

neil fitzgerald

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 26
Re: Add Description Meta to Gallery <HEAD> and rel=canonical to META pages
« Reply #39 on: September 13, 2010, 04:14:22 am »

still truncated mid line 346.
Logged
Pages: 1 [2] 3 4   Go Up
 

Page created in 0.028 seconds with 20 queries.