images in pattemplate

A general technical discussion area for patTemplate.
Locked
PetrSnobelt
Joomla! Apprentice
Joomla! Apprentice
Posts: 8
Joined: Thu May 17, 2007 7:18 am

images in pattemplate

Post by PetrSnobelt » Wed Jun 06, 2007 10:14 am

Hallo,
I need to show first image (from images column in sql) in my pattemplate, but I don't know how.
I don't know how get only first image name - in php something like this - strtok($row->images,"|\r\n").

Is this posible with pattemplates ?

Thank you

dynedain
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 200
Joined: Wed Aug 24, 2005 7:20 pm
Location: Los Angeles
Contact:

Re: images in pattemplate

Post by dynedain » Wed Jun 06, 2007 5:52 pm

I think you're going to want to do it in PHP with something like strtok() or explode() before passing it to patTemplate

Look in the com_content component to see how image lists are parsed. I believe they're separated by line returns \r\n but I could be wrong.

PetrSnobelt
Joomla! Apprentice
Joomla! Apprentice
Posts: 8
Joined: Thu May 17, 2007 7:18 am

Re: images in pattemplate

Post by PetrSnobelt » Thu Jun 07, 2007 6:33 am

When I do it in php, I must manually iterate each article, I can't have template for row.  :(

dynedain
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 200
Joined: Wed Aug 24, 2005 7:20 pm
Location: Los Angeles
Contact:

Re: images in pattemplate

Post by dynedain » Thu Jun 07, 2007 3:31 pm

Well, patTemplate does have some basic ability to do php from the template, but it's wierd and it probably won't do what you need.

You may want to look at writing your own filter to patTemplate, then you could buid the special functionality you need.


Locked

Return to “patTemplate”