Jul 05, 2009, 08:44 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
Search via SMF or Google: modx forums all of modxcms.com web
  MODxCMS.com   Forums   Help Login Register  
Pages: [1] 2   Go Down
  Print  
Author Topic: How do you get keywords?  (Read 5263 times)
0 Members and 1 Guest are viewing this topic.
steph
Member
**
Posts: 85


WWW
« on: Jan 25, 2006, 05:01 PM »

Hi all.

I was wondering how to get the keywords for a page.

I've tried using a [[GetKeywords]] snippet call, on the off chance that it's some kind of built in snippet (I don't have the snippet in the Manage resources -> Snippets section of the backend). I've tried using [*keywords*], as suggested on a different post, but that doesn't work (I guess because it's not a field in the modx_site_content table).

Looking around the forums it seems that some people are getting a set of metatags automatically set by modx, one of which is the keywords metadata. I am not getting this. I've modified my template from the default, but I've done a comparison with the original and there doesn't seem to be anything missing from the header.

Any ideas anyone?

Steph
Logged

OpenGeek
MODx Co-Founder
Foundation
*
Posts: 5,814


damn accurate caricatures...


WWW
« Reply #1 on: Jan 25, 2006, 05:24 PM »

You need to define your keywords for the site and then assign them to each page, if you want to use the built in keywords system.  These facilities are available under Manage Resources --> META Tags and Keywords, and the META Keywords tab when editing a document, respectively.

Once you select a keyword from a specific document and save, the keyword meta tag will automatically be inserted at the top of the HEAD tag in your document.
Logged

Jason Coward
MODx Co-Founder
xPDO Founder
CTO @ Collabpad
work productively.
work intelligently.
work together.
Light is just a vibration of a note too. Everything is. You've got to keep that in mind.
  Frank Zappa
steph
Member
**
Posts: 85


WWW
« Reply #2 on: Jan 25, 2006, 05:51 PM »

Thanks for your quick reply.

You're absolutely right, it is output properly. God knows why I didn't see that, I've gone code blind!

Is there any way I can retrieve these keywords for use in other parts of the template? I would like to have a list of keywords that is populated from both the built in keywords system and from a template variable. This would allow me to have a set of default keywords supplied by the admin (via the built in keywords system) and also allow users to add their own (via the TV).

I've modified the DropMenu snippet (and other code) to allow it to filter the items, including weblinks, by keywords or by a regexp on a TV. Ultimately I would like to have more control over keywords and bring together the two methods of creating them. I will post my changes when they're complete.

Thanks again.

Steph
Logged

OpenGeek
MODx Co-Founder
Foundation
*
Posts: 5,814


damn accurate caricatures...


WWW
« Reply #3 on: Jan 25, 2006, 09:44 PM »

Is there any way I can retrieve these keywords for use in other parts of the template? I would like to have a list of keywords that is populated from both the built in keywords system and from a template variable. This would allow me to have a set of default keywords supplied by the admin (via the built in keywords system) and also allow users to add their own (via the TV).

$modx->getKeywords() will get you the current document's keywords in an array (or you can specify a document id as a parameter, to get keywords from another document), which you can easily implode().  However, in this case, you can enter a TV tag as a keyword (e.g. [*extra-keywords*]) and it should get processed by the parser. Cool

NOTE: $modx->getKeywords($id) and $modx->getMETATags($id) both need to be added to the API quick reference documentation.  I'll see what I can do.
Logged

Jason Coward
MODx Co-Founder
xPDO Founder
CTO @ Collabpad
work productively.
work intelligently.
work together.
Light is just a vibration of a note too. Everything is. You've got to keep that in mind.
  Frank Zappa
yentsun
MODx Russia
Committed to MODx
*****
Posts: 518



WWW
« Reply #4 on: Apr 21, 2006, 06:39 AM »

I still cannot get this to work. I've added metatags in the Resources section. Chose some in the page edit and no result Sad


SOLVED.
I had my <head> tag in a chunk. Since I get it out and put it into templates - meta tags work!
« Last Edit: Apr 21, 2006, 07:05 AM by yentsun » Logged

http://modx.ru - российская поддержка MODx
http://modxnotes.blogspot.com/ - личный блог по MODx
http://yentsun.com - персональный сайт
doze
Coding Team
*
Posts: 3,662


....Boom!


« Reply #5 on: Apr 21, 2006, 10:45 AM »

NOTE: $modx->getKeywords($id) and $modx->getMETATags($id) both need to be added to the API quick reference documentation.  I'll see what I can do.
And lots of others too... Smiley ..I would like to see a list of all api functions and return types for starters..  Roll Eyes
Logged

New MODx wiki! Please help up with documentation efforts! || Old Wiki
kandyghost
New Member
*
Posts: 2


« Reply #6 on: May 25, 2006, 10:21 PM »

Could I set keywords base on page title automatically??
How to do ?
Logged
OpenGeek
MODx Co-Founder
Foundation
*
Posts: 5,814


