Welcome to Geeklog, Anonymous Monday, December 23 2024 @ 02:05 pm EST

Geeklog Forums

PHP in article.thtml


Status: offline

Pushkar

Forum User
Regular Poster
Registered: 04/14/09
Posts: 99
Location:Ukraine, Kyiv
Hi! Please tell me what I need to do, that PHP-code will working in article.thtml?
Thanks
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
You can't. PHP is only interpreted in header.thtml, not in any other template file.

You can, however, use CUSTOM_templateSetVars (sample code in system/lib-custom.php) to define your own {variables} to use in the story templates.

bye, Dirk
 Quote

Status: offline

Pushkar

Forum User
Regular Poster
Registered: 04/14/09
Posts: 99
Location:Ukraine, Kyiv
Quote by: Dirk

You can't. PHP is only interpreted in header.thtml, not in any other template file.



strange, but I've got to make so that the code works in footer.thtml (changes in libcommon)

ok another question: I insert php-code in staticpage and it's works. could i used and showing this staticpage in block (left or right)?

thanks
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
Quote by: Pushkar

strange, but I've got to make so that the code works in footer.thtml (changes in libcommon)


What I wrote above also works for defining your own variables in footer.thtml. You should avoid changing Geeklog's core code.


Quote by: Pushkar

ok another question: I insert php-code in staticpage and it's works. could i used and showing this staticpage in block (left or right)?


Nope, but you can create a PHP block.

bye, Dirk
 Quote

Status: offline

::Ben

Forum User
Full Member
Registered: 01/14/05
Posts: 1569
Location:la rochelle, France
Hello,

ok another question: I insert php-code in staticpage and it's works. could i used and showing this staticpage in block (left or right)?


Yes we can use an autotag in a block.

Text Formatted Code

[staticpage_content:your_page_id]


and your dynamic content from 'your_page_id' page is in the block.

::Ben
I'm available to customise your themes or plugins for your Geeklog CMS
 Quote

All times are EST. The time is now 02:05 pm.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content