Hi,
Didn't try module yet, but the desciption looks great!
Does it already work with tokens? It will be great if it does, because then variable meta tags can be used, say because of the arguments in the url?
Thanks a lot for building this module, and I will install and test it further.
greetings, Martijn

Comments

ykyuen’s picture

Status: Active » Closed (won't fix)

Hi Martijn,

Thx for your enquiry. Unfortunately, this module does not support token and it is abandoned since most of the features are already included in the Meta Tags module which supports Token.

http://drupal.org/project/metatag

Regards,
Kit

Summit’s picture

Hi,
I came here because of the panels integration. May be you can support that module in panels/views integration? That is not working yet, as I see in the issuelog: http://drupal.org/node/1151938

Thanks for your quick reply.
greetings, Martijn

ykyuen’s picture

I think Beanstag should work well with panel page and view page because it stores all the meta data with path as key. I think it is worth to try.

But probably there would be no Token support in the near future because we want to keep Beanstag as simple as possible and we target for users of simple websites.

Summit’s picture

Hi thanks for your update, without token support this module is to inflexible to use, also for simple usage where you want to inherit some meta tags.
Greetings, Martijn

ykyuen’s picture

Maybe we can discuss in more details about how to make use of Token in BeansTag.

Does it fulfill what you need if you could use token when filling in the Meta Keywords and Meta Description?

Summit’s picture

Hi, Thanks again for your quick reply.
It would fulfill my needs to have token for Title, Meta Keywords and Meta Description

Greetings, Martijn

ykyuen’s picture

Category: support » feature
Status: Closed (won't fix) » Needs work

I will take a look on how to integrate with the Token module and update you as soon as it is done.

ykyuen’s picture

Hi Summit,

i have added the token support. the node, term and site tokens will be available when adding/editing beanstag. but please note that if you used a node token in a non-node page. the token replace will not take action.

checkout the latest code and hope it work for you.

Regards,
Kit

Summit’s picture

Hi, Will test it out. Is it also possible to have the argument token.
So [sitename]/energy the word energy is possible to use als token?
Greetings, Martijn

foopang’s picture

Great work @ykyuen. Thanks for making it work with tokens! I will keep an eye on this issue.

ykyuen’s picture

you can use the [current-page:url:args] to get the current url argument.

Summit’s picture

Hi @ykyuen. You mean if my arguments are /energy/canada . I can get to first argument and second argument using these token arguments: http://drupal.org/node/1265010
So it becomes [current-page:url:unaliased:args:value:0] for energy in my example. And [current-page:url:unaliased:args:value:1] for canada?
greetings, Martijn

ykyuen’s picture

Let me illustrate with an example.

for the node view url of nid = 1 with url alias = one/two/three

[current-page:url:unaliased:args:value:0] => node
[current-page:url:unaliased:args:value:1] => 1
[current-page:url:args:value:1] => two
[current-page:url:args:value:2] => three

Summit’s picture

Hi,
I finally had time to try your module.
1) I got all the time non-responsive error...I can wait, or kill the page
2) Can I use tokens everywhere. Also for the path of the BeansTag?
3) Can I somewhere see all Beanstags I have made?
4) Can I make one BeansTag for all nodes, something like: node/[NID] and term/[TID]?

The non-responsive error is the biggest..I just can't do anything right now when I want to select a token.

greetings,
Martijn

ykyuen’s picture

1) I got all the time non-responsive error...I can wait, or kill the page
I tried a fresh installation and i didn't come across the time out problem. did u try a fresh install or update?

2) Can I use tokens everywhere. Also for the path of the BeansTag?
No, the path is not supported.

3) Can I somewhere see all Beanstags I have made?
You can get the list of all beanstag @ admin/structure/beanstag

4) Can I make one BeansTag for all nodes, something like: node/[NID] and term/[TID]?
No, this is becoz the path is not supported.

One more think i want to mention here is that beanstag depends directly on the url path.
for example, nid = 1 has an url alias = articles/abc

you can create 2 different beanstag
1. node/1
2. articles/abc

The 2 beanstag will take effect on the corresponding path even they are referring to the same content.

PS. i just discover a bug that the current "Update beanstag" shortcut on the toolbar does not work now.
will fix it later.

Kit

Summit’s picture

Hi, Thanks for your quick reply.
A) I need the functionality to be able to also have the path as a variable like node/[nid], because my system builds nodes automatically from feeds. Therefore to give every node meta tags the url-arguments are used to fill up these meta tags.
Without having path supported with tokens. The functionality is less usefull for me, sorry.

B) It is a fresh install of BeansTag in a site with lots of other modules already enabled.
Greetings, Martijn

ykyuen’s picture

Hi, i could not repeat the non-responsive error. but i found that there is a problem in beanstag when working with the admin menu module. please update the beanstag and see if the problem still exists.

about the token support for the path. i need some time to work on it.

Summit’s picture

Hi Yuen Ying,
I am back in town also after the holidays.
Appreciate you take the time to work on the token support for the path. Will look into the other issue on .dev.
Greetings, Martijn

Summit’s picture

Hi,
I installed latest git clone. The problem of timeout seems not happening anymore, so that is great.

When I try to update a page BeansTag, which is a custom panel, the beanstag edit page shows with clicking update BeansTag.
But when I look at the page source, no metatags are added..?

Thanks a lot in advance for looking into this.
Greetings, Martijn

ykyuen’s picture

Hi Summit,

about the custom panel problem, i couldn't repeat it. but i find there is a bug when loading the path alias in the "Update beanstag" form. Assume your drupal website does not have a domain name (ex. http://www.abc.com/drupal)

