Jump to content
Sign in to follow this  
mobbbx

Box Links with qtranslate

Recommended Posts

mobbbx

I need help to make the box/soapboxes links to be able to get the language parameter from the url (eg: ?lang=en) in fact, i was hoping that i can put the following code into the box link textbox.

< a href="<?php echo qtrans_convertURL('/?lang=en'); ?>" >Link </ a>
I looked at the section.boxes.php and saw that sprintf function is used. My guess is that with sprintf function, the box link returns a string, therefore the
<?php echo qtrans_convertURL('/?lang=en'); ?> 

is treated as string. Maybe create a box link media? just like the banners media where i can put the code in. thanks!

Share this post


Link to post
Share on other sites
mobbbx

I've tried to add another plugin "WP exec PHP" (does not require to disable visual editor) that does allows us to insert php code into posts, pages, widget using [exec][/exec] I manage to successfully insert php code

[exec]echo "Hello World" ;[/exec]

in the content section of a page. But by inserting the same code into the box (regardless the content section or the box link section), the php code is rendered as text. Thanks!

Share this post


Link to post
Share on other sites
mobbbx

Just to add, i've also tried exec-php plugin. the results are the same. <

?php echo "Hello World" ; ?>

works in a regular page content section, but not in the box content section or the box link. Btw i'm using platformbase 1.3.1 thanks!

Share this post


Link to post
Share on other sites
mobbbx

ok. i have accomplished what i wanted by editing the section.boxes.php and section.soapbox.php FYI, i'm making a dual language site, using qtranslate plugin. Everything is good because qtranslate picks up the lang selection, except for the box links or the soapbox links. trying the plugins (exec-php, etc) does not help. so i have to edit the php files directly. For section.boxes.php: FROM->

<div class="fboxtitle">
	<h3>
	<?php if($box_link) printf('%s', $box_link, $bpost->post_title );
									else echo do_shortcode($bpost->post_title); ?>
									</h3>
								</div>[/code]

	
	TO -> 
[code]<div class="fboxtitle"> <h3> <?php if(qtrans_getLanguage() == "en") if($box_link) printf('%s', $box_link, $bpost->post_title ); else echo do_shortcode($bpost->post_title); else if(qtrans_getLanguage() == "id") if($box_link) printf('%s', $box_link, $bpost->post_title ); else echo do_shortcode($bpost->post_title); ?></h3>

I also changed "function _get_box_image" in the section.boxes.php For section.soapbox.php, there's 2 sections to be changed as well. 1 under the "soapbox_link" class and another the "fboxgraphic" class So basically add php if function into the php file. Hope it helps.

  • Like 1

Share this post


Link to post
Share on other sites
mobbbx

I was wondering is there a way to build a custom section or something in platformbase so that the original boxes.php and soapbox.php is not touched while making the links reflect language choices. any advice?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

×