1 isabellegusse May 30, 2006 22:44
3 yabba Jun 02, 2006 10:16
Add this just before </body> in skins/<skin name>/_main.php
<script type="text/javascript">
//<![CDATA[
function doMore()
{
var yMore = document.getElementsByTagName('p');
for( i=0; i < yMore.length; i++)
{
if ( yMore[i].className == 'bMore' )
{
var yLinks = yMore[i].getElementsByTagName( 'a' );
for( z=0; z < yLinks.length; z++)
{
yLinks[z].onclick = function(x) { return yfOpen(this); }
}
}
}
}
function yfOpen( yLink )
{
window.open(yLink.href);
return false;
}
doMore();
//]]>
</script>
¥
4 isabellegusse Jun 11, 2006 01:58
Good good,
Thank you...
But How do i change the css of this window since its keeps the same parameter (witdh=150) as the original page but put it in a big blank page... which look stupid.
Thxs for giving more and more help !
5 edb Jun 11, 2006 02:18
I'm confused. Someone who chooses to "read more" is expecting to stay in your blog, so why open a new window? I get more confused when you ask how to control the size of the window and the style applied because the "read more" link opens your blog using your skin (style). Thus if the hack ¥åßßå provided works for launching new windows I can't see why you would want it to be any different from a visitor who comes to your page from a search engine. In other words: full size, all buttons and toolbars enabled, and using the style sheet your skin calls for.
Can you help me (us I guess) understand this?
6 isabellegusse Jun 11, 2006 02:33
Allright, let's explain it clearly:
I'm not using the blog classical way... Im using the interface of b2evolution to manage a small updatable part (a little stripe) of my main page.
There is a little stripe on your left when you connect to the site which contains short info:
-- Title ---
Bla bla bla (2 lines)
Read more...
-- Title2 ---
Bla bla bla (2 lines)
Read more...
-- Title 3 ---
Bla bla bla (2 lines)
Read more
-------------------
End of the the stripe
Of course I use B2evolution to set, update and display this little stripe...
But If the user is interested to read the whole new post, he just have to
click the Read more and if will show him the post (and only this post he chosed)in a new small window.
My problem at the moment is that this new small windows keeps the CSS setting of the original little stripe which sucks 'cause it will show the whole new post but all sqwoosed (as for the stripe) but in a big empty new window...
Now, What i would like to know (I found how to change the parameters in the code YaBBa gave me to set the windows) is how could I refer this new windows to another CSS style sheet since i'm a beginner using Javascript ?
7 yabba Jun 11, 2006 10:58
change your skin/<skin name>/_main.php stylesheet call to look something like this :-
<link rel="stylesheet" type="text/css" href="<?php echo ( ( isset( $more ) & $more ) ? 'more' : 'style' ); ?>.css" />
Then create more.css with the relevant css for your popup page ;)
¥
Isabelle,
I changed your title to be a tad more specific.
What version are you running?
I'm not a JavaScript guy, but new windows will likely involve JavaScript. You can either modify the PHP file that interprets the <!--more--> (javascript comment) tag ... which would be a core hack and something you would have to remember to drag along when you next upgrade.
OR
You could *probably* write some JavaScript to automatically open any links contained inside a "MORE" classname (the PHP spits out a link with a bookmark, basically), into a new window (which would only require modifications to the _main.php file and no core hacks).
Whichever method you end up choosing, please design it so that users with javascripting turned off, still get the whole post, just not in a pop-up window.
Hopefully some JS gurus will step forward and help