New To Lifetype Template Development, a Few Questions

New To Lifetype Template Development, a Few Questions

Postby dlstern on Fri Oct 10, 2008 4:03 pm

Hi, I am developing a Lifetype site that should work in the following way:

There is a main page that shows a few recent entries in various categories on the site (there are two types of Podcast category, and then there are more general blog posts).

There are category pages that show specific post types for the podcasts.

There is a 'blog ' page that shows all blog entries.

My questions are the following:

1. How do Category pages work in Lifetype? The documentation seems to indicate that they exist, but I see nothing specific in the template files on how to style them.

2. The main.template seems to be designed as what I want the 'blog' page to be. Is there anyway that I can have my frontpage be a different page while having the main.template page be the 'blogs' page?
dlstern
 
Posts: 7
Joined: Fri Oct 10, 2008 3:55 pm
LifeType Version: 1.2

Re: New To Lifetype Template Development, a Few Questions

Postby jondaley on Sat Oct 11, 2008 8:47 am

jondaley
Lifetype Expert
 
Posts: 6169
Joined: Thu May 20, 2004 6:19 pm
Location: Pittsburgh, PA, USA
LifeType Version: 1.2.11 devel branch

Re: New To Lifetype Template Development, a Few Questions

Postby dlstern on Sat Oct 11, 2008 11:30 pm

Um, that's a blog about Christianity, apparently.

I am not sure how that helps me with lifetype template development.
dlstern
 
Posts: 7
Joined: Fri Oct 10, 2008 3:55 pm
LifeType Version: 1.2

Re: New To Lifetype Template Development, a Few Questions

Postby chromos on Sun Oct 12, 2008 5:41 am

the text in these boxes is linking to categories ... so you are able to see how categories work.

BTW: are these links hardcoded?
chromos
 
Posts: 274
Joined: Wed Mar 09, 2005 2:22 pm
LifeType Version: 1.2.9-devel

Re: New To Lifetype Template Development, a Few Questions

Postby jondaley on Sun Oct 12, 2008 8:17 am

It has a different front page - isn't that what you were asking for? You can see the template code by "guessing" the URLs:
http://groshlink.net/templates/blog_1/g ... n.template

I think main.template might be the only interesting one.

I should have used a plugin to get the most recent ones, rather than just looping through. But, the code works, as long as you don't have any categories that don't have a post in them for a long time.
jondaley
Lifetype Expert
 
Posts: 6169
Joined: Thu May 20, 2004 6:19 pm
Location: Pittsburgh, PA, USA
LifeType Version: 1.2.11 devel branch

Re: New To Lifetype Template Development, a Few Questions

Postby chromos on Sun Oct 12, 2008 9:27 am

BTW is there a way of preventing people to view the template code?
chromos
 
Posts: 274
Joined: Wed Mar 09, 2005 2:22 pm
LifeType Version: 1.2.9-devel

Re: New To Lifetype Template Development, a Few Questions

Postby jondaley on Sun Oct 12, 2008 9:31 am

Uncomment the lines in template/.htaccess
One developer added the code, and both phunkphorce and I thought it would be better to leave it commented, since we often are able to help people on their sites since we can see the bugs in their templates.
jondaley
Lifetype Expert
 
Posts: 6169
Joined: Thu May 20, 2004 6:19 pm
Location: Pittsburgh, PA, USA
LifeType Version: 1.2.11 devel branch

Re: New To Lifetype Template Development, a Few Questions

Postby dlstern on Sun Oct 12, 2008 10:39 am

jondaley wrote:It has a different front page - isn't that what you were asking for? You can see the template code by "guessing" the URLs:
http://groshlink.net/templates/blog_1/g ... n.template

I think main.template might be the only interesting one.

I should have used a plugin to get the most recent ones, rather than just looping through. But, the code works, as long as you don't have any categories that don't have a post in them for a long time.


Ah, sorry, when I first saw the link it just took me to the wrong page, so I didn't the the different front page and was just confused.

This should be helpful, thanks.

My one remaining question though is that I don't see any sort of templates for the 'category' pages. What template files are those controlled by?
dlstern
 
Posts: 7
Joined: Fri Oct 10, 2008 3:55 pm
LifeType Version: 1.2

Re: New To Lifetype Template Development, a Few Questions

Postby jondaley on Sun Oct 12, 2008 4:37 pm

They also use main.template. See the if statement at the top of the groshlink template.
jondaley
Lifetype Expert
 
Posts: 6169
Joined: Thu May 20, 2004 6:19 pm
Location: Pittsburgh, PA, USA
LifeType Version: 1.2.11 devel branch

Re: New To Lifetype Template Development, a Few Questions

Postby dlstern on Sun Oct 12, 2008 7:58 pm

jondaley wrote:They also use main.template. See the if statement at the top of the groshlink template.


Great, I've figured out the category stuff.

Having one more issue, then I'll have my setup exactly as I want it.

So, using an 'if' statement similar to the one you had in the main.template, and now I have this custom frontpage that just has a menu of different categories (and some other summary stuff) and I have these separate category pages.

I also need a 'Blog' page which has all the blog entries listed on it, much like the default main.template in the standard template. I am currently unsure as how to implement this.
dlstern
 
Posts: 7
Joined: Fri Oct 10, 2008 3:55 pm
LifeType Version: 1.2

Re: New To Lifetype Template Development, a Few Questions

Postby jondaley on Tue Oct 14, 2008 8:42 pm

I am not sure what you mean. You can have an {else} clause to do something whenever you aren't on a category or whatever page.
jondaley
Lifetype Expert
 
Posts: 6169
Joined: Thu May 20, 2004 6:19 pm
Location: Pittsburgh, PA, USA
LifeType Version: 1.2.11 devel branch

Re: New To Lifetype Template Development, a Few Questions

Postby dlstern on Wed Oct 15, 2008 2:08 am

jondaley wrote:I am not sure what you mean. You can have an {else} clause to do something whenever you aren't on a category or whatever page.


Okay, I'll try to explain things a little better then.

I have a frontpage with a bunch of custom content (category listings, recent posts diced up in a few ways, different styling, etc.). The relevant menu structure of the site should be like the following, approximately.

FRONTPAGE
-Category Page
-Category Page
-Blog Page (which shows all blog posts from all categories)

Right now, the code to differentiate that frontpage from posts or category listings looks like the following:

Code: Select all
{if $category || $date'}
{assign var="OnMainPage" value=0}
{else}
{assign var="OnMainPage" value=1}
{/if}


What I want to add is a page that, like the category or individual post pages, is not the frontpage of the site. This page would have a typical blog layout displaying all categories, much like the main.template in the standard lifetype install. Ideally, I would like for this new page to reside at the url 'lifetype/blog', although I am not sure this will work since lifetype uses the 'blog' namespace already.

I tried the following:

Code: Select all
{if $category || $date || $smarty.server.PHP_SELF == '/lifetype/blog/'}
{assign var="OnMainPage" value=0}
{else}
{assign var="OnMainPage" value=1}


but the value of $smarty.server.PHP_SELF seems erratic and is not getting me the results I need to consistently hit that page.
dlstern
 
Posts: 7
Joined: Fri Oct 10, 2008 3:55 pm
LifeType Version: 1.2

Re: New To Lifetype Template Development, a Few Questions

Postby jondaley on Wed Oct 15, 2008 12:48 pm

what do you mean by "erratic"?

The way I would probably do it is to either use the URL /static/bloglist or else use a rewriterule to go from whatever you want it to be /blog, etc. and rewrite it internally to static/bloglist, and then make a new template file called bloglist.template that has the stuff in it that I want.

I have used smarty's self to do checks in the past, so that way should work as well.
jondaley
Lifetype Expert
 
Posts: 6169
Joined: Thu May 20, 2004 6:19 pm
Location: Pittsburgh, PA, USA
LifeType Version: 1.2.11 devel branch

Re: New To Lifetype Template Development, a Few Questions

Postby dlstern on Wed Oct 15, 2008 12:51 pm

jondaley wrote:what do you mean by "erratic"?

The way I would probably do it is to either use the URL /static/bloglist or else use a rewriterule to go from whatever you want it to be /blog, etc. and rewrite it internally to static/bloglist, and then make a new template file called bloglist.template that has the stuff in it that I want.

I have used smarty's self to do checks in the past, so that way should work as well.


When I've tried to use the self, it sometimes was working correctly but then sometimes displaying lifetype/index.php when it should have been lifetype/blog. Could be a server or cache thing rather than a lifetype issue, I dunno.

I guess I'll use the static page for now, that should work fine. I can always change stating url styles if I really need the perfect url.
dlstern
 
Posts: 7
Joined: Fri Oct 10, 2008 3:55 pm
LifeType Version: 1.2

Re: New To Lifetype Template Development, a Few Questions

Postby jondaley on Wed Oct 15, 2008 2:09 pm

ah yes, I have seen that - and that is why the groshlink page has the two checks - something about if you visit /blog first, before visiting / the cache gets saved not exactly how you'd expect it to.
jondaley
Lifetype Expert
 
Posts: 6169
Joined: Thu May 20, 2004 6:19 pm
Location: Pittsburgh, PA, USA
LifeType Version: 1.2.11 devel branch


Return to Templates

cron