Jump to content

Theme Key


Heosforo

Recommended Posts

Posted

Hello guys.

I'm trying to resolve this from last night and still nothing.

HTML logic

If you need to check the value of a theme setting in an HTML logic tag (for example, to determine whether a block of HTML should be shown or not), a short-hand variable is available to you:

theme.your_theme_key


A real-world example:

{{if theme.forum_layout === 'grid'}}
    ...
{{else}}
	...
{{endif}}

 

I have created a number field and I have this:

{template="userPhoto" group="global" app="core" params="\IPS\Member::load( 1 )"}


How could I show the chosen number?

{template="userPhoto" group="global" app="core" params="\IPS\Member::load( {theme.your_theme_key} )"}
{template="userPhoto" group="global" app="core" params="\IPS\Member::load( {{if theme.your_theme_key}}{{endif}} )"}

It doesn't seem to work, what am I doing wrong?

Thanks for any help. :rofl:

Posted

Try this instead (just thinking):

{{$loadMember = \IPS\Theme::i()->settings['your_setting_key'];}}
{template="userPhoto" group="global" app="core" params="\IPS\Member::load( $loadMember )"}

Haven't tested yet, so please tell me if it works.

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...