View previous topic :: View next topic |
Author |
Message |
curiousike Guest
|
Posted: Fri Feb 04, 2005 8:29 am Post subject: Editing the article template |
|
|
Hi,
I would like to remove the standard line after each article title that says "by (author) on (date, time)". I edited the article template and removed the following code:
<div class="articleAuthor">by
{{if author}}
<a href="javascript:openWindow('{{view_user_url}}', 'info', 450, 600);">{{var name=author escape=html}}</a>
{{else}}
Anonymous
{{/if}}
at {{publish_time.hour}}:{{publish_time.min}}{{publish_time.ampm}} ({{publish_time.zone}}) on {{publish_time.month_name}} {{publish_time.day}}, {{publish_time.year}} | <a href="{{permalink_url}}">Permanent Link</a>
{{if cosmos_url}}
| <a href="{{cosmos_url}}">Cosmos</a>
{{/if}}
</div>
I then pressed "save and activate", but the line is still there when I look at my blog. What am I doing wrong?
Also, in the standard style for the article template, I see the following code:
<div class="categoryPostList">
<table border="0" cellpadding="1" cellspacing="0" class="categoryPostListTable"><tr>
<td valign="top" nowrap><span style="font-weight:bold;">Posted to:</span> </td>
<td valign="top">
{{loop article.categories}}
<div style="margin-bottom:3px;"><a href="{{url}}">{{label}}</a></div>
{{/loop}}
</td>
</tr></table>
</div> <!-- categoryPostList -->
But I don't see anything on my articles saying "posted to" or indicating what category they are posted to.
Apologies if these are especially stupid questions, I am VERY new. |
|
Back to top |
|
|
john Site Admin
Joined: 16 Mar 2004 Posts: 3434
|
Posted: Fri Feb 04, 2005 10:20 am Post subject: Re: Editing the article template |
|
|
A very similar question was just asked yesterday:
http://forums.blogharbor.com/viewtopic.php?p=1830#1830
Remember there are 2 templates you'll need to modify, the article and category templates. The article template controls what the article looks like when its displayed by itself as the Permanent Link, and the category template controls what the list of articles looks like in category view.
Also, in the standard style for the article template, I see the following code: ... But I don't see anything on my articles saying "posted to" or indicating what category they are posted to.
This text is only displayed when you view the article at its Permanent Link, not when it is displayed in category view. |
|
Back to top |
|
|
curiousike Guest
|
Posted: Fri Feb 04, 2005 11:08 am Post subject: One more question |
|
|
Thank you for the very quick reply and sorry to repeat a question that was asked yesterday.
I have now succesfully removed that line, and moved it to the bottom of each article with the following code after the article body:
<div class="articleAuthor">
<BR>Posted by
{{if author}}
<a href="javascript:openWindow('{{view_user_url}}', 'info', 450, 600);">{{var name=author escape=html}}</a>
{{else}}
Anonymous
{{/if}}
to {{loop article.categories}}<a href="{{url}}">{{label}}</a>
{{/loop}}|
<a href="{{view_url}}#comments">Comments ({{num_comments}})</a> |
<!-- num_comments -->
<a href="{{permalink_url}}">Permalink</a>
</div> <!-- categoryPostList -->
I added this code to the article and category templates.
This works perfectly when viewing the article under its category, but when viewed on the main page, I see everything except what category it is posted to. |
|
Back to top |
|
|
justcurious Guest
|
Posted: Fri Feb 04, 2005 11:18 am Post subject: clarification |
|
|
I am sorry (again!)...the code does NOT display the category the topic is posted to except when you click on the permanent link, and under that page..
I am afraid I am confused about which templates affect which views of the page. |
|
Back to top |
|
|
john Site Admin
Joined: 16 Mar 2004 Posts: 3434
|
Posted: Fri Feb 04, 2005 2:24 pm Post subject: Re: clarification |
|
|
the code does NOT display the category the topic is posted to except when you click on the permanent link, and under that page..
The article.categories loop which is available for use when the article is shown via its Permanent Link is not accessible to the category template. So it is not possible to use the "Posted to XYZ categories" code from the article template on the category template.
I am afraid I am confused about which templates affect which views of the page.
The article template affects the view of the article at its permanent link, where the article is displayed by itself along with its comments and trackbacks.
The category template affects the way the article is displayed in a category such as your Main Page. |
|
Back to top |
|
|
curiousike Guest
|
Posted: Fri Feb 04, 2005 4:48 pm Post subject: |
|
|
Thank you again for all the help. Sorry to keep coming back with more questions, but there some other way I can display on the main page which category an article has been posted to? |
|
Back to top |
|
|
john Site Admin
Joined: 16 Mar 2004 Posts: 3434
|
Posted: Sat Feb 05, 2005 12:09 am Post subject: |
|
|
In the context of the category, only the label of the current category being viewed is available as a variable. The list of other categories to which an article might be posted is not available. |
|
Back to top |
|
|
Search all BlogHarbor support resources.
|
View previous topic :: View next topic |
|
|
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
|
|