When you click "Update beanstag" @ http://www.abc.com/drupal/node/1
The path alias will be preset as "drupal/node/1" instead of "node/1". In that case, your saved beanstag will not be shown for http://www.abc.com/drupal/node/1

i have just committed a fix. see if it works now.

And about using token in path alias. i think this feature will not be added. this it conflicts with the beanstag methodology. Since beanstag use the path alias as the key for retrieving the meta data, it has to be UNIQUTE and so token could not be used for path alias. Otherwise, there could be 1 url having 2 beanstag data.

Regards,
Kit

ykyuen’s picture

Status: Needs work » Closed (works as designed)
Summit’s picture

Hi Kit,

Thanks for your update. As for And about using token in path alias this will not be implemented
Do you know another way then that I can make a Beanstag a Meta-tags framework?

On all other fields I can use tokens for getting a variable template which automatically puts the right meta tags to a content-page.
But without path-alias tokenize for the url I do not know how I can use one beanstag for more than one content-page?

Right now I have pages for france, and within France the northern, southern and middle France. The tokens I use show different meta tags for all these pages (more then 400).
It would be great to have a possibility to use the same meta-tags framework (Beanstag page) for all of them. Otherwise I need to make for every node a specific beanstag. That is not what I want, and also from IT-control perspective not the right direction?

Can you help please?

Greetings, Martijn

ykyuen’s picture

Hi Summit,

Actually beanstag stores all the meta information in the "beanstag" table. I would suggest if you could create a custom module which will insert a new beanstag record in that table whenever a new node is saved. In this way, the beanstag methodology is preserved.

Possible features of that custom module.
1. Create a beanstag automatically with fixed meta data when a new node of specific content type is created.
2. Regenerate all beanstags of a specific content type with new meta data inputs.

Do u think this is a good approach?

Kit

Summit’s picture

Hi Tim,

I am not a good enough programmer to get this working, but two things of this approach:
- The only thing what is fixed in my approach is the usage of tokens. Because of this the beanstag itself is very flexible. The token modules takes care of the filling of the tokens, and there fore it can be used as an template for the metatags: title, meta-description, meta-keywords.
Say for instance the token for arguments with an url: /france/paris gives the following through tokens metatags:

- Title Paris - France
- Metatag Description: Paris France
- Metatag Keywords: Paris, France.

If I had a path possibility to fill in also the token arguments or the possibility to set say:

france/paris
france/paris/*

Or

france
france/*

likewise the usage of other drupalise things (as blocks page permissions) then I can work with that.

2) Add weight to the Beanstags.I would like the possibility to have also weight as such that the system looks first to deeper levels (first france/paris and than france) and if that is not found the higher level filling is used.
A page france/bretagne will have the metatags of france unless also a france/bretagne beanstag is made.

Do you understand the functionality I am asking? I do not think this approach is against the philosophy which you are having?

Greetings, Martijn

ykyuen’s picture

See if the following proposal works for you

************************************************************************
1. france/paris/* can be used in beanstag path alias. but it must be end with *, sth like france/*/paris would not work.

2. assume you have the following 3 beanstags
- beanstag A: france/paris/eiffel-tower
- beanstag B: france/paris/*
- beanstag C: france/*

if france/paris/eiffel-tower url is shown, beanstag A will be applied becoz it has the exact match.

if france/paris/palace-of-versailles url is shown, beanstag B will be applied. although beanstag C also match the url, the url pattern is less matched compared to beanstag B.

if france/paris url is shown, beanstag C will be applied since it is the only match.
************************************************************************

For the above approach, i dun think weight is necessary. Does it sound ok for you?

Regards,
Kit

Summit’s picture

Hi Kit, Yes this is exactly what I mean. Only one question if the page france/bretagne is shown, in your example which beanstag will be applied?
greetings, Martijn

ykyuen’s picture

Status: Closed (works as designed) » Needs work

Hi Martijn,

in that case, beanstag C will be shown becoz france/* is the only matched pattern.
i will start working on this new feature and hopefully get it done next week.

Regards,
Kit

ykyuen’s picture

Hi Martijn,

i have committed the code, you can now add beanstag with path alias ended with "/*". ex. france/paris/*
see if this works for you.

Regards,
Kit

ykyuen’s picture

Status: Needs work » Closed (fixed)
divined’s picture

Status: Closed (fixed) » Needs work

Write here:

i have 2000+ nodes with alias like:

site.com/{category}/{title}

and 10000+ subnodes with alias like:

site.com/{category}/{parent title}/{title}
-----

Need two patterns:

category/*
and
category/*/*

ykyuen’s picture

Currently the code for detecting the wild card characters only works for trailing "/*". so it doesn't support path alias with more than one "/*".

for your case, i have no idea on how to implement it. but i wonder if regular expression could help to detect the path. the following part in beanstag.module is the key.

function _beanstag_wild_check($path_alias) {
  $query = 'SELECT * FROM {beanstag} b WHERE b.path_alias LIKE :path_alias';
  $result = db_query($query, array(':path_alias' => '%/*'));

  $matched_chars = 0;
  $matched_beanstag_id = NULL;
  
  foreach ($result as $record) {
    $stored_path_alias = substr($record->path_alias, 0, -1);
    if (strpos($path_alias, $stored_path_alias) !== FALSE) {
      $new_matched_chars = similar_text($path_alias, $stored_path_alias);
      if ($new_matched_chars > $matched_chars) {
        $matched_chars = $new_matched_chars;
        $matched_beanstag_id = $record->id;
      }
    }
  }
  
  return $matched_beanstag_id;
}
ykyuen’s picture

Status: Needs work » Closed (works as designed)