add keywords and description fields to the metadata tab of the page editor

Feed 15 posts, 7 voices

Dec 18, 2007 16:15
Avatar
14 posts

It would be great to be able to add page specific keyword and description fields to the metadata tab! I realize this could be done by using a page section; however, it is legitimate metadata and adding it to the approrpiate tab would be more user friendly.

 
Dec 22, 2007 21:47
Avatar
56 posts

I agree a description field would be nice. (It could appear underneath the page name in the admin UI, in a smaller font?)

As for the keywords, I've been using the Tags feature for that...

 
Jun 5, 2008 20:52
Avatar
9 posts

Is there a possibility of this function being added to frog in the future? I certainly agree that it would be a useful one.

 
Jun 6, 2008 03:13
Avatar
276 posts

I'll try to do a little tweak, to see if I can add them to the meta content tab.

 
Jun 18, 2008 02:32
Avatar
9 posts

Have you had a chanced to look at this Bdesign? I was thinking it might actually work better as a plugin...

 
Jun 18, 2008 03:37
Avatar
820 posts

It is already implemented in 0.9.3 - when you are editing a page, the tab beside the Page Title tab is called Metadata. You click on that, and you get:

  • Slug
  • Breadcrumb
  • Keywords
  • Description
  • Tags
  • Created and Published dates

The first two don't normally need changing, but the next two are the ones we want!

What I am NOT sure about, is how to call them in the frontend. Neither $this->description nor $this->$description() or any variants seem to work. I don't think there is a function set up in frog/app/frontend/classes/page.php, and I don't know how to go about it....

Philippe...?? ;)

 
Jun 18, 2008 03:48
Avatar
820 posts

Actually, I just "hacked" my frog/app/frontend/classes/page.php and it works a treat! :) Looks like I learned something!

 
Jun 18, 2008 04:44
Avatar
820 posts

P.s. I'm away for a few days -- will see about getting this committed to SVN on my return. Byeee!

 
Jun 20, 2008 17:16
Avatar
820 posts

Right, I'm back and this isn't in SVN. BUT -- you can grab the new, hacked file, and get the instructions for using "per-page" metadata at my TestFrog site. I can't link the file to download from here, so you would have to pay a visit to that page, anyway!

If it works OK, I'll check in with Philippe and see about getting this added to SVN.

 
Jun 23, 2008 15:00
Avatar
382 posts

fixed: $this->description() and $this->keywords() should work now with the last svn revision

 
Jun 23, 2008 15:09
Avatar
820 posts

Yes! Thank you, Philippe.

 
Jul 1, 2008 22:11
Avatar
77 posts

How do I get the slug for a page? Will $this->slug() work?

 
Jul 1, 2008 22:36
Avatar
77 posts

I guess this->slug doesn't work to get the page slug. I tried using <?php if ($this->description() != '') { echo $this->description(); }

and received the following error message:

Parse error: syntax error, unexpected '&' in mypath/frog/app/frontend/classes/Page.php(174) : eval()'d code on line 40$this->slug()

 
Jul 1, 2008 22:39
Avatar
77 posts

Yikes! I entered the wrong code. What I meant to write above for the code segment was:

<?php if ($this->slug() != '') { echo $this->slug(); } ?>
 
Jul 2, 2008 04:11
Avatar
820 posts

Maybe the problem was a missing endif? But check your email! :)

 
Jul 3, 2008 17:26
Avatar
77 posts

Yes, it was the missing endif. Thanks for the sharp eyes David!

Here's the code that works, for others who might be interested in using the page slug: <?php if ($this->slug() != '') { echo $this->slug(); } endif; ?>