Recent Topics

1 Aug 11, 2010 21:32    

My b2evolution Version: Not Entered

Hi,

i´m running a stripped stub file inside an iframe that displays the last 3 posttitles and dates. I use a modified skin.
I want the links in that iframe to open the posts inside a content iframe.

I found some posts about using jquery but i´m not fluent enough in jquery to be able to modify the examples to my needs.

I pasted this in the _body_footer.inc.php

require_js( '#jquery#' );

<?php
    <script>$('a[href^="http://"]')
  .attr("target", "content");</script>
<?php } ?>

Anyone able to help?

2 Aug 11, 2010 22:02

Just a guess, as I use something similar for opening certain links in a new window, so something like??:

<script type="text/javascript">
    /* <![CDATA[ */
    jQuery(function(){
        jQuery("a[href^='http:']").attr("target", "your_target");
    });
    /* ]]> */
</script>

But you definitely don't want it between php tags.

3 Aug 11, 2010 22:15

Have you also put in in the footer? It's still not working.
Mine looks like this now:

<?php
/**
 * This is the footer include template.
 *
 * For a quick explanation of b2evo 2.0 skins, please start here:
 * {@link http://manual.b2evolution.net/Skins_2.0}
 *
 * This is meant to be included in a page template.
 *
 * @package evoskins
 * @subpackage natural_pink
 */
if( !defined('EVO_MAIN_INIT') ) die( 'Please, do not access this page directly.' );
?>

require_js( '#jquery#' );

<script type="text/javascript">
    /* <![CDATA[ */
    jQuery(function(){
        jQuery("a[href^='http:']").attr("target", "content");
    });
    /* ]]> */
</script> 

<!-- =================================== START OF FOOTER =================================== -->

4 Aug 11, 2010 22:29

No, I put mine in the header. I'm assuming "Page Speed" has convinced you to move your scripts to the bottom of the page to help parallel downloads. ;)

In your last example, you need to move the "require_js( '#jquery#' )" statement inside the php tags.

5 Aug 12, 2010 09:30

Still not working. This is my complete index.main.php

<?php

/**

 * This is the main/default page template.

 *

 * For a quick explanation of b2evo 2.0 skins, please start here:

 * {@link http://manual.b2evolution.net/Skins_2.0}

 *

 * It is used to display the blog when no specific page template is available to handle the request.

 *

 * @package evoskins

 * @subpackage asevo

 *

 * @version $Id: index.main.php,v 1.9.2.2 2008/04/26 22:28:53 fplanque Exp $

 */

if( !defined('EVO_MAIN_INIT') ) die( 'Please, do not access this page directly.' );



if( version_compare( $app_version, '2.4.1' ) < 0 )

{ // Older 2.x skins work on newer 2.x b2evo versions, but newer 2.x skins may not work on older 2.x b2evo versions.

	die( 'This skin is designed for b2evolution 2.4.1 and above. Please <a href="http://b2evolution.net/downloads/index.html">upgrade your b2evolution</a>.' );

}



// This is the main template; it may be used to display very different things.

// Do inits depending on current $disp:



skin_init( $disp );



// -------------------------- HTML HEADER INCLUDED HERE --------------------------

skin_include( '_html_header.inc.php' );

// Note: You can customize the default HTML header by copying the

// _html_header.inc.php file into the current skin folder.

// -------------------------------- END OF HEADER --------------------------------

require_js( '#jquery#' ); 

?>

<script type="text/javascript">
    /* <![CDATA[ */
    jQuery(function(){
        jQuery("a[href^='http:']").attr("target", "content");
    });
    /* ]]> */
</script> 

<div class="main_zone">



<div class="evo_main_area">

	<?php

		// ------------------------- MESSAGES GENERATED FROM ACTIONS -------------------------

		messages( array(

			'block_start' => '<div class="action_messages">',

			'block_end'   => '</div>',

		) );

		// --------------------------------- END OF MESSAGES ---------------------------------

	?>



	<?php

		// ------------------- PREV/NEXT POST LINKS (SINGLE POST MODE) -------------------

		item_prevnext_links( array(

				'block_start' => '<table class="prevnext_post"><tr>',

				'prev_start'  => '<td>',

				'prev_end'    => '</td>',

				'next_start'  => '<td class="right">',

				'next_end'    => '</td>',

				'block_end'   => '</tr></table>',

			) );

		// ------------------------- END OF PREV/NEXT POST LINKS -------------------------

	?>



	<?php

		// ------------------------- TITLE FOR THE CURRENT REQUEST -------------------------

		request_title( array(

				'title_before'=> '<h2 class="evo_req_title">',

				'title_after' => '</h2>',

				'title_none'  => '',

				'glue'        => ' - ',

				'title_single_disp' => false,

				'format'      => 'htmlbody',

			) );

		// ------------------------------ END OF REQUEST TITLE -----------------------------

	?>



	<!-- =================================== START OF MAIN AREA =================================== -->



	<?php // ------------------------------------ START OF POSTS ----------------------------------------

		// Display message if no post:

		display_if_empty();



		while( $Item = & mainlist_get_item() )

		{	// For each blog post, do everything below up to the closing curly brace "}"

		?>

		<div id="<?php $Item->anchor_id() ?>" class="evo_post evo_post<?php $Item->status_raw() ?>" lang="<?php $Item->lang() ?>">



			<?php

				$Item->locale_temp_switch(); // Temporarily switch to post locale (useful for multilingual blogs)

			?>



			<?php

				$Item->edit_link( array( // Link to backoffice for editing

						'before'    => ' ',

						'after'     => ' ',

						'class'     => 'floatright small'

					) );

			?>



			<h1 class="evo_post_title"><?php $Item->title(); ?></h1>



			<div class="evo_post_head">

			<?php

				$Item->permanent_link( array(

						'text' => '#icon#',

					) );



				$Item->issue_date( array(

						'before'      => ' ',

						'after'       => ' ',

						'date_format' => '#',

					) );



				$Item->issue_time( array(

						'time_format' => 'H:i',

					) );



				$Item->categories( array(

					'before'          => ' | ',

					'after'           => ' ',

					'include_main'    => true,

					'include_other'   => true,

					'include_external'=> true,

					'link_categories' => true,

				) );



				// List all tags attached to this post:

				$Item->tags( array(

						'before' =>         ', '.T_('Tags').': ',

						'after' =>          ' ',

						'separator' =>      ', ',

					) );

			?>

			</div>			



			<?php

				locale_restore_previous();	// Restore previous locale (Blog locale)

			?>

		</div>



	<?php } // ---------------------------------- END OF POSTS ------------------------------------ ?>



	

	<?php

		// -------------- MAIN CONTENT TEMPLATE INCLUDED HERE (Based on $disp) --------------

		skin_include( '$disp$', array(

				'disp_posts'  => '',		// We already handled this case above

				'disp_single' => '',		// We already handled this case above

				'disp_page'   => '',		// We already handled this case above

			) );

		// Note: you can customize any of the sub templates included here by

		// copying the matching php file into your skin directory.

		// ------------------------- END OF MAIN CONTENT TEMPLATE ---------------------------

	?>



</div>

</div>



<?php

// ------------------------- BODY FOOTER INCLUDED HERE --------------------------

skin_include( '_body_footer.inc.php' );

// Note: You can customize the default BODY footer by copying the

// _body_footer.inc.php file into the current skin folder.

// ------------------------------- END OF FOOTER --------------------------------

?>



<?php

// ------------------------- HTML FOOTER INCLUDED HERE --------------------------

skin_include( '_html_footer.inc.php' );

// Note: You can customize the default HTML footer by copying the

// _html_footer.inc.php file into the current skin folder.

// ------------------------------- END OF FOOTER --------------------------------

?>

6 Aug 12, 2010 09:31

You need your require_js( '#jquery#') to come before your header include

¥


Form is loading...