We make tools that make websites.

Forums (Archived)

The Solspace Support Forums are now CLOSED (read-only)

Check out our new support options here. Please refer to this blog post for more information.

   

PHP in Template Morsels?

Rank

Total Posts: 22

Joined: Jun 9, 2009

PM

Ignore

 

I would like to be able to run php in a template morsel. Is this possible?

Avatar
RankRankRank

Total Posts: 975

Joined: Oct 27, 2009

PM

Ignore

 

Good morning!

Someone will help you with this on Monday. It could be this weekend, but let’s shoot for Monday. smile

Avatar
RankRankRankRankRank

Total Posts: 13708

Joined: Oct 18, 2006

PM

Ignore

 

Hi Anthony,

This currently isn’t possible yet… sorry.
We have plans to add this in the future though smile

Signature

Rank

Total Posts: 14

Joined: Feb 13, 2009

PM

Ignore

 

run php in a template morsel

I second this request! smile

Avatar
RankRankRank

Total Posts: 218

Joined: Jul 16, 2006

PM

Ignore

 

Also seconded. Thanks Kelsey.

Avatar
RankRankRank

Total Posts: 152

Joined: Oct 22, 2007

PM

Ignore

 

I’m guessing this still isn’t available, right? Any plans? This thread is from 2010 so it’s been some while (he says, quietly hoping).

Avatar
RankRankRankRankRank

Total Posts: 9901

Joined: Jan 8, 2009

PM

Ignore

 

Hi Jim,

Did a quick test by echoing text through PHP, and nothing renders in the morsel. I made a note of this feature request, though smile

Signature

Avatar
RankRankRank

Total Posts: 152

Joined: Oct 22, 2007

PM

Ignore

 

Thanks Nicolas - you did the same as me by the look of it. Am actually struggling to see where I can use Template Morsels for the site I just bought it for. Nearly all of my code includes at least a bit of php here and there…

Avatar
RankRankRankRankRank

Total Posts: 9901

Joined: Jan 8, 2009

PM

Ignore

 

Maybe look into making some of that PHP code into a plugin? There are a few blog posts on the net discussing this approach. Also, there might already be a third-party add-on that can replace your PHP code. The EE forums might also have ideas and suggestions in some cases. It really depends on your PHP code I guess, though smile

Signature

Avatar
RankRankRank

Total Posts: 152

Joined: Oct 22, 2007

PM

Ignore

 

Thanks Nicolas. If the worst comes to the worst I can always use Template Morsels on another site instead grin

RankRankRank

Total Posts: 152

Joined: Mar 9, 2010

PM

Ignore

 

Just going to pop in here for a moment as this is on our list of feature requests we are evaluating for the next release.  You can still put PHP into an Embedded template that is then inside the Template Morsel.  Also, we are putting in a new {exp:template_morsels:escape} tag, which will allow escaped content in the morsel that can then be processed by the Template parser.  PHP on Output would work in this case.

Signature