The Joomla! Forum ™





Post new topic Reply to topic  [ 54 posts ]  Go to page Previous  1, 2
Author Message
PostPosted: Sat Oct 22, 2005 4:51 pm 
Joomla! Guru
Joomla! Guru

Joined: Fri Aug 19, 2005 9:27 am
Posts: 525
There's at least one issue that I'm aware of. The translate function has been highly modified to work with a $_LANG object instead of using the standard pat translation method. $_LANG needs to have a function named _ - ie: 
Code:
function _($string) {
   // logic to translate string goes here
   return $translatedValue;
}


I've had trouble with one of the patFactory templates (specific to Joomla) - include-tabs. There is a style block that uses a {TABURL} variable for a path to graphics. I couldn't get it to work. So, I just created a new mosTabs object whose constructor plugs in the appropriate scripts and css things. It seems to work fine.

BTW, patFactory::createTemplate creates a number of handy templates you can use to make life easier. Try creating a template with it then do a dump() and take a look at all the included templates. You can use I won't ignore your forum posts even If you send PMs for personal support.


Top
 Profile  
 
PostPosted: Sat Oct 22, 2005 4:52 pm 
Joomla! Guru
Joomla! Guru

Joined: Fri Aug 19, 2005 9:27 am
Posts: 525
There's at least one issue that I'm aware of. The translate function has been highly modified to work with a $_LANG object instead of using the standard pat translation method. $_LANG should be global and needs to have a function named _ - ie: 
Code:
function _($string) {
   // logic to translate string goes here
   return $translatedValue;
}


I've had trouble with one of the patFactory templates (specific to Joomla) - include-tabs. There is a style block that uses a {TABURL} variable for a path to graphics. I couldn't get it to work. So, I just created a new mosTabs object whose constructor plugs in the appropriate scripts and css things. It seems to work fine.

BTW, patFactory::createTemplate creates a number of handy templates you can use to make life easier. Try creating a template with it then do a dump() and take a look at all the included templates. You can use I won't ignore your forum posts even If you send PMs for personal support.


Top
 Profile  
 
PostPosted: Sat Oct 22, 2005 6:08 pm 
Joomla! Enthusiast
Joomla! Enthusiast

Joined: Thu Sep 29, 2005 2:37 am
Posts: 174
Thanks for the info!  I'd like very much to use a pattemplate in a content item---so I dont need to build an entire component!

Do you know anything about a mambot for pattemplate, so they can be included in content items? It's mentioned but I can't anything more about it. Or should this be done some other way?

_________________
Ernest Meyer

http://yofiel.com


Top
 Profile  
 
PostPosted: Wed Oct 26, 2005 2:28 pm 
Joomla! Guru
Joomla! Guru

Joined: Fri Aug 19, 2005 9:27 am
Posts: 525
I found another issue with patTemplates. When I'm done posting here, I'll check the pat forum to see if it's being addressed.

When you add an array to a template, say you're using a template with your $rows array, it will loop automatically. Now, say you're using a condition and one of your sub conditions is __first. The __first sub condition will only output on the first iteration of your array. But, In patTemplates 3.1.0, there is a new undocumented sub condition called __single. The problem is, if sometimes your $rows array only contains a single value, __first fails. So, you have to add a __single sub template and duplicate everything that's in your __first sub template. It makes things a little messy and adds un-needed redundancy.

I ran across this when I added pageNav to my component. I have a form that only displays on the first iteration of my $rows array. What I discovered was that when a page only contains a single record, the form wasn't displaying. This little bug is going to cause major problems working with pageNav if you need to use the __first sub condition.

As an example, suppose you have added a $rows variable to a template named "rows". Here is an example template:
Code:
<mos:tmpl name="rows">
   <mos:Call template="rowstemplate"/>
   <mos:tmpl name="formcondition" type=condition conditionvar="rows.rowid">
      <mos:sub condition="__first">
         <mos:Call template="formtemplate"/>
          This fails if there is only one record in $rows
      </mos:sub>
      <mos:sub condition="__single">
         <mos:Call template="formtemplate"/>  <--- redundant
          This works if there is only one record in $rows
      </mos:sub>
   </mos:tmpl
</mos:tmpl>


Note how __first fails if there is only one record in $rows and how we had to add __single to make things work.

_________________
Al Warren
This ain't my first rodeo. Red Foreman says it best. Please don't abuse the report feature.
I won't ignore your forum posts even If you send PMs for personal support.


Top
 Profile  
 
PostPosted: Tue Jan 16, 2007 3:38 am 
Joomla! Apprentice
Joomla! Apprentice

Joined: Fri Aug 04, 2006 9:12 pm
Posts: 19
I'm trying to understand the whole 'patTemplate' thing...I've been reading the docs and such but while trying to install a suckerfish menu that incorporates patTemplate - i kept getting this error:

Quote:
Warning: renderasstring(/home/www/svsbedford.org/svsweb/includes/patTemplate/patTemplate.php): failed to open stream: No such file or directory in /home/www/svsbedford.org/svsweb/modules/mod_exmenu/exmenu/view/pattemplate.menuview.class.php on line 28

Fatal error: renderasstring(): Failed opening required '/home/www/svsbedford.org/svsweb/includes/patTemplate/patTemplate.php' (include_path='.:/usr/local/lib/php') in /home/www/svsbedford.org/svsweb/modules/mod_exmenu/exmenu/view/pattemplate.menuview.class.php on line 28


sure enough, there's nothing on my server located in the joomla structure at 'includes/patTemplate'
should there be?  is something just screwed up with my joomla installation?

or is patTemplate something i need to download and install??

i'm trying out Joomla 1.5 at:
http://www.svsbedford.org/svsweb

thanks
--bp


Top
 Profile  
 
PostPosted: Tue Jan 16, 2007 10:42 am 
User avatar
Joomla! Virtuoso
Joomla! Virtuoso

Joined: Fri Sep 16, 2005 8:41 pm
Posts: 3742
Location: NRW - Germany
patTemplate has been deprecated and will not be used in Joomla anymore. The engine is still left in place fpr backwards compatibility reasons.

_________________
god doesn't play dice with the universe. not after that drunken night with the devil where he lost classical mechanics in a game of craps.

Since the creation of the Internet, the Earth's rotation has been fueled, primarily, by the collective spinning of English teachers in their graves.


Top
 Profile  
 
PostPosted: Tue Feb 06, 2007 10:07 pm 
Joomla! Fledgling
Joomla! Fledgling

Joined: Tue Feb 06, 2007 9:55 pm
Posts: 1
If patTemplate is not being used anymore, then how do I get past the issue that Brandonjp is having.  I have the exact same issue trying to use a suckerfish menu.  Any advice is greatrly appreciated, thanks!


Top
 Profile  
 
PostPosted: Wed Apr 11, 2007 12:07 pm 
Joomla! Apprentice
Joomla! Apprentice

Joined: Sun Nov 26, 2006 12:48 pm
Posts: 36
Location: London
Hackwar wrote:
patTemplate has been deprecated and will not be used in Joomla anymore. The engine is still left in place fpr backwards compatibility reasons.


WHAT?!? I've just started working with Joomla a while ago and was under the impression that patTemplate would be the presentation layer for Joomla and have spent a substantial amount of time/energy trying to figure out how to do things in patTemplate and then I come across this!!!

Why has patTemplate been dumped? I didnt think patTemplate was the best presentation engine to use (I prefer smarty) but was starting to get the hang of it. If patTemplate is not being used, what will be the presentation layer?


Top
 Profile  
 
PostPosted: Wed Apr 11, 2007 4:38 pm 
User avatar
Joomla! Enthusiast
Joomla! Enthusiast

Joined: Wed Aug 24, 2005 7:20 pm
Posts: 200
Location: Los Angeles
Sad, but true.

The developers of Joomla after attempting to use patTemplate on some of the core components realized that the performance hit was to great.

It's not being stripped out of 1.5, so you're safe for the time being. At the earliest it would be removed is 2.0... and considering how long 1.5 has been in development, I think you have several years before worrying about 2.0  ;)

The new recommendation for components is the object-oriented programming technique Model-View-Controller (MVC). While the old methods will still work, MVC will be much more efficient for implementing complex components. It appears at the moment, you can build the View portion of your component however you want, and additional templates for your components by implementing additional Views.

So in this scenario, the View part of the component is the presentation layer and is just plain ol' PHP, so you can have as little or as much logic in the presentation layer as you need. Of course you could continue to use patTemplate in 1.5 by implementing it in your Views, but it will eventually be phased out.


Top
 Profile  
 
PostPosted: Wed Apr 11, 2007 5:57 pm 
Joomla! Enthusiast
Joomla! Enthusiast

Joined: Thu Aug 18, 2005 4:07 pm
Posts: 189
pattemplate is obsolete and this is fact 

there are lots of time till 1.5 goes stable, so only the laziest ones or missinformed will use obsolete pattemplate

till 1.5 is in beta we can and must remove a lot of bad things, one of them is obsolete pattemplate  :-*

If you want spent lots of money on your hosting solution or see your site off line then use obsolete pattemplate

_________________
Poll [ Homepage: http://www.bertran.uni.cc/ORION ]
Why there are no updates on the current donation and add revenue status? helping out Joomla! users, "giving back" to the community...
Testing Joomla! 1.5 beta 2 SVN on http://bertran.uni.cc/j15b2


Top
 Profile  
 
PostPosted: Wed Apr 11, 2007 6:08 pm 
User avatar
Joomla! Champion
Joomla! Champion

Joined: Tue Sep 13, 2005 12:22 am
Posts: 5206
Location: Omaha, Nebraska, USA
@Terenzusum
Yes, patTemplates is obsolete, but for backwards compatibility reasons, it will stay in with the 1.5 release as Hackwar stated a few posts above. If you do not like it, then remove it after you download it. I am curious though, can you please elaborate on your statement:
Terenzusum wrote:
If you want spent lots of money on your hosting solution or see your site off line then use obsolete pattemplate


How will patTemplates cost you money and how can it cause your site to be offline?

_________________
Kenneth Crowder - Omaha, Nebraska, USA
Global Moderator - Joomla! ...because open source matters
Recipes for people with food allergies: http://intolerantoffspring.com
Author of "Joomla! 1.5: Developing Secure Sites": http://www.lynda.com/home/DisplayCourse.aspx?lpk2=73559


Top
 Profile  
 
PostPosted: Wed Apr 11, 2007 9:17 pm 
User avatar
Joomla! Ace
Joomla! Ace

Joined: Fri Aug 12, 2005 2:45 am
Posts: 1961
Location: Toowoomba, Australia
Ok.

patTemplate is still a very fine templating engine, in fact I absolutely love the syntax over any other system - it's certainly not obsolete in terms of a tools that's available to use.

However, it does have a significant performance hit (although, page caching would help that) and it still has few painful quirks (like nested loops are a pain in the rear to implement) and sometimes it refuses to do what you think it should.

Sadly, and I fought this decision for a long time,  I've had to resign to the fact that I need to go back to the php way of doing things and am currently un-patTemplating all my layout files.  It's not too bad or hard - in some ways it's a lot nicer and you get a lot more control, particularly with heavily nested loops.  In other ways it's not as nice but that's the way the cookie crumbles.

_________________
Andrew Eddie - Tweet @AndrewEddie
<><
http://learn.theartofjoomla.com - Joomla 2.5 training videos!
http://www.kiva.org/team/joomla - Got Joomla for free? Pay it forward and help fight poverty.


Top
 Profile  
 
PostPosted: Wed Apr 11, 2007 9:35 pm 
Joomla! Enthusiast
Joomla! Enthusiast

Joined: Thu Aug 18, 2005 4:07 pm
Posts: 189
I think masterchief answered your question, didnt he?

_________________
Poll [ Homepage: http://www.bertran.uni.cc/ORION ]
Why there are no updates on the current donation and add revenue status? helping out Joomla! users, "giving back" to the community...
Testing Joomla! 1.5 beta 2 SVN on http://bertran.uni.cc/j15b2


Top
 Profile  
 
PostPosted: Wed Apr 11, 2007 9:53 pm 
Joomla! Enthusiast
Joomla! Enthusiast

Joined: Thu Aug 18, 2005 4:07 pm
Posts: 189
just wanted to ask

Why we need to keep obsolete pattemplate library if only 1 user needs it now?

and then 1.5 be ready for production (today no one can say when it comes out) no one will use obsolete system apart laziest ones

even masterchief who introduced pattemplate in joomla admits above trying to get rid of pattemplate

_________________
Poll [ Homepage: http://www.bertran.uni.cc/ORION ]
Why there are no updates on the current donation and add revenue status? helping out Joomla! users, "giving back" to the community...
Testing Joomla! 1.5 beta 2 SVN on http://bertran.uni.cc/j15b2


Top
 Profile  
 
PostPosted: Wed Apr 11, 2007 10:00 pm 
Joomla! Enthusiast
Joomla! Enthusiast

Joined: Thu Aug 18, 2005 4:07 pm
Posts: 189
for all pattemplate lovers, I doubt there are much of them

I loved pattemplate also, but it get autdated because pattemplate developers abandoned it, and couldn't keep their promises

we need to admit it and remove this librarry

its time to change

dont waste your oportunity joomla 1.5 is in beta level dont forget it

_________________
Poll [ Homepage: http://www.bertran.uni.cc/ORION ]
Why there are no updates on the current donation and add revenue status? helping out Joomla! users, "giving back" to the community...
Testing Joomla! 1.5 beta 2 SVN on http://bertran.uni.cc/j15b2


Top
 Profile  
 
PostPosted: Thu Apr 12, 2007 8:36 pm 
User avatar
Joomla! Virtuoso
Joomla! Virtuoso

Joined: Fri Sep 16, 2005 8:41 pm
Posts: 3742
Location: NRW - Germany
We wont remove the library from 1.5, since its in there since Mambo 4.5.2.something and allready some, although very few, extensions are using it. It will be gone somewhere in the next versions. maybe 1.6, maybe 2.0. We will see.

_________________
god doesn't play dice with the universe. not after that drunken night with the devil where he lost classical mechanics in a game of craps.

Since the creation of the Internet, the Earth's rotation has been fueled, primarily, by the collective spinning of English teachers in their graves.


Top
 Profile  
 
PostPosted: Wed Apr 18, 2007 2:17 pm 
Joomla! Apprentice
Joomla! Apprentice

Joined: Sun Nov 26, 2006 12:48 pm
Posts: 36
Location: London
Interesting thread this one...I lost track of it because I stopped getting email alerts, just came back to it today.

So in version 1.5 Joomla! will be moving to a MVC architecture, that sounds great. I do think that the way things are at the moment (app logic and view logic mixed up/PHP and HTML mixed up) is a big problem with Joomla! So MVC would be a big step in the right direction.

So any ideas what will be used for the view part? I looked through the API for v.1.5 and saw a JView class but I assume this will be used internally by Joomla! to render the view. Am I correct? I assume the view will be some sort of a templating engine like smarty rather than having to extend the JView class and putting your view code in there. Does anybody have any ideas as to what the view technology/tool will be?

Regards
Ziad


Top
 Profile  
 
PostPosted: Wed Apr 18, 2007 2:26 pm 
User avatar
Joomla! Virtuoso
Joomla! Virtuoso

Joined: Fri Sep 16, 2005 8:41 pm
Posts: 3742
Location: NRW - Germany
look into the current nightly builds about this.

_________________
god doesn't play dice with the universe. not after that drunken night with the devil where he lost classical mechanics in a game of craps.

Since the creation of the Internet, the Earth's rotation has been fueled, primarily, by the collective spinning of English teachers in their graves.


Top
 Profile  
 
PostPosted: Wed Apr 18, 2007 4:15 pm 
User avatar
Joomla! Virtuoso
Joomla! Virtuoso

Joined: Sat Sep 24, 2005 11:01 pm
Posts: 4779
Location: Toronto, Canada
ziad wrote:
Interesting thread this one...I lost track of it because I stopped getting email alerts, just came back to it today.

So in version 1.5 Joomla! will be moving to a MVC architecture, that sounds great. I do think that the way things are at the moment (app logic and view logic mixed up/PHP and HTML mixed up) is a big problem with Joomla! So MVC would be a big step in the right direction.

So any ideas what will be used for the view part? I looked through the API for v.1.5 and saw a JView class but I assume this will be used internally by Joomla! to render the view. Am I correct? I assume the view will be some sort of a templating engine like smarty rather than having to extend the JView class and putting your view code in there. Does anybody have any ideas as to what the view technology/tool will be?

Regards
Ziad


each view extends the JView class.  Then in your JView class, you push your data into the template.  The extension of the JView class is just like the classes that used to be used in xxxx.html.php.  Inside the template itself, PHP is used rather than trying to create a wrapper around what is already there.  That way templates don't have to be parsed twice.

Ian


Top
 Profile  
 
PostPosted: Wed Apr 18, 2007 10:36 pm 
Joomla! Apprentice
Joomla! Apprentice

Joined: Sun Nov 26, 2006 12:48 pm
Posts: 36
Location: London
Thanks for your post Ian. So the JView class will be extended to put the code that pushes the data into the template and then the template will do the actual presentation (HTML say). But what will this template be? If I've understood you correctly, you are saying that the template will be a PHP file that contains mainly HTML but has PHP embedded in it containing view logic (e.g. looping through a set of data, IFs etc).

I can see how that might work if you strictly limit yourself to view logic, but isnt that kinda going against the principle of MVC? I mean shouldnt the view be something that doesnt allow you to do PHP stuff (unless it is absolutely neccessary)?

As you suggested Hacwar, I should have a look at this stuff myself but unfortunately as much I would love to do that, I just will not get the time to do it, so if anyone has already looked at it and can provide some insight that is very much appreciated.

Thanks
Ziad


Top
 Profile  
 
PostPosted: Wed Apr 18, 2007 10:42 pm 
User avatar
Joomla! Ace
Joomla! Ace

Joined: Fri Aug 12, 2005 2:45 am
Posts: 1961
Location: Toowoomba, Australia
Ziad, would you mind kicking this discussion off in it's own topic.  Thanks.

_________________
Andrew Eddie - Tweet @AndrewEddie
<><
http://learn.theartofjoomla.com - Joomla 2.5 training videos!
http://www.kiva.org/team/joomla - Got Joomla for free? Pay it forward and help fight poverty.


Top
 Profile  
 
PostPosted: Thu Apr 19, 2007 8:35 am 
Joomla! Apprentice
Joomla! Apprentice

Joined: Sun Nov 26, 2006 12:48 pm
Posts: 36
Location: London
Have started a new topic:
http://forum.joomla.org/index.php/topic ... #msg778245

Regards


Top
 Profile  
 
PostPosted: Thu Jun 21, 2007 4:42 pm 
User avatar
Joomla! Apprentice
Joomla! Apprentice

Joined: Wed Jun 21, 2006 9:41 am
Posts: 15
Location: Monte Vederna (1300mt), Primiero, Trentino, Italy
Why the "Hello World" tutorials in the Joomla! Help Site are still explaining how to develop components using patTemplate if it is deprecated?
IMHO that is the first place a new extension-developer will look (me too)!  :(

_________________
Next Point - Melodic Punk Rock


Top
 Profile  
 
PostPosted: Thu Jun 21, 2007 4:55 pm 
User avatar
Joomla! Virtuoso
Joomla! Virtuoso

Joined: Sat Sep 24, 2005 11:01 pm
Posts: 4779
Location: Toronto, Canada
The help site has 1.0 developer resources.  patTemplate can be used in Joomla! 1.0.  In 1.5, it is deprecated.  Please visit dev.joomla.org for developer resources for programming Joomla! 1.5.

Ian


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 54 posts ]  Go to page Previous  1, 2



Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group