1
ManXP
Vars in templates
  • 2005/3/11 8:02

  • ManXP

  • Quite a regular

  • Posts: 231

  • Since: 2003/8/14


Hello,

I have inserted the following line to one of XOOPS modules (myalbum) templates:

<{assign var="xoops_pagetitle" value=$photo.title}>

But i want title to be expanded not just using var $photo.title, but also it should display some text.

If i write <{assign var="xoops_pagetitle" value=$photo.title} TEXT> - it doesn't work, if i write <{assign var="xoops_pagetitle" value="$photo.title" . "TEXT"}> - doesn't work also.

How could i make this work?

2
Anonymous
Re: Vars in templates
  • 2005/3/11 9:04

  • Anonymous

  • Posts: 0

  • Since:


How about this? Put this into the appropriate script that is used for display:

$xoopsTpl->assign('xoops_pagetitle'"Here goes your additional text - ".$varofthephototitle);

3
ManXP
Re: Vars in templates
  • 2005/3/11 9:46

  • ManXP

  • Quite a regular

  • Posts: 231

  • Since: 2003/8/14


Thanks for fast and prompt reply. The problem is, that myalbum module is very complicated (to make it search engines optimized) and i didn't find any way to make it work by assigning a title on PHP files (i did it with all the other modules i have).

Developer told to make it via templates :(

4
Anonymous
Re: Vars in templates
  • 2005/3/11 11:19

  • Anonymous

  • Posts: 0

  • Since:


Oh boy! I am getting old! I knew there was a solution (used this technique already in an old module of mine)!

You have to use backticks, masking the variables if you want to add text. Look at this example:

<{assign var="xoops_pagetitle" value="`$yourvariable` heregoesyourtext"}>


I hope this is the solution you were looking for?

Nice technique also: You can append any global variable like $xoops_meta_description or others if you mask them with backticks.

5
ManXP
Re: Vars in templates
  • 2005/3/11 14:03

  • ManXP

  • Quite a regular

  • Posts: 231

  • Since: 2003/8/14


That works fine!

Thank you very much.

Login

Who's Online

327 user(s) are online (282 user(s) are browsing Support Forums)


Members: 0


Guests: 327


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