Removing Top 10 when viewing FAQ

In this board you can talk about general questions about phpMyFAQ

Moderator: Thorsten

Post Reply
ardiederich
Posts: 55
Joined: Tue Aug 10, 2004 3:02 pm

Removing Top 10 when viewing FAQ

Post by ardiederich »

(I thought I had seen this posted before, but can't find it now.) The gist was that when you are viewing the contents of a FAQ you really don't need the Top 10 list on the right. It just gets in the way, and for smaller screens makes the center column really, really small.

I'd like the Top 10 and 5 most recent only on the front page, or perhaps on the front page and category lists page.

--
Andrew Diederich
Thorsten
Posts: 15739
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Post by Thorsten »

Hi,

just move the XHTML code for the Top10 and the latest records from index.tpl to main.tpl.

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
twinbros
Posts: 9
Joined: Sun Sep 19, 2004 9:10 am

Post by twinbros »

Can you give the code? I am not coder.
twinbros
Posts: 9
Joined: Sun Sep 19, 2004 9:10 am

Post by twinbros »

Done, thank you, no need to reply
huschi
Posts: 5
Joined: Mon Dec 12, 2005 10:28 pm
Location: Germany
Contact:

Re: Removing Top 10 when viewing FAQ

Post by huschi »

ardiederich wrote:I'd like the Top 10 and 5 most recent only on the front page, or perhaps on the front page and category lists page.
So do i. But i don't like the solution above, because, it should be seen on every page except of the article's. And only, if the Window is to small to view both.

I worked out an answer using JavaScript/DOM:

To get the centercolumn faster, i set an ID-Attribute to the div-Tag in index.tpl:

Code: Select all

<div class="centercolumn" id="centercolumn">
After that, i added following lines to artikel.tpl:

Code: Select all

<script type="text/javascript">
	width = 0;
	if (window.innerWidth) {
		width = window.innerWidth;
	} else if (document.body && document.body.offsetWidth) {
		width = document.body.offsetWidth;
	}
	if ((width == 0) || (width < 1000)) {
		if (document.getElementById) {
			document.getElementById('sidebar-right').style.display = 'none';
			document.getElementById('centercolumn').style.marginRight = '10px';
		}
	}
</script>
I put it at the begining, because of using the CODE-Tag extensive and the IE will going nut.

huschi.
huschi.net - seltene und seltsame Probleme bei der Server-Administration
Holgate
Posts: 12
Joined: Tue Jul 12, 2005 4:57 pm

Create new page for Top 10 & 5 Most Recent

Post by Holgate »

I'd like all pages to present only the info they feature - like for 'Home' to be just the News page (by removing top 10 and 5 recent from index.tpl).

Then I'm trying to create a new page only for the Top 10 & 5 Most Recent, with a menu link in the category list. I tried to add {writeTopTenRow} to the sitemap.tpl code to see if I could modify an existing page, but it does not generate the top ten list.

I think I can figure this out with a little assistance... ?!!
Thorsten
Posts: 15739
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Post by Thorsten »

Hi,

just take a look at main.php how the template variables will be added.

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
Holgate
Posts: 12
Joined: Tue Jul 12, 2005 4:57 pm

Create new page for Top 10 & 5 Most Recent

Post by Holgate »

ok... but would this apply to sitemap.php, sitemap.tpl, or a new page I create from using main.php as a guide?


!!!!!!!!!!!!!!!!!!
Edit
!!!!!!!!!!!!!!!!!!

Ah, yes... so it's applied to both:

The

Code: Select all

{writeTopTenRow}
is placed in the sitemap.tpl (or a new page), and the variables you noted from main.php

Code: Select all

'writeTopTenHeader' => $PMF_LANG['msgTopTen'],
'writeTopTenRow' => generateTopTen($LANGCODE),
are copied into sitemap.php (or a new page).

I believe this is now working fine within the existing sitemap.tpl & .php with the existing 'Sitemap' category link - now I'll try to create a unique new page for the Top 10 and 5 Recent together, with a new link in the category list.

Thanks for your work & assistance.
Thorsten
Posts: 15739
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Post by Thorsten »

Hi,

yes, that's right.

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
Post Reply