Jump to content

How to find template logic for pages?


Goza

Recommended Posts

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. 

Link to comment
Share on other sites

8 minutes ago, opentype said:

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. 

Link to comment
Share on other sites

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. 

Link to comment
Share on other sites

5 minutes ago, opentype said:

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. 

Link to comment
Share on other sites

1 hour ago, opentype said:

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'"}

 

Link to comment
Share on other sites

Archived

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

  • Recently Browsing   0 members

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