BlogHarbor Home Page
FAQFAQ  SearchSearch  MemberlistMemberlist  UsergroupsUsergroups  UsergroupsRSS   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
Question about removing the date from articles
 
Post new topic   Reply to topic    BlogHarbor Community Forum Index -> Beginner's Lounge
View previous topic :: View next topic  
Author Message
markb



Joined: 03 Apr 2004
Posts: 16

PostPosted: Mon Feb 20, 2006 11:30 pm    Post subject: Question about removing the date from articles Reply with quote

Is there a way to eliminate the date (and time) from an article at the Header above the title and at the author line?
Back to top
View user's profile Send private message
john
Site Admin


Joined: 16 Mar 2004
Posts: 3434

PostPosted: Tue Feb 21, 2006 1:02 pm    Post subject: Re: Question about removing the date from articles Reply with quote

You can remove that text, or customize it, by making changes to your article and category templates. See these instructions for customizing your category template and these instructions for customizing your article template.

In the article template you would see this line:

Code:
 <%= gettext("on") %> {{publish_time}} &nbsp;|&nbsp; <a href="{{permalink_url}}"><%= gettext("Permanent Link") %></a>


In the category template you would see this line:

Code:
 <%= gettext("on") %> {{publish_time}}


In both cases, the code <%= gettext("on") %> {{publish_time}} is what inserts the datestamp shown in red here:

by Bull Mancuso on Fri 17 Feb 2006 08:42 PM CST

removing the code above would produce this in category view:

by Bull Mancuso

and this in article view:

by Bull Mancuso | Permanent Link

Just make sure you only remove the <%= gettext("on") %> {{publish_time}} part and that you do it on both templates.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
markb



Joined: 03 Apr 2004
Posts: 16

PostPosted: Tue Feb 21, 2006 5:53 pm    Post subject: I was also inquiring about the date at top Reply with quote

Thanks for instructions, John, I was able to remove date info from author line, but what about the line that shows the date that is positioned above the Article Title?

EXAMPLE:

Sunday, February 12
Welcome Title
by "Author Name" on Sun 12 Feb 2006 09:27 AM CST

Also, if I work on a template from the Main, all the subcategories pick up on the change because they inherit the main page template. Is there an easy way to change the Main Page template without changing the rest of the subcategories?
Back to top
View user's profile Send private message
john
Site Admin


Joined: 16 Mar 2004
Posts: 3434

PostPosted: Tue Feb 21, 2006 7:16 pm    Post subject: Re: I was also inquiring about the date at top Reply with quote

I was able to remove date info from author line, but what about the line that shows the date that is positioned above the Article Title?

That is generated by the category template, look for this code:

Code:
<div class="postDate">{{date.day_name}}, {{date.month_name}} {{date.day}}</div>


If you remove it, the article group for that day will not have a Date header.

Also, if I work on a template from the Main, all the subcategories pick up on the change because they inherit the main page template. Is there an easy way to change the Main Page template without changing the rest of the subcategories?

You could wrap the line above in an if or unless statement. You don't say if you want this to appear on the Main Page or don't want it to appear on the Main Page, so we'll show you both options.

If you only want that header to appear on the Main Page category, then use this if statement:

Code:
{{if category.label eq "Main Page"}}
<div class="postDate">{{date.day_name}}, {{date.month_name}} {{date.day}}</div>
{{/if}}


If you want that header to appear on all other categories except the Main Page, then use unless as follows:

Code:
{{unless category.label eq "Main Page"}}
<div class="postDate">{{date.day_name}}, {{date.month_name}} {{date.day}}</div>
{{/unless}}


Hope this meets your requirement.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Search all BlogHarbor support resources.
View previous topic :: View next topic  
Display posts from previous:   
Post new topic   Reply to topic    BlogHarbor Community Forum Index -> Beginner's Lounge All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
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 vote in polls in this forum