FORUMS CLOSED DUE TO SPAM. YOU STILL CAN ADD POST!

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

Feed 15 posts, 7 voices

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.

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

 
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.

 
Avatar
343 posts

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

 
Avatar
9 posts

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

 
Avatar
1493 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...?? ;)

 
Avatar
1493 posts

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

 
Avatar
1493 posts

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

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

 
Avatar
541 posts

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

 
Avatar
1493 posts

Yes! Thank you, Philippe.

 
Avatar
191 posts

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

 
Avatar
191 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()

 
Avatar
191 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(); } ?>
 
Avatar
1493 posts

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

 
Avatar
191 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; ?>