Are "category" headers possible?

Postby jondaley on Tue Mar 13, 2007 5:38 pm

I think you are asking about the pager?
<div class="pager">
Go to page: {pager style="links"}
</div>


There are different style options.
See class/template/smarty/plugins/function.pager.php
jondaley
Lifetype Expert
 
Posts: 6169
Joined: Thu May 20, 2004 6:19 pm
Location: Pittsburgh, PA, USA
LifeType Version: 1.2.11 devel branch

Postby G. Noel Gross on Tue Mar 13, 2007 6:32 pm

Ah! Yes. Would something like this jive?

{if $OnMainPage}
{if $OnMainPage pager style="prevonly"}
{/if}

{else}

{pager style="links"}
{/if}


Show it one way (or not at all) on the home page -- another elsewhere?
G. Noel Gross
 
Posts: 31
Joined: Sat Feb 24, 2007 2:33 am

Postby jondaley on Wed Mar 14, 2007 10:25 am

I am not quite sure what you are trying to do, but your code isn't valid, I don't think. This is valid, but maybe doesn't do what you want.

{if $OnMainPage}
{pager style="prevonly"}
{else}
{pager style="links"}
{/if}
jondaley
Lifetype Expert
 
Posts: 6169
Joined: Thu May 20, 2004 6:19 pm
Location: Pittsburgh, PA, USA
LifeType Version: 1.2.11 devel branch

Postby G. Noel Gross on Wed Mar 14, 2007 11:53 am

{if $OnMainPage}
{pager style="prevonly"}
{else}
{pager style="links"}
{/if}


In that scenario, is it possible to change "{pager style="prevonly"}" to a text link URL?
G. Noel Gross
 
Posts: 31
Joined: Sat Feb 24, 2007 2:33 am

Postby jondaley on Wed Mar 14, 2007 9:29 pm

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

Postby G. Noel Gross on Wed Mar 14, 2007 9:55 pm

Sorry. I'm not being clear.

I'd like a decision to be made in the coding. If it's the MainPage ... spit out a hyperlink. If not, go ahead and use the pager style.

Why? Because on the front page of my site ... I don't want a pager style. I just want it to show X items and then offer a link that goes to one of my categories.

In my categories, the pager style is fine.
G. Noel Gross
 
Posts: 31
Joined: Sat Feb 24, 2007 2:33 am

Postby Rechosen on Thu Mar 15, 2007 8:37 am

I think you mean:
Code: Select all
{if $OnMainPage}
<a href="http://www.exampleurl.com/examplepage">Example Link</a>
{else}
{pager style="links"}
{/if}

Smarty allows normal HTML between {if}{/if}.
Linux Tutorial Blog - Powered by Lifetype

"If you try to save your life, you will lose it."
Rechosen
 
Posts: 20
Joined: Sat Jan 27, 2007 3:51 pm

Postby G. Noel Gross on Thu Mar 15, 2007 5:21 pm

Rechosen wrote:I think you mean:
Code: Select all
{if $OnMainPage}
<a href="http://www.exampleurl.com/examplepage">Example Link</a>
{else}
{pager style="links"}
{/if}

Smarty allows normal HTML between {if}{/if}.
That worked! Thanks!
G. Noel Gross
 
Posts: 31
Joined: Sat Feb 24, 2007 2:33 am

Re: Are "category" headers possible?

Postby G. Noel Gross on Wed Aug 20, 2008 4:32 pm

Code: Select all
{if $category}
{if $category->getName()=="Podcast"}
{include file="$blogtemplate/podcast.template"}
{/if}
{if $category->getName()=="News"}
{include file="$blogtemplate/news.template"}
{/if}

{else}

{include file="$blogtemplate/front.template"}
{/if}

I've had another issue arise.

At the article level (single post), the "if/else" statements no longer work.

Say I have an entry marked "News" and click through to the permalink, "front.template" is displayed rather than the desired "news.template."
G. Noel Gross
 
Posts: 31
Joined: Sat Feb 24, 2007 2:33 am

Re: Are "category" headers possible?

Postby jondaley on Thu Aug 21, 2008 12:13 am

It is because there might be multiple categories - I think you need to check a different variable. The wiki has all of the available variables for each template file.
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: Are "category" headers possible?

Postby G. Noel Gross on Thu Aug 21, 2008 12:31 am

jondaley wrote:It is because there might be multiple categories - I think you need to check a different variable. The wiki has all of the available variables for each template file.
Doesn't "post.template" produce the single article? I'm a little lost in the wiki. Another nudge?
G. Noel Gross
 
Posts: 31
Joined: Sat Feb 24, 2007 2:33 am

Re: Are "category" headers possible?

Postby G. Noel Gross on Thu Aug 21, 2008 6:33 pm

G. Noel Gross wrote:Doesn't "post.template" produce the single article?
Oops! No it doesn't ... postandcomments.template does.
G. Noel Gross
 
Posts: 31
Joined: Sat Feb 24, 2007 2:33 am

Re: Are "category" headers possible?

Postby jondaley on Fri Aug 22, 2008 12:47 pm

And just to be clear, there might be multiple categories in post.template or postandcomments.template, since a post can have multiple categories.
jondaley
Lifetype Expert
 
Posts: 6169
Joined: Thu May 20, 2004 6:19 pm
Location: Pittsburgh, PA, USA
LifeType Version: 1.2.11 devel branch

Previous

Return to Templates

cron