damn accurate caricatures...


WWW
« Reply #7 on: May 25, 2006, 10:45 PM »

Could I set keywords base on page title automatically??
How to do ?

Very simply add this to the head of your template...
Code:
<meta name="keywords" content="[*pagetitle*]" />
...and that will work with any modx tag...I often do...
Code:
<meta name="description" content="[*introtext*]" />
Logged

Jason Coward
MODx Co-Founder
xPDO Founder
CTO @ Collabpad
work productively.
work intelligently.
work together.
Light is just a vibration of a note too. Everything is. You've got to keep that in mind.
  Frank Zappa
bugsmi0
Sr. Member
****
Posts: 356


« Reply #8 on: Jul 21, 2006, 12:59 PM »

Is there a difference between these two ?

<meta http-equiv="keywords" content=
<meta name="keywords" content=

the first one is generated when adding the keyword to doc,

do we need both ?

also are the keywords in the list words we should already have inside the doc or does it matter since they will be in the meta
Logged

OpenGeek
MODx Co-Founder
Foundation
*
Posts: 5,814


damn accurate caricatures...


WWW
« Reply #9 on: Jul 22, 2006, 10:53 AM »

Is there a difference between these two ?

<meta http-equiv="keywords" content=
<meta name="keywords" content=

the first one is generated when adding the keyword to doc,

do we need both ?

also are the keywords in the list words we should already have inside the doc or does it matter since they will be in the meta
You have an outdated 0.9.1 or earlier MODx install that needs to be upgraded.  This bug was addressed in 0.9.2+ -- see http://modxcms.com/bugs/task/292
Logged

Jason Coward
MODx Co-Founder
xPDO Founder
CTO @ Collabpad
work productively.
work intelligently.
work together.
Light is just a vibration of a note too. Everything is. You've got to keep that in mind.
  Frank Zappa
bugsmi0
Sr. Member
****
Posts: 356


« Reply #10 on: Jul 25, 2006, 01:34 AM »

I have the lastest Modx Install 0.9.2, are you saying this should not happen in the latest releast ?

well I've had the latest release for awhile now and it happens as described
Logged

steph
Member
**
Posts: 85


WWW
« Reply #11 on: Jul 25, 2006, 02:33 AM »

From the HTML 4 spec: http://www.w3.org/TR/html4/struct/global.html#h-7.4.4.2

I'd use both, because both are valid you can't be sure which one (or both) will be used by search engines, browsers, etc.


Logged

Vitalized
Full Member
***
Posts: 137


"Teach a man to phish"


WWW
« Reply #12 on: Aug 07, 2006, 07:04 AM »

I have an idea but I don't know enough PHP to implement it!
Can someone mod the TagCloud 1.1 script to be page spaciffic and output Meta keywords/phrases automatically?

Just an idea!
Logged

Web Development, Web Hosting & Search Engine Marketing by:

Vitalized | UK
t. +44 (0) 208 123 0708
w. www.vitalized.co.uk

Website Design | Search Engine Marketing (SEM) | UK MODx web hosting, secure, fast & 100% MODx compatible

Vitalized | Australia
t. +61 (0) 2 8011 3095
w. www.vitalized-australia.com.au

Website Design | Search Engine Marketing (SEM) | Australian MODx web hosting, secure, fast & 100% MODx compatible
rthrash
Foundation
*
Posts: 10,471



WWW
« Reply #13 on: Aug 11, 2006, 01:16 PM »

Is there a difference between these two ?

<meta http-equiv="keywords" content=
<meta name="keywords" content=

the first one is generated when adding the keyword to doc,

do we need both ?

also are the keywords in the list words we should already have inside the doc or does it matter since they will be in the meta

Actually, I think that keywords should only be under the "name" category. I've updated the handling of keywords for the next release. You can find  it in the SVN trunk, and it includes a reference link to a website discussing headers and appropriate values.
Logged

MODx is a framework that allows web professionals to turn over sites to end-users for daily maintenance without worrying. Community participation and questions are encouraged, especially when you help us help you, read the wiki, and review snippet parameters – even if you have to look at the source. Searching the forums helps, too.
Ryan Thrash
MODx Co-Founder
Principal @ Collabpad
work productively.
work intelligently.
work together.
silent
Full Member
***
Posts: 186



« Reply #14 on: Aug 17, 2006, 07:24 AM »

I recently created a Snippet "PageKeywords", based on Tagcloud, which retrieves keywords from the doc's content by matching it against a general word list.
See: http://modxcms.com/forums/index.php/topic,6426.msg45904.html#msg45904
Logged
Pages: [1] 2   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP

Copyright © 2005-2008 MODxCMS, All rights reserved. Contact Us
Styles by ziworks.com

Powered by SMF | SMF © 2006-2008, Simple Machines LLC

Valid XHTML 1.0! Valid CSS!