Recent Topics

1 Oct 13, 2009 12:41    

My b2evolution Version:

Just a simple question:

I want to install a counter for pages (not for posts). Is there a possibility of integrating that? I want to make sure that the normal external counter I have on my post pages, category pages, etc. doesn't count the pages of the "page" type and vice versa.

Any ideas?

Thanks in advance!

2 Oct 13, 2009 14:02

Oh I forgot: My counter tag for all pages is in the footer template.

3 Oct 13, 2009 14:30

Look for your skin file "page.main.php" and put your counter way down at the bottom so it will appear like it was still in your footer file.

That is the quick and easy method ;)
The "cool" method is adding a new container somewhere in that same file.

Example of a container


	<?php
		// ------------------------- "Sidebar" CONTAINER EMBEDDED HERE --------------------------
		// Display container contents:
		skin_container( NT_('Counter Container'), array(
				// The following (optional) params will be used as defaults for widgets included in this container:
				// This will enclose each widget in a block:
				'block_start' => '<li id="$wi_ID$" class="$wi_class$"><div class="sidebarbox">',
				'block_end' => '</div> <!-- end of class="sidebarbox" --></li>',
				// This will enclose the title of each widget:
				'block_title_start' => '<h2>',
				'block_title_end' => '</h2>',
				// If a widget displays a list, this will enclose that list:
				'list_start' => '<ul>',
				'list_end' => '</ul>',
				// This will enclose each item in a list:
				'item_start' => '<li>',
				'item_end' => '</li>',
				// This will enclose sub-lists in a list:
				'group_start' => '<ul>',
				'group_end' => '</ul>',
				// This will enclose (foot)notes:
				'notes_start' => '<div class="notes">',
				'notes_end' => '</div> <!-- end of class="notes" -->',
			) );
		// ----------------------------- END OF "Sidebar" CONTAINER -----------------------------
	?>

Then go to your dashboard.
Reload the skin (so it will add your new container).
Go to the widgets section of your blog(s).
Add a Free HTML Widget to the container (we named above as) "Pages Counter Container"

Simply repeat the process and do the same for the following files:
posts.main.php <-- for your blogs main page (ie it lists your posts)
single.main.php <-- for each individual article
index.main.php <-- for everything else (categories, tags, profile, etc.)

^_^

Hope that helps!!

4 Oct 13, 2009 16:08

Thanks a lot for your!! I'll try that later in the evening!

5 Mar 06, 2010 11:32

It's been some time and I learned how to implement a container - great! That made it possible to customize even more things!

I now have a question concerning the contact form and the widget container: It seems that the contact page is similiar to a post page oder index page - at least the container of my posts, single and main appears on the contact page. I would like the container of my page container appears there. Is that possible?

6 Mar 06, 2010 11:44

Add: I thought that the template for the contact form was the single.main.php - but it seems that that's not the right template.

7 Mar 06, 2010 17:39

index.main.php is for the contact form


Form is loading...