Jump to content

How to find template logic for pages?

Featured Replies

Posted

Is there any documentation on template logic which can/cannot be used in pages (manual HTML)? 

  • using {template="userPhoto" app="core" group="global" params="$member->author(), 'tiny', $member->warningRef()"} which automatically throws errors author() 
  • using expressions will also throws errors. 

The only thing I found is using {member="name"} 

It would be nice if we could actually use {template =""} logic in pages. 

  • Community Expert

The template logic is the same everywhere. So you can call the userPhoto template in Pages, but it is up to you to make sure the variables you pass in are valid in the area you are using them. 

  • Author
 

The template logic is the same everywhere. So you can call the userPhoto template in Pages, but it is up to you to make sure the variables you pass in are valid in the area you are using them. 

Then I am really confused about passing variables. I thought I was getting somewhere if I tried {template="userPhoto" app="core" group="global" params="$member->name, 'tiny'"} but now it doesn't show up at all nor throw any errors. 

  • Community Expert

You are not giving any details how and where you are trying this. It’s also unclear what $member should even contain. The author of a record? The logged-in member if there is one? Again: you need to make sure the variable (in this case a member object) is fed into the area you are using it or you need to load it yourself before calling the userPhoto template. 

  • Author
 

You are not giving any details how and where you are trying this. It’s also unclear what $member should even contain. The author of a record? The logged-in member if there is one? Again: you need to make sure the variable (in this case a member object) is fed into the area you are using it or you need to load it yourself before calling the userPhoto template. 

 

I want to show a userPhoto onto a blank (manual HTML) page with no database. 

  • Community Expert

You need to create the member object yourself then. For example:

{{$member = \IPS\Member::load(1);}}

with 1 being the member ID. You can then pass that member object into the userPhoto template. 

  • Author
 

You need to create the member object yourself then. For example:

{{$member = \IPS\Member::load(1);}}

with 1 being the member ID. You can then pass that member object into the userPhoto template. 

Thanks. Going into the right direction however going into a slight dilemma. Probably just don't know what I am doing. 

I got the userPhoto (default) photo to show up but the avatar/interaction isn't coming up. I need to define that as well?

{{$member = \IPS\Member::load( $member->member_id);}}
{template="userPhoto" app="core" group="global" params="$member, 'large'"}

 

Archived

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

Recently Browsing 0

  • No registered users viewing this page.