11
Catzwolf
Re: Get Metadata in a block- Is it possible?
  • 2008/4/18 22:25

  • Catzwolf

  • Home away from home

  • Posts: 1392

  • Since: 2007/9/30


Quote:

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


I can answer this question very simply. Modules are loaded first via XOOPS_ROOT_PATH.'/include/common.php' (Should be right at the end)

Then the block data comes right after that. Look in XOOPS_ROOT_PATH.'/header.php' and this is dones via the 'theme' class (Look in the class folder).

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

  • trabis

  • Core Developer

  • Posts: 2269

  • Since: 2006/9/1 1


So the block is loaded on the header and this way it cannot fecth the meta-keywords that are assigned latter by the module.

Thank you catz!!

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

  • Catzwolf

  • Home away from home

  • Posts: 1392

  • Since: 2007/9/30


Ok to answer your first question. If I have this right:

Basically you want to take information from a module, using a block (as the hook) and have this displayed in the theme?

In theory yes it can be done and here is how (untested)

1. Get the sql statement to pull out the information that you require.

Then use the following line to add the information to the tempate metatag.

$GLOBALS['xoTheme']->addMeta( 'meta', 'keywords', $keywordvalues );

Hopefully 'xoTheme' will be in the global scope and usable at that time.

Try that and see if it works :)

Catz

14
Catzwolf
Re: Get Metadata in a block- Is it possible?
  • 2008/4/18 22:47

  • Catzwolf

  • Home away from home

  • Posts: 1392

  • Since: 2007/9/30


ok, to let you understand the workings of XOOPS with this.

All the information from modules and block are processed and then rendered all at once. If you look in the header.php and class/theme.php and class/theme.blocks.php you will have all the information on how this process works.

But it should be easy (maybe have to tweak a few thinks) to get this to work the way you want it.

15
giba
Re: Get Metadata in a block- Is it possible?
  • 2008/4/18 22:47

  • giba

  • Just can't stay away

  • Posts: 638

  • Since: 2003/4/26


Hi Trabis,

Try Debug Sarado by topet05.


I think you will find all the variables that need and can help you. This script is only for use on your local test in development.

[pt-br]
Eu penso que irá encontrar todas as variáveis que necessita e pode ajuda-lo. Este script é somente para usar em seu local de teste no desenvolvimento.
[/pt-br]

16
giba
Re: Get Metadata in a block- Is it possible?
  • 2008/4/18 22:48

  • giba

  • Just can't stay away

  • Posts: 638

  • Since: 2003/4/26


Oops, sorry Catz, not look you reply before. !

This information by catz is correct $ GLOBALS

This script is one debug about $ GLOBALS xoops.

17
Catzwolf
Re: Get Metadata in a block- Is it possible?
  • 2008/4/18 22:50

  • Catzwolf

  • Home away from home

  • Posts: 1392

  • Since: 2007/9/30


lol, is ok buddy :)

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

  • trabis

  • Core Developer

  • Posts: 2269

  • Since: 2006/9/1 1


Thanks again both of you! The problem is that the block should get info from any module, any page. I cannot make changes in modules, I have to find another way. Maybe javascript to get the info after the page is rendered.

19
giba
Re: Get Metadata in a block- Is it possible?
  • 2008/4/18 22:58

  • giba

  • Just can't stay away

  • Posts: 638

  • Since: 2003/4/26


I recommend this script look, I believe that you will find what is searching now.


Let me know.

[pt-br]
Eu recomendo olhar este script, acredito que irá encontar o que está procurando agora.

deixe-me saber.
[/pt-br]

20
Catzwolf
Re: Get Metadata in a block- Is it possible?
  • 2008/4/18 23:02

  • Catzwolf

  • Home away from home

  • Posts: 1392

  • Since: 2007/9/30


Wait, so you actually want to display/show the 'meta tags' in a block?

Login

Who's Online

318 user(s) are online (223 user(s) are browsing Support Forums)


Members: 0


Guests: 318


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