Hey,
I've been using patTemplate in a component I'm working on. I mentioned this in another thread, but haven't received any comments on it, so I will ask it again here.
I guess the first question I should ask is this:
Should I generate my links in my template or in my php code? Right now, I'm employing the following method: I pass a global variable to my template called (a couple actually) BASE_LINK_URL, BASE_IMAGE_URL, etc... these variables provide the base url for my links. Then, depending on where I want to link to, I add on my appropriate task and view information.
Is this a recommended way of doing it? It is working okay in the current setup...
BUT...
now I would like to provide SEF functionality... usually this would require a SEFReltoabs or whatever the function is to make the URL SEF friendly... what I would really like to see is the ability to implement a somewhat customized SEF for the component specific part of the URL... so, I am writing a calendar application, and currently the URL looks like:
http://127.0.0.1/joomla11/index.php?opt ... 60901 (I know... I need to add the itemid in there...)
It would be great if I could get it to look like:
http://127.0.0.1/joomla11/com_extcalend ... t/20060901
or at least get something like:
http://127.0.0.1/joomla15/component/opt ... t/20060901
So my question is, how do I go about doing this in patTemplate?
I would like to have a template such as:
{LINK_TEXT}
{LINK_TEXT}
and then link somewhere with something like:
Is there any way to implement something like this? What is the best way of going about this?
Ian
'calling' a template from a template...
- ianmac
- Joomla! Virtuoso
- Posts: 4784
- Joined: Sat Sep 24, 2005 11:01 pm
- Location: Toronto, Canada
-
- Joomla! Enthusiast
- Posts: 220
- Joined: Fri Aug 19, 2005 12:28 pm
- Contact:
Re: 'calling' a template from a template...
I know there's a sef modifier which allows to run sefreltoabs in the template, but I have not tried it.
https://www.jreviews.com/joomla directory, classifieds, and reviews system for Joomla and WordPress
- ianmac
- Joomla! Virtuoso
- Posts: 4784
- Joined: Sat Sep 24, 2005 11:01 pm
- Location: Toronto, Canada
Re: 'calling' a template from a template...
Thanks,
I'll look into that when I get a chance to see exactly how it works!
Thanks again for the tip!
Ian
I'll look into that when I get a chance to see exactly how it works!
Thanks again for the tip!
Ian
-
- Joomla! Enthusiast
- Posts: 220
- Joined: Fri Aug 19, 2005 12:28 pm
- Contact:
Re: 'calling' a template from a template...
I finally got around to trying this and it works!
Just do this:
index.php?option=com_...">My sef link
Just do this:
index.php?option=com_...">My sef link
https://www.jreviews.com/joomla directory, classifieds, and reviews system for Joomla and WordPress
-
- Joomla! Enthusiast
- Posts: 200
- Joined: Wed Aug 24, 2005 7:20 pm
- Location: Los Angeles
- Contact:
Re: 'calling' a template from a template...
But would this work?Alejo wrote: I finally got around to trying this and it works!
Just do this:
index.php?option=com_...">My sef link
index.php?optin=com_.....{PATVARIABLE}{ANOTHERVAR}">My sef link
I've run into other situations with patTemplate where the order of operations with regards to modifiers prevented me from what I was trying to do.
- ianmac
- Joomla! Virtuoso
- Posts: 4784
- Joined: Sat Sep 24, 2005 11:01 pm
- Location: Toronto, Canada
Re: 'calling' a template from a template...
That was my first question, but I think in this circumstance, it would be okay provided the sef function leaves the { } stuff alone...
Usually the values of these don't change, just the stuff around them, so we can process the { } after the SEF stuff and it should turn out okay, I think. Does this make sense?
I've not tried it yet, I've been on a hiatus from development to work on the API docs.
Ian
Usually the values of these don't change, just the stuff around them, so we can process the { } after the SEF stuff and it should turn out okay, I think. Does this make sense?
I've not tried it yet, I've been on a hiatus from development to work on the API docs.
Ian
-
- Joomla! Enthusiast
- Posts: 220
- Joined: Fri Aug 19, 2005 12:28 pm
- Contact:
Re: 'calling' a template from a template...
It works with variables as well.
https://www.jreviews.com/joomla directory, classifieds, and reviews system for Joomla and WordPress
-
- Joomla! Enthusiast
- Posts: 200
- Joined: Wed Aug 24, 2005 7:20 pm
- Location: Los Angeles
- Contact:
Re: 'calling' a template from a template...
Alejo wrote: It works with variables as well.
I guess what I'm getting at, does the SEF string manipulation happen before or after the variable replacement?