View previous topic :: View next topic |
Author |
Message |
fmkatz
Joined: 25 Jan 2006 Posts: 7
|
Posted: Mon Feb 20, 2006 1:16 am Post subject: Making the left column go away on article pages? |
|
|
Hi,
I am using a three column layout. The left column contains (mainly) the list of categories and I would rather not have that appear on the pages for
individual articles. In fact, I would like to "reclaim" that space for the article.
Is that possible? Any suggestions on how to do it would be appreciated.
Thanks,
Fred Katz
amazonseyes.com |
|
Back to top |
|
|
john Site Admin
Joined: 16 Mar 2004 Posts: 3434
|
Posted: Tue Feb 21, 2006 12:49 pm Post subject: Re: Making the left column go away on article pages? |
|
|
Yes, this would be possible by customizing your base template. This thread has instructions for modifying your base template.
What we're going to do is use our scripting language to test for the existence of a variable that only appears in an article and not in a category. If that variable has a value, we won't show the left column.
Look for the following code in your base template:
Code: | {{if blog.left_sidebar}}
<!-- START LEFT COL -->
<td class="left">
<div id="leftcol">
{{loop blog.left_sidebar}}
{{content}}
{{/loop}}
</div> <!-- leftcol -->
</td>
<!-- END LEFT COL -->
{{/if}} |
That's the code that creates your left sidebar. It says if blog.left_sidebar exists, then show the left column. (For one column blogs or two column narrow on right blogs, blog.left_sidebar will be empty.)
To only show the left column on an article page, change that code to the following:
Code: | {{if blog.left_sidebar}}
{{unless article_breadcrumbs}}
<!-- START LEFT COL -->
<td class="left">
<div id="leftcol">
{{loop blog.left_sidebar}}
{{content}}
{{/loop}}
</div> <!-- leftcol -->
</td>
<!-- END LEFT COL -->
{{/unless}}
{{/if}} |
What that did was change the logic a bit by adding an unless statement {{unless article_breadcrumbs}}. Since the variable article_breadcrumbs only exists on article pages, the left column will only be displayed on category pages and not on any category pages. |
|
Back to top |
|
|
fmkatz
Joined: 25 Jan 2006 Posts: 7
|
Posted: Tue Feb 21, 2006 1:30 pm Post subject: |
|
|
Just perfect. Worked like a charm. Now when I view the articles in
FeedDemon, I can see the content.
Thanks much,
Fred |
|
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
|
|