I'm building a two-column replacement for my current site's three-column display. All was looking good, except for articles that had "Read More" links. When I viewed the full text of the article, I would get three columns - the left side blocks, the article/comments block, and two blocks on the right side. One of these is the "What's Related" block, the other is the "Story Options" block. I wanted them gone. With some help (OK, tons of help!) from Dirk, we've now accomplished the objective.
The following changes will remove these two blocks and the additional column they reside in from your pages. They will bring back the "story options" functionality by displaying the same icons that are used on the "intro text only" views, but you will lose the "What's Related" block. To me, that's not a big deal. Here's how to do it...
- In article.php, find this line:
Text Formatted Code
$story_template->set_var('site_url', $_CONF['site_url']);
Insert a
/* in front of it, to start a comment block. A few rows further down, find this line:
Text Formatted Code
.COM_endBlock());
Insert a
*/ at the end to end the comment block. This change removes the two blocks entirely.
In article.thtml (inside the article folder in your theme folder), add a "<!--" comment marker in front of the first <td> tag, and a "-->" end comment marker at the very end of the file. This removes the spacer column and the column reserved for the blocks we're removing.
There's still a dangling </td> to be found, as it's not located in article.thtml. Instead, you'll find it in footer.thtml, as the second line of the file (just below the comment). Add comment tags (<!--, -->
around the </td> tag to disable it.
The last step is to get the email and print icons back in the story, where they originally appeared. I thought this would be the hardest step, but it's actually trivial. Open lib-common.php, and move to the COM_article() function (line 307 in my modified lib-common). Within COM_article(), find the "
if ( $index == 'n' ) section, which will consist of only two lines. We need to add two more lines before the closign
} tag, and we're going to steal them from the "index == 'y'" section. The two lines start as follows (trimmed here for display purposes):
Text Formatted Code
$article->set_var( 'email_icon', '<a href="' .....
$article->set_var( 'print_icon', '<a href="' ....
Copy both of these lines (the whole lines, of course), and paste them just above the closing
} tag in the "index == 'n'" section.Save all your changes, and then load a full-text article and admire your handiwork!
Thanks again to Dirk for 99.5% of the effort on this one!
-rob.