Editing the keywords metatag with WebYep

General discussions about WebYep
Post Reply
Objective Development
Objective Development
Posts: 815
Joined: Fri Nov 10, 2006 4:39 pm

Editing the keywords metatag with WebYep

Post by johannes » Tue Apr 29, 2008 4:13 pm

In place of the normal metatag, you insert this code snippet:

Code: Select all

<meta name="keywords" content="<?php if (!webyep_bIsEditMode()) webyep_shortText("keywords", false); ?>">

And somewhere in the page you additionally place this:

Code: Select all

<?php if (webyep_bIsEditMode()) { echo "Keywords: "; webyep_shortText("keywords", false); } ?>

This part will only be visible when a user is logged in.

Posts: 8
Joined: Thu Jul 24, 2008 4:45 am
Location: Washington DC

Keywords, addendum

Post by filzfun » Thu Jul 24, 2008 4:55 am

Thanks, johannes, for this insight.

I would just add that you can also use webyep_longText and you can also set the scope to global. In my implementation, I've created a single page for administrative tasks called settings.php that has a place for the user to enter keywords.

On the settings.php page, I have this in the body:

Code: Select all

<div><?php webyep_longText("global-keywords", true, "", false); ?></div>

Then wherever I want those keywords to appear, I add this in the head:

Code: Select all

<meta name="keywords" content="<?php if (!webyep_bIsEditMode()) webyep_longText("global-keywords", true, "", false); ?>">

When you test to see if it is working, make sure you LOG OUT of editing mode. If you don't do this, you won't see your keywords in the page source.

Posts: 13
Joined: Wed Jul 23, 2008 5:22 pm

Post by bumblebee » Fri Aug 01, 2008 6:07 pm

This was really easy to do - all my pages now have keyword and description (just adapt the above code) metatags that can be fully edited through the webyep system!

This gives the user great input and the ability to do seo without having to bother the designer!

Thanks Johannes!

Post Reply