Recent Topics

1 Apr 08, 2008 22:19    

My b2evolution Version: 2.x

Just upgraded smoothly from to 1.10.3 to 2.4.1.

The only thing I still need to do is upgrade my skin to include a menu bar at the top of every blog page that allows access to the rest of my site.

Under 1.10.3, I added the following code in the _main.php of the skin template:

in the head section


<!-- addition Son DHTML Menu -->
<div align="center">
  <script type="text/javascript" language="JavaScript1.2" src="http://www.dophan.com/_pgtres/stm31.js"></script>
</div>
<!-- end addition Son DHTML Menu -->

and in the body section


<!-- addition Son DHTML Menu -->
<div align="center">
  <script type="text/javascript" language="JavaScript1.2" src="http://www.dophan.com/_pgtres/mainmenu.js"></script>
</div>
<!-- addition Son DHTML Menu -->

I could not figure out how to do this with the skins available under 2.4.1.
I tried to manually edit the index.main.php of a skin but this did not work

The menubar is visible at www.dophan.com

Can somebody pls help?

Thanks

2 Apr 09, 2008 01:15

The head section part goes in /skins/[your skin]_html_header.inc.php (don't put <div> tags there)

The body section may go in _body_header.inc.php or index.main.php

What skin are you using?

3 Apr 09, 2008 21:23

sam2kb wrote:

The head section part goes in /skins/[your skin]_html_header.inc.php (don't put <div> tags there)

The body section may go in _body_header.inc.php or index.main.php

What skin are you using?

Thanks for the note

I am using the following standard skins:
- miami blue
- nifty corners
- asevo
- evocamp

If you show me for one, I guess I can replicate for the others, unless the themes are differently set up.

I already duplicated the skins so I can modify them without destroying the original one.

Thanks

4 Apr 09, 2008 22:10

Add the first code in /skins/_html_header.inc.php

<link rel="stylesheet" href="style.css" type="text/css" />
<!-- addition Son DHTML Menu --> 
<script type="text/javascript" language="JavaScript1.2" src="http://www.dophan.com/_pgtres/stm31.js"></script>
<!-- end addition Son DHTML Menu -->
	<?php include_headlines() /* Add javascript and css files included by plugins and skin */ ?>
	<?php
		$Blog->disp( 'blog_css', 'raw');
		$Blog->disp( 'user_css', 'raw');
	?>

The body section for miami blue, nifty corners, and asevo skins goes in index.main.php . And for evocamp skin in _body_header.inc.php.
Put it right after the menu container, but you will have to edit styles, probably...

<div class="top_menu">
	<ul>
	<?php
		// ------------------------- "Menu" CONTAINER EMBEDDED HERE --------------------------
		// Display container and contents:
		skin_container( NT_('Menu'), array(
				// The following params will be used as defaults for widgets included in this container:
				'block_start' => '',
				'block_end' => '',
				'block_display_title' => false,
				'list_start' => '',
				'list_end' => '',
				'item_start' => '<li>',
				'item_end' => '</li>',
			) );
		// ----------------------------- END OF "Menu" CONTAINER -----------------------------
	?>
	</ul>
</div>
<!-- addition Son DHTML Menu -->
<div align="center">
  <script type="text/javascript" language="JavaScript1.2" src="http://www.dophan.com/_pgtres/mainmenu.js"></script>
</div>
<!-- addition Son DHTML Menu -->

5 Apr 09, 2008 22:39

sam2kb wrote:

Add the first code in /skins/_html_header.inc.php

<link rel="stylesheet" href="style.css" type="text/css" />
<!-- addition Son DHTML Menu --> 
<script type="text/javascript" language="JavaScript1.2" src="http://www.dophan.com/_pgtres/stm31.js"></script>
<!-- end addition Son DHTML Menu -->
	<?php include_headlines() /* Add javascript and css files included by plugins and skin */ ?>
	<?php
		$Blog->disp( 'blog_css', 'raw');
		$Blog->disp( 'user_css', 'raw');
	?>

The body section for miami blue, nifty corners, and asevo skins goes in index.main.php . And for evocamp skin in _body_header.inc.php.
Put it right after the menu container, but you will have to edit styles, probably...

<div class="top_menu">
	<ul>
	<?php
		// ------------------------- "Menu" CONTAINER EMBEDDED HERE --------------------------
		// Display container and contents:
		skin_container( NT_('Menu'), array(
				// The following params will be used as defaults for widgets included in this container:
				'block_start' => '',
				'block_end' => '',
				'block_display_title' => false,
				'list_start' => '',
				'list_end' => '',
				'item_start' => '<li>',
				'item_end' => '</li>',
			) );
		// ----------------------------- END OF "Menu" CONTAINER -----------------------------
	?>
	</ul>
</div>
<!-- addition Son DHTML Menu -->
<div align="center">
  <script type="text/javascript" language="JavaScript1.2" src="http://www.dophan.com/_pgtres/mainmenu.js"></script>
</div>
<!-- addition Son DHTML Menu -->

Thanks a lot for your kind help.

I successfully applied your suggestion to my 4 blogs.

This topic can be closed.

Regards

7 Aug 28, 2009 19:20

I have now upgraded to 3.3.1 and notice that my menu bar no longer appears even though I still use my former modified skin under 2.4.1 as described above.

Should I do the same manual modifications in all the latest skins at /skins/_html_header.inc.php and _body_header.inc.php, same place as described above under 2.4.1?

Thanks

8 Aug 30, 2009 16:03

Ideally you'd move both those files into /skins/your_skin/ and then alter those versions ;)

¥

9 Aug 31, 2009 22:02

Sorry, I'm not sure I understood your advice well, could you pls be more specific? Thanks

10 Sep 01, 2009 01:18

When you customize a skin by editing a skin file you either make sure all your edits are in files b2evolution doesn't know about when you upgrade, or, you set yourself up to lose your edits when you upgrade.

b2evolution knows all about the files in the /skins/ folder. It knows all about the files in (for example) the /skins/custom/ folder too. But it doesn't know anything about the files in /skins/myskinname/ folder :)

So the file(s) you modified in the 2.* version of the /skins/ folder got upgraded. In a perfect world you would have copied that/those file/s from /skins/ to /skins/yourskin/ and made your edits there, THEN made sure your skin folder name was something b2evolution heard of.

This way upgrading would never affect your skin. By the way "myskin" is a great name for a custom skin. I use stupid variations like myskin and myskin2. I also don't upgrade without a detailed analysis of ever teeny tiny little change in every file in the original package, my version of the package, and the new package complete with a spreadsheet tracking diffs but that's a little bit silly eh? Good enough to know "all modified files need to be in a folder b2evo never heard of" :)

11 Sep 01, 2009 20:03

So should I now:
- create a new folder such as /skins/custom/myskin/
- copy the base skin in there and do the same edits as I did for version 2.* (at the same places)?

If yes, can I create as many subdirectories under skin/custom as I have skins?

Thanks

12 Sep 01, 2009 21:11

apassio wrote:

So should I now:
- create a new folder such as /skins/custom/myskin/

Nope. You create a new skin in the skins folder.

/skins/askin/
/skins/custom/
/skins/myskin/
/skins/yourskin/

Many of the files in the /skins/ folder will seem to be duplicated in the /skins/skinname/ folder. The way it works is b2evo looks for /skins/skinname/filename first, and if it isn't there then it looks for /skins/filename. The idea is the files in /skins/ are generic, the files in /skins/yourskin/ are customized.

But don't put the skin-folders inside /custom/ - put them inside /skins/

13 Sep 01, 2009 21:20

So you are telling me that the edits I made under 2.x where overwritten during the upgrade to 3.3.1 because they were under a directory that had the wrong name / a name known to b2evol:

So now I need to create a directory (or several) under skins with a name such as /askin /bskin /cskin and I can copy an existing skin in there, then redo the edits I did once? These skins will not be overwritten in the next upgrade.

If yes, are the edits exactly the same as I did in the past (same place in the same files)?

Thanks

14 Sep 01, 2009 23:53

Yes, and as far as I know if you do the exact same edits you will get the exact same results. DISCLAIMER: I haven't tinkered with 3.* yet so I can't speak from direct experience!

To get some of the cool bits that v3 has you will need to do additional editing in the "skin folders b2evo never heard of", but first I'll bet getting back to where you were is kinda 'the goal' eh?

15 Sep 05, 2009 13:54

Got this solved today. Actually, I had already created new directory names in the skin folder for my customized skins under 2.4.1 (i.e. directory evocamp_links), so these directories were not upgraded when I moved to 3.3.1.

However the file /skins/_html_header.inc.php which contained some of my code (header) was obviously upgraded in the process, so I just re-inserted the code for the header in that file and it now works as expected (did not have to change anything in my skins).

I suppose that everytime /skins/_html_header.inc.php will change with an upgrade, I have to update it again with the code.
This seems to happen only for major upgrades, ie from 2.x to 3.x as I did not have this issue earlier upgrading fro, 2.x.x to 2.x.y

Thanks for the help again.

16 Sep 05, 2009 14:04

Just copy that file into your skins own folder ;)

¥

17 Sep 05, 2009 14:18

Got it now. Copied my modified _html_header.inc.php to each of my custom skin folders that require the header and put back the original _html_header.inc.php from 3.3.1 install package in the skins/folder.
I understand that b2evol will first look for that file in the custom skin folder and if not available there, use the default one in the root skin folder.
Thanks again


Form is loading...