Join the open source coding forum

Improving meta-tag nodule by custom code

I want to modify the Drupal 7 module meta-tag. Now it works for any content type. The problem is that I have a complexe forum structure at my website. Thats why I would like to create also for the forums a meta-tag description fitting to forum. Now I am not able to do this with the meta-tag module as it only covers content types. So I need to modify the module so that a meta-tag description template will be shown and the names of each forum will be placed in it by code variable. How can this be done. Has anybody an idea?

AndreasOS's picture

The module can do that

Vote the answer: 
3
Average: 3 (1 vote)

There is no need to solve this issue extra by custom code. The module can do this. You need to add a default meta tag. There you need to select the option "Taxonomy term: Forums". There you can add the text you want to display and show the name with a token. The token name will be in this case [term:name]

Oscar's picture

Somehow I can not find it

Vote the answer: 
0
No votes yet

I updated it and all seems to be right. The problem is if I check meta tag description with a browser addon then it still shows the site-wide meta tag for the forums. I checked in the taxonomy manager for the available forums and found that all is correct setup there. I can not find the mistake.

AndreasOS's picture

Yes I checked that

Vote the answer: 
0
No votes yet

I think there is a bug in the module. For taxonomy terms the module does not seem to be working as it should.  You need to fix the module by custom code. I think there is something wrong 

AndreasOS's picture

I tried few patches but it did not work

Vote the answer: 
5
Average: 5 (1 vote)

I tried few patches I found on the internet but they all did not work. Now I used the code export function there and created a code snippet to fix this issue. You can read per PHP the URL and if word forum will be at first position then you execute your custom code. Additional to this you can read the text behind the text forum/ and use it as variable to place in the text. That's quite simple.