1
period3
smarty include tag
  • 2005/2/20 21:39

  • period3

  • Just popping in

  • Posts: 2

  • Since: 2004/5/13


Hi,

Does anyone know how to make the <{include}> smarty tag work? My included templates don't get displayed - presumably because XOOPS doesn't compile them.


What I'm trying to accomplish:

I'd like for the look of my blocks to be controlled by the theme, but I'm having problems because XOOPS only has 5 different types of blocks - left, center left, center, center right, and right.

It looks like I'm going to have to settle for moving a lot of the 'look' into the individual block templates. The thing is, a lot of this 'look' is common. I really don't want to have to cut and paste html that is the same between different blocks.

As I see it, I have several alternatives:

- make one block template, with all the stuff that's common. Then define the contents of the block in the PHP 'show_func'. This seems pretty silly - as it completely ruins the logic/presentation seperation.

- cut and paste code between different blocks - seems pretty dumb, but now only the dynamic portions need to be defined in show_func.

- use the smarty <{include}> tag to include the common portions. Not ideal, but better than the first two options. Only problem is that it doesn't seem to work -- XOOPS doesn't compile the templates that are <{include}>ed

2
LazyBadger
Re: smarty include tag

Did you try to see, for example, at default theme?
Column's templates included in theme.html with

<{include file="default/theme_block*.html"}>

3
amayer
Re: smarty include tag
  • 2005/4/10 20:00

  • amayer

  • Friend of XOOPS

  • Posts: 82

  • Since: 2003/10/18


Is there a way for the smarty include to automatically pick up the theme name? For example:

<{include file="<{$xoops_theme}>/theme_blockleft.html"}>


instead of

<{include file="default/theme_blockleft.html"}>


...but the above doesn't work! Any ideas?

Andy

4
LazyBadger
Re: smarty include tag

<{include file="$xoops_theme/name.html"}>

Login

Who's Online

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


Members: 0


Guests: 301


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