1
trabis
Get Metadata in a block- Is it possible?
  • 2008/4/16 22:35

  • trabis

  • Core Developer

  • Posts: 2269

  • Since: 2006/9/1 1


I´m trying to make a module block to display Meta description and keywords so I don´t have to hack the theme.
the problem is that I can´t see how to retrieve this information from the classes.

Is this info availiable before or after the block is rendered?

Smarty can´t help me.
<{$xoops_title}> works fine
<{$xoops_meta_description}> does not.

Thanks

2
giba
Re: Get Metadata in a block- Is it possible?
  • 2008/4/17 0:50

  • giba

  • Just can't stay away

  • Posts: 638

  • Since: 2003/4/26


I am not sure if I understand correctly what you are trying to do, but I think that analyzing this module that can be some light.



XBS MetaTags

[pt-br]
Eu não tenho certeza se entendi corretamente o que você está tentando fazer, mas eu penso que analisando este módulo pode ser que consiga alguma luz.
[/pt-br]

3
trabis
Re: Get Metadata in a block- Is it possible?
  • 2008/4/17 12:30

  • trabis

  • Core Developer

  • Posts: 2269

  • Since: 2006/9/1 1


Hi Giba, I did mean a block, not a module, just for display the meta-keywords so I don´t have to view the source code of the page.

I´ll take a look into that module, thanks!

Pt-
O que eu quero é simplesmente criar um bloco para apresentar os dados META, assim posso ir seguindo as alterações página a página sem ter de editar o código fonte. Poderia simplesmente ecoar as variáveis directamente no tema, mas já agora, como isto é para um módulo que estou a montar para SEO do xoops, um bloco destes ficava bem. Um abraço!

4
stefan88
Re: Get Metadata in a block- Is it possible?
  • 2008/4/17 14:33

  • stefan88

  • Community Support Member

  • Posts: 1086

  • Since: 2004/9/20


Hi,

something like:

global $xoopsDB;
$sql "SELECT conf_value FROM ".$xoopsDB->prefix("config")." WHERE conf_name = "meta_keywords""
$result $xoopsDB->query($sql); 
$keywords $xoopsDB->fetchRow($result);
echo(
$keywords[0]);


..

5
trabis
Re: Get Metadata in a block- Is it possible?
  • 2008/4/17 17:42

  • trabis

  • Core Developer

  • Posts: 2269

  • Since: 2006/9/1 1


Hi Stefan, thank you but I´m not looking for the system keywords, those can be fecth using this:

$xoopsConfigMetaFooter =& $config_handler->getConfigsByCat(XOOPS_CONF_METAFOOTER);
if(isset($xoopsConfigMetaFooter['meta_description'])) {
return $xoopsConfigMetaFooter['meta_description'];
}


What I realy want is to fecth keywords that are assigned by modules:

$xoTheme->addMeta( 'meta', 'description', $meta_description);

Or
$xoopsTpl->assign('xoops_meta_description', $meta_description);

You see? After this assignements can a block get the information? How?

6
damaster
Re: Get Metadata in a block- Is it possible?
  • 2008/4/17 18:40

  • damaster

  • Just can't stay away

  • Posts: 556

  • Since: 2003/5/11


Hi Travis,

Why to reinvent the wheel ^^

There's a module already implementing such features.
Check XC for DBCSS!

[portuguese]

DBCSS permite modificar XOOPS module header de qualquer modulo a partir do tema. Até de incluir um css ou javascript especifico. Assim como determinar keywords, descrição, etc.



"Ensaio sobre a cegueira"
de José Saramago, Premio Nobel de literatura
I like people more than machines or money. But that's me!
Lets do something good and great: Lets do open source!

7
trabis
Re: Get Metadata in a block- Is it possible?
  • 2008/4/17 19:21

  • trabis

  • Core Developer

  • Posts: 2269

  • Since: 2006/9/1 1


Damaster:

I do not want to assign keywords per module nor ride a bike. I just want to know if it is possible to get the current meta_descrition/keywords using a block.

Is a simple question, a hard problem.

This is helpful, for ex the news module assign meta-keywords taken form the text. Well, i want a block to display them. It can help me modifing the algo till I get the best result for automatic keywords.

I just want a block, a blooooock. Can i have a block?

Anyone?

Ps: the SEO module I was talking about is more related to Friendly urls, but it uses theme_changer. I´ll check that module DBCSS to.

8
damaster
Re: Get Metadata in a block- Is it possible?
  • 2008/4/17 19:46

  • damaster

  • Just can't stay away

  • Posts: 556

  • Since: 2003/5/11


So, You don't want to ride a bike, nor walk... do you want me to carry you!?

Or are going to make an effort to learn?
Check the module dbcss and how it overrite :

$xoops_meta_keywords
$xoops_meta_description
$xoops_meta_robots
$xoops_meta_rating

and just print it out

[portuguese]

Aprendre primeiro a caminhar, depois como funciona uma bicicleta
e talvez um dia consigas chegar ao teu destino.
Ah, e meu nome é Nuno e nao Jesus então vê se aprendes
a carregar tua cruz. Quando a frustração é grande, mais
se deve ser perseverante ^^
I like people more than machines or money. But that's me!
Lets do something good and great: Lets do open source!

9
trabis
Re: Get Metadata in a block- Is it possible?
  • 2008/4/17 20:05

  • trabis

  • Core Developer

  • Posts: 2269

  • Since: 2006/9/1 1


I know how to overide meta description Damaster. I don´t know how to get it from a block. Yes, please tell me were I can learn that.

10
trabis
Re: Get Metadata in a block- Is it possible?
  • 2008/4/18 22:13

  • trabis

  • Core Developer

  • Posts: 2269

  • Since: 2006/9/1 1


Let me ask it in other way:
What is loaded first, blocks or modules?

Login

Who's Online

357 user(s) are online (216 user(s) are browsing Support Forums)


Members: 0


Guests: 357


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits