Categories > TinyButStrong general >

Jooma + TBS, issue with Joomla Article Print

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: Bruce Decker
Date: 2009-08-18
Time: 05:38

Jooma + TBS, issue with Joomla Article Print

Hi All:
I've been working away with Joomla and TBS to create a concept for a product I want to build.  I'm very pleased with TBS. 

I have created TBS external scripts that I call from my Joomla articles.  The script is creating TBS MergeBlock arrays.  The arrays contain data as well as hyperlinks that I build using Joomla JURI classes.  As part of the hyperlink, I add some URI variables (i.e.  http:/foo.bar?var1=123?var2=234).  The page I call with the hyperlink calls another external script that also reads the URI to get these values that the script uses to populate more TBS mergeblocks.  It all works very well.

However, when I click the Joomla 'Print' icon in the article, it opens a new window and loses the additional URI variables I added.  This is probably a Joomla question more than a TBS question but I wondered if anyone else has run into this and what solution might work.
By: Bruce Decker
Date: 2009-08-18
Time: 06:58

Re: Jooma + TBS, issue with Joomla Article Print

I came up with a joomla hack to get me by until I learn more about Joomla and the proper way to pass vars (if I'm doing it wrong).  The hack below is everything between the <hack> and </hack> comments withing the code.

Joomla 1.5.12
in: joomlaroot/components/com_content/helpers/icon.php

$url .= '&id='.$article->slug.'&tmpl=component&print=1&layout=default&page='.@ $request->limitstart;
        // <hack> by bdd
        $bdduri           =& JFactory::getURI();
        $bdduristring    =  $bdduri->toString();
        $bdduriinstance =& JURI::getInstance( $bdduristring );
        $bddquery        =  $bdduriinstance->getQuery();
        $url .= $bddquery;
        // </hack> by bdd
        $status = 'status=no,toolbar=no,scrollbars=yes,titlebar=no,menubar=no,resizable=yes,width=640,height=480,directories=no,location=no';
By: Skrol29
Date: 2009-08-18
Time: 16:07

Re: Jooma + TBS, issue with Joomla Article Print

Hi Bruce,

Another solution could be to save and retrieve your parameters in the current user session.

By: Bruce Decker
Date: 2009-08-24
Time: 21:36

Re: Jooma + TBS, issue with Joomla Article Print

Thanks Skrol.  I think your suggestion is good and would definitely solve problems related to passing info.  But I also wanted the solution to support Joomla's built in 'email' icon on articles.  I thought it would be nice to allow users to display an article that is fed in part by TBS then click on the 'email' icon to email it.  If I pass variables through session, I think the recipient of the email will not have access to those session variables and therefore the script might display the wrong/no info.  So, I hacked one script in /components/com_content/helpers/icon.php.  The icon part of this script builds a nested hyperlink.  This link was built by Joomla's article route function and since it was not expecting extra URI variables, it never built them into the encoded URL that it passes in the email.  So, I modified the email part so that it now gets the current URI and adds any non-existing queries to the URI before encoding it into the link. This works well and allows print and email to work. 

I'm new to this stuff so please feel free to smack me if you see a waterfall downstream to which I am completely oblivious.

Thanks again for all of your help.

TBS is a phenomenal product!
By: Skrol29
Date: 2009-08-24
Time: 23:02

Re: Jooma + TBS, issue with Joomla Article Print

Hi Bruce,

Did you tried the last version of the plugin ?
It is not announced yet, but already available for download.

By: Bruce Decker
Date: 2009-08-24
Time: 23:34

Re: Jooma + TBS, issue with Joomla Article Print

Oh Baby!  Just read the changelog!  Going to have to upgrade now.  Don't understand everything from the changelog but I have a gut feeling it is exactly what I need!

Thanks Skrol!
-BD