1
Mithrandir
Why isn't $smarty.const._SOMETHING work?

I'm trying to use $smarty.const._CONSTNAME in my templates instead of manually assigning smarty variables with constant values.

Shouldn't this work? I tried with $smarty.const. as well as $xoopsTpl.const - but no dice.

Anybody able to help?

2
svaha
Re: Why isn't $smarty.const._SOMETHING work?
  • 2004/1/9 20:55

  • svaha

  • Just can't stay away

  • Posts: 896

  • Since: 2003/8/2 2


Should work according the manual :
Quote:
{$smarty.const}
You can access PHP constant values directly.

Example 4-8. using {$smarty.const}

{$smarty.const._MY_CONST_VAL}




3
Mithrandir
Re: Why isn't $smarty.const._SOMETHING work?

Yeah - and I have had it working in a little system, I made also using SMARTY. I'm wondering if the fact that XOOPS places the templates in the database has anything to do with this... But as I said, it ain't working with neither <{$smarty nor <{$xoopsTpl ($smarty is the smarty object in the smarty documentation, but the smarty object in XOOPS is $xoopsTpl)

4
svaha
Re: Why isn't $smarty.const._SOMETHING work?
  • 2004/1/9 21:30

  • svaha

  • Just can't stay away

  • Posts: 896

  • Since: 2003/8/2 2


Just wondering, is there no method to force this to work, by for instance changing the general preferences setting to (I don't know now how it's called exactly) look for updated html files (templates)? Could this be a way to see it working for one time?

5
zer0fill
Re: Why isn't $smarty.const._SOMETHING work?
  • 2004/1/9 21:36

  • zer0fill

  • Not too shy to talk

  • Posts: 137

  • Since: 2003/12/2


if it's a module, update it so the new templates are added to the database. if you're sure the new templates are being processed, make sure the constants are defined before xoops/smarty is displayed.

6
Mithrandir
Re: Why isn't $smarty.const._SOMETHING work?

templates updated
constants are defined - they work fine if I make a $xoopsTpl->assign('somename', _SOME_CONSTANT);

but I just can't use them directly.

7
skalpa
Re: Why isn't $smarty.const._SOMETHING work?
  • 2004/1/12 8:24

  • skalpa

  • Quite a regular

  • Posts: 300

  • Since: 2003/4/16


Quote:
I'm trying to use $smarty.const._CONSTNAME in my templates instead of manually assigning smarty variables with constant values.



I'm using this at several places, so this should work:
<class='buttHome' href="<{$xoops_url}>/"> <{$smarty.const._YOURHOME}> </a>


I don't know what's happening. What result do you get in the output (nothing, the const name, ...) ?

Skalpa.>

8
Mithrandir
Re: Why isn't $smarty.const._SOMETHING work?

I get no output whatsoever.

Edit: I mean, no output where the constant should be - the rest of the page shows fine.

Login

Who's Online

172 user(s) are online (77 user(s) are browsing Support Forums)


Members: 0


Guests: 172


more...

Donat-O-Meter

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

Latest GitHub Commits