21
trabis
Re: Get Metadata in a block- Is it possible?
  • 2008/4/18 23:04

  • trabis

  • Core Developer

  • Posts: 2269

  • Since: 2006/9/1 1


Eu li o script, não o corri, mas talvez ele me possa dizer quais as variáveis que estão disponiveis na altura em que o bloco corre, obrigado!
<table>
    <
tr>
      <
td>Title - <{$xoops_pagetitle}></td>
    </
tr>
    <
tr>
      <
td>Description - <{$xoops_meta_description}></td>
    </
tr>
    <
tr>
      <
td>Keywords - <{$xoops_meta_keywords}></td>
    </
tr>
</
table>


I have a block with no function, just that html/smarty code code.
$xoops_pagetitle works fine, $xoops_meta_keywords does not.

So I thought that I could use some method in the block function and then assign it to the block, but I cannot find a method in the XOOPS classes to get this smarty info.

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

  • Catzwolf

  • Home away from home

  • Posts: 1392

  • Since: 2007/9/30


Okies, let me have a look at this, will come back to you with an answer shortly :)

23
Alex_Grey
Re: Get Metadata in a block- Is it possible?
  • 2008/4/19 16:01

  • Alex_Grey

  • Just popping in

  • Posts: 43

  • Since: 2007/6/16


i've tried retrieving the metas array in the xoTheme object. but the keywords are from before they are modified by a module or page. so i am now checking on how XOOPS renders the page. it's possibly blocks first and then modules.

so blocks get created in header.php and the $xoTheme object.. if there was a way to load the keywords from the modules, up there in header.php then it should work.
“There is nothing impossible to him who will try.” ~Alex The Great~
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯

24
trabis
Re: Get Metadata in a block- Is it possible?
  • 2008/4/20 3:38

  • trabis

  • Core Developer

  • Posts: 2269

  • Since: 2006/9/1 1


Yes Alex, maybe we could overwrite the block in header after the module assign the keywords. I would prefer not hacking the header of corse...

Well, this is not very important, it just bugs me!!! I wonder were are the core coders? Hello?

25
phppp
Re: Get Metadata in a block- Is it possible?
  • 2008/4/20 6:06

  • phppp

  • XOOPS Contributor

  • Posts: 2857

  • Since: 2004/1/25


Try following code from 2.3:
<{php}>
echo 
"
<table>
    <tr>
      <td>Title - "
;
echo 
$GLOBALS['xoTheme']->template->_tpl_vars['xoops_pagetitle'];
echo 
"
</td>
    </tr>
    <tr>
      <td>Description - "
;
echo 
$GLOBALS['xoTheme']->template->_tpl_vars['xoops_meta_description'];
echo 
"</td>
    </tr>
    <tr>
      <td>Keywords - "
;
echo 
$GLOBALS['xoTheme']->template->_tpl_vars['xoops_meta_keywords'];
echo 
"</td>
    </tr>
</table>
"
;
<{/
php}>

26
Catzwolf
Re: Get Metadata in a block- Is it possible?
  • 2008/4/20 6:29

  • Catzwolf

  • Home away from home

  • Posts: 1392

  • Since: 2007/9/30


That is what I thought as well, but in somecases it will not work if the module uses the smarty template method of adding these items.

I think the only way you will truly get the infomation will be either by complaicated javascript to get the smarty vars. or by placing a false block' with the infomation you supplied above into your theme.

Catz

27
giba
Re: Get Metadata in a block- Is it possible?
  • 2008/4/27 10:36

  • giba

  • Just can't stay away

  • Posts: 638

  • Since: 2003/4/26


preload is the solution. Changing the theme is not a good solution.
There are many ways to break eggs, this is one of them.

28
techdb
Re: Get Metadata in a block- Is it possible?
  • 2008/5/2 14:04

  • techdb

  • Just popping in

  • Posts: 23

  • Since: 2005/3/7 1


Has anyone managed to get DBCSS working correctly with 2.0.18.1?

Read Me file is not in english

I already have a bunch of GI Joe's stuff running (i.e. xoops/trust/path/ protector, altsys, etc) It installs and seems to run (no errors on debug) just fine but when I check my source on pages I get:


<link rel="stylesheet" type="text/css" media="all" href="http://www (dot)laparoscopic (dot) md/common/css/common.css" />

<link rel="stylesheet" type="text/css" media="all" href="http://www (dot) laparoscopic (dot) md/modules/dbcss/index.php?css=common.css" />


<meta http-equiv="Content-Script-Type" content="text/javascript" />
<meta http-equiv="Content-Style-Type" content="text/css" />

Looks like it is there but when I check the source meta name="description" the same metadata generated from XOOPS core.

Ideas?





Apache/1.3.37 (Unix) mod_throttle/3.1.2 DAV/1.0.3 mod_fastcgi/2.4.2 mod_gzip/1.3.26.1a PHP/4.4.8 mod_ssl/2.8.22 OpenSSL/0.9.7e

PHP version 5.2.3
MySql version 5.0.24a-standard-log

Login

Who's Online

234 user(s) are online (150 user(s) are browsing Support Forums)


Members: 0


Guests: 234


more...

Donat-O-Meter

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

Latest GitHub Commits