| Joomla! http://forum.joomla.org/ |
|
| JOOMFISH 1.7 Tips & tricks http://forum.joomla.org/viewtopic.php?f=123&t=62827 |
Page 1 of 2 |
| Author: | 55thinking [ Thu May 18, 2006 6:18 pm ] |
| Post subject: | JOOMFISH 1.7 Tips & tricks |
The following tips apply for Joomfish 1.7 stable & joomla 1.0.7. Not tested with other configuration ------------------------------------------------------------------------------------------------------------------------------ TIP 1 - HOW TO LOAD A CSS DEPENDING OF THE LANGUAGE FRONT-END SWITCH ? ------------------------------------------------------------------------------------------------------------------------------ 1. Add the following tag in your template index.php file: This will write CSS files, depending of the selected language: english.css, spanish.css, german.css, italian.css, portuguese.css, etc... 2. If your defaut joomla language is set to english, then leave english.css empty & place it in the /templates/YOUR TEMPLATE NAME/css/ directory. Customize the other css files according to your needs. The most natural use is to change the path to an image file: #whatever { background-image: url("../images/header_german.gif"); for the german.css file } #whatever { background-image: url("../images/header_spanish.gif"); for the spanish.css file } Place the produced CSS files into the /templates/YOUR TEMPLATE NAME/css/ directory THAT's IT ------------------------------------------------------------------------------------------------------------------------------------------------------------------ TIP 2 - HOW TO LOAD AN IMAGE IN YOUR TEMPLATE DEPENDING OF THE LANGUAGE FRONT-END SWITCH ? ------------------------------------------------------------------------------------------------------------------------------------------------------------------ Use the same method lo load images placed in the template (please note that images placed in text are correctly managed with joomfish 1.7 stable): Produce the different images with text, and name them image1_english.gif image1_german.gif image1_spanish.gif etc... THAT's IT --------------------------------------------------------------------------------------------------------------------- TIP 3 - HOW TO LOAD SITE WIDE TITLE, META KEYWORDS & DESCRIPTION DEPENDING OF THE LANGUAGE FRONT-END SWITCH ? ---------------------------------------------------------------------------------------------------------------------- This one is a bit more tricky. We will need a core hack 1. Open includes/joomla.php file Go to line 470 & 471 replace $this->_head['title'] = $title ? $GLOBALS['mosConfig_sitename'] . ' - '. $title : $GLOBALS['mosConfig_sitename']; by // $this->_head['title'] = $title ? $GLOBALS['mosConfig_sitename'] . ' - '. $ //title : $GLOBALS['mosConfig_sitename']; $this->_head['title'] = $title ? _SITENAME . ' - '. $title : $GLOBALS['mosConfig_sitename']; 2. Open includes/frontend.php file Go to line 166/167 and replace $mainframe->appendMetaTag( 'description', $mosConfig_MetaDesc ); $mainframe->appendMetaTag( 'keywords', $mosConfig_MetaKeys ); by //$mainframe->appendMetaTag( 'description', $mosConfig_MetaDesc ); //$mainframe->appendMetaTag( 'keywords', $mosConfig_MetaKeys ); $mainframe->appendMetaTag( 'description', _METADESC ); $mainframe->appendMetaTag( 'keywords', _METAKEYS ); 3. Add the following variables in your different language files (/languages/) define( '_SITENAME', 'whatever here' ); define( '_METADESC', 'whatever here' ); define( '_METAKEYS', 'whatever here' ); THAT's IT This should work, and not erase dynamic titling & meta keywords&description per page appending --------------------------------------------------------------------------------------------------------------------- TIP 4 - HOW TO LOAD A MODULE DEPENDING OF THE LANGUAGE ---------------------------------------------------------------------------------------------------------------------- MODULE - http://forum.joomla.org/index.php/topic ... #msg329684 http://www.designguru.org to load language-specific modules --> if ($mosConfig_lang== english ) {mosLoadModules ( 'inside_r', -2 );} ?> if ($mosConfig_lang== french ) {mosLoadModules ( 'inside_rfr', -2 );} ?> Feel free to add your own tips in the thread below!!! NEXT PENDING ISSUE FOR ME IS NOW A FULL COMPATIBILITY BETWEEN JOOMFISH & OPEN-SEF |
|
| Author: | eyezberg [ Thu May 18, 2006 8:34 pm ] |
| Post subject: | Re: JOOMFISH 1.7 Tips & tricks |
muy! lindo seƱor, this is going to be SO usefull for many site designers! Do you mind if this gets "fished" into french and posted on joomla.fr (credits given of course)? |
|
| Author: | 55thinking [ Fri May 19, 2006 6:55 am ] |
| Post subject: | Re: JOOMFISH 1.7 Tips & tricks |
No need to ask go ahead |
|
| Author: | akede [ Fri May 19, 2006 8:10 am ] |
| Post subject: | Re: JOOMFISH 1.7 Tips & tricks |
Very well done 55, just one side note. In some circumstances the $mosConfig_lang variable isn't directly accessable in the template. In that case you need to make sure the template script knows it by using a: global $mosConfig_lang; prior the first use. about TIP 3: The more effective and cleaner solution would be to overwrite those variables (e.g $mosConfig_sitename) within your language file. The a bit crapy thing is - you would need to create a new instance of the $mainframe object or set the head array manually. But I would prefer this solution as it is less changes in core files. Alex |
|
| Author: | designguru [ Tue May 23, 2006 6:55 pm ] |
| Post subject: | Re: JOOMFISH 1.7 Tips & tricks |
Hey Guys, I'm glad to see some of my innovations are being found useful ![]() Something else I want to use on this french-english site is a cookie that stores a user's language preference once they choose which one they want (currently I have that stored in a splash html file ie. http://www.kendryden.ca/index.html ) Anyone made such a cookie yet? q./ |
|
| Author: | akede [ Wed May 24, 2006 8:14 am ] |
| Post subject: | Re: JOOMFISH 1.7 Tips & tricks |
This cookie is already set by the Joom!Fish. It's set per computer/browser of course. Joomla! 1.5 will provide language selection per user, which is then stored in the user profile. Alex |
|
| Author: | Robin [ Thu May 25, 2006 5:08 am ] |
| Post subject: | Re: JOOMFISH 1.7 Tips & tricks |
Hi 55, I am going to sticky this topic, very valuable. Thanks! Would it be okay if we take (some) these tips and put them on our wiki site? See http://forge.joomla.org/sf/wiki/do/view ... TipsTricks Regards Robin |
|
| Author: | hermoye [ Fri Sep 01, 2006 11:49 am ] |
| Post subject: | Re: JOOMFISH 1.7 Tips & tricks |
Hi, Thans for your tips. I tried to use "TIP 3 - HOW TO LOAD SITE WIDE TITLE, META KEYWORDS & DESCRIPTION DEPENDING OF THE LANGUAGE FRONT-END SWITCH ?". Actually, it seems to work only on some pages, and not on the home page. I tried to also change joomla.php line 422: "$this->_head['title'] = $GLOBALS['mosConfig_sitename'];" -> "$this->_head['title'] = _SITENAME; " but the problem is that language file has not been read yet when this line is executed. So it displays "_SITENAME". I tried to put put : "include_once( $mosConfig_absolute_path .'/language/' . $mosConfig_lang . '.php' );" before the call to : $mainframe = new mosMainFrame( $database, $option, '.' ); in index.php Then _SITENAME is replaced, but the titles remains only in the default language. Do you have any idea to solve this problem ? Thanks, Laurent |
|
| Author: | akede [ Wed Sep 13, 2006 7:16 am ] |
| Post subject: | Re: JOOMFISH 1.7 Tips & tricks |
Hi, just a short questions? Are those hints already implemented in our WIKI? Thx Alex |
|
| Author: | Robin [ Thu Sep 14, 2006 6:04 pm ] |
| Post subject: | Re: JOOMFISH 1.7 Tips & tricks |
Hi Alex, I have asked 55 once, but he never replied. Seemed only fair to ask him first
|
|
| Author: | fire2006 [ Sun Sep 17, 2006 4:33 pm ] |
| Post subject: | how can I integrate joomfish with a 3rd party component? |
Woah, very cool tips! Thanks! 1) Does anyone know of any documentation that explains how to make a 3rd party app joomfish-able? I am using a great calendar component by http://www.extrosoft.com/ called Thyme Calendar. Problem is, it is not multi-language programed... and I have 3 different asian audiences viewing my website. 2) How, therefore, can I hack thyme to use Joomfish's language files for calendar dates etc? 3) Also, how can I make the calendars content to allow for multiple translations through joomfish? Please help shed some light! thanks so much! |
|
| Author: | dweezil99 [ Fri Oct 06, 2006 9:24 am ] |
| Post subject: | Re: JOOMFISH 1.7 Tips & tricks |
Tip #1 should I really 'add' the tag after the existing css include tag? |
|
| Author: | uniterre [ Wed Oct 11, 2006 12:20 pm ] |
| Post subject: | Re: JOOMFISH 1.7 Tips & tricks |
Please, how TO LOAD A CONTENT ITEM DEPENDING OF THE LANGUAGE ? with Joomfish, is it possible to select just the ID of a content item in the translation page ? So we don't translate the content but we switch to another content item. Thanks, Alexandre |
|
| Author: | infograf768 [ Wed Oct 11, 2006 2:11 pm ] |
| Post subject: | Joomfish, the pathway tip |
Thought I would share with you this code to get a language-dependant pathway in a Joomfish site: Just add in your template where you want the pathway to display, the following lines (here for French and English). Code: <?php if($mosConfig_lang == 'english') { echo '<div id="pathwaynest" align="left"><p class="pathwaytext">You are here: '; include "pathway.php"; echo '</p></div>'; }?> <?php if($mosConfig_lang == 'french') { echo '<div id="pathwaynest" align="left"><p class="pathwaytext">Vous êtes ici : '; include "pathway.php"; echo '</p></div>'; }?> PS: thanks to Pasamio for helping me resolving some issues.
|
|
| Author: | comeback [ Wed Oct 11, 2006 7:30 pm ] |
| Post subject: | Re: JOOMFISH 1.7 Tips & tricks |
really exelent! Just what i needed |
|
| Author: | dweezil99 [ Thu Oct 12, 2006 10:10 am ] |
| Post subject: | Re: JOOMFISH 1.7 Tips & tricks |
Many thanks. |
|
| Author: | marian [ Fri Oct 13, 2006 8:13 am ] |
| Post subject: | Re: JOOMFISH 1.7 Tips & tricks |
55thinking wrote: The following tips apply for Joomfish 1.7 stable & joomla 1.0.7. Not tested with other configuration ------------------------------------------------------------------------------------------------------------------------------ TIP 1 - HOW TO LOAD A CSS DEPENDING OF THE LANGUAGE FRONT-END SWITCH ? ------------------------------------------------------------------------------------------------------------------------------ 1. Add the following tag in your template index.php file: This will write CSS files, depending of the selected language: english.css, spanish.css, german.css, italian.css, portuguese.css, etc... 2. If your defaut joomla language is set to english, then leave english.css empty & place it in the /templates/YOUR TEMPLATE NAME/css/ directory. Customize the other css files according to your needs. The most natural use is to change the path to an image file: #whatever { background-image: url("../images/header_german.gif"); for the german.css file } #whatever { background-image: url("../images/header_spanish.gif"); for the spanish.css file } Place the produced CSS files into the /templates/YOUR TEMPLATE NAME/css/ directory THAT's IT ------------------------------------------------------------------------------------------------------------------------------------------------------------------ TIP 2 - HOW TO LOAD AN IMAGE IN YOUR TEMPLATE DEPENDING OF THE LANGUAGE FRONT-END SWITCH ? ------------------------------------------------------------------------------------------------------------------------------------------------------------------ Use the same method lo load images placed in the template (please note that images placed in text are correctly managed with joomfish 1.7 stable): Produce the different images with text, and name them image1_english.gif image1_german.gif image1_spanish.gif etc... THAT's IT --------------------------------------------------------------------------------------------------------------------- TIP 3 - HOW TO LOAD SITE WIDE TITLE, META KEYWORDS & DESCRIPTION DEPENDING OF THE LANGUAGE FRONT-END SWITCH ? ---------------------------------------------------------------------------------------------------------------------- This one is a bit more tricky. We will need a core hack 1. Open includes/joomla.php file Go to line 470 & 471 replace $this->_head['title'] = $title ? $GLOBALS['mosConfig_sitename'] . ' - '. $title : $GLOBALS['mosConfig_sitename']; by // $this->_head['title'] = $title ? $GLOBALS['mosConfig_sitename'] . ' - '. $ //title : $GLOBALS['mosConfig_sitename']; $this->_head['title'] = $title ? _SITENAME . ' - '. $title : $GLOBALS['mosConfig_sitename']; 2. Open includes/frontend.php file Go to line 166/167 and replace $mainframe->appendMetaTag( 'description', $mosConfig_MetaDesc ); $mainframe->appendMetaTag( 'keywords', $mosConfig_MetaKeys ); by //$mainframe->appendMetaTag( 'description', $mosConfig_MetaDesc ); //$mainframe->appendMetaTag( 'keywords', $mosConfig_MetaKeys ); $mainframe->appendMetaTag( 'description', _METADESC ); $mainframe->appendMetaTag( 'keywords', _METAKEYS ); 3. Add the following variables in your different language files (/languages/) define( '_SITENAME', 'whatever here' ); define( '_METADESC', 'whatever here' ); define( '_METAKEYS', 'whatever here' ); THAT's IT This should work, and not erase dynamic titling & meta keywords&description per page appending --------------------------------------------------------------------------------------------------------------------- TIP 4 - HOW TO LOAD A MODULE DEPENDING OF THE LANGUAGE ---------------------------------------------------------------------------------------------------------------------- MODULE - http://forum.joomla.org/index.php/topic ... #msg329684 http://www.designguru.org to load language-specific modules --> if ($mosConfig_lang== english ) {mosLoadModules ( 'inside_r', -2 );} ?> if ($mosConfig_lang== french ) {mosLoadModules ( 'inside_rfr', -2 );} ?> Feel free to add your own tips in the thread below!!! NEXT PENDING ISSUE FOR ME IS NOW A FULL COMPATIBILITY BETWEEN JOOMFISH & OPEN-SEF help! I am a total newbie to joomla, I am trying to change the language of my site (to Hebrew) - I just dont get it - when you say add... replace... Am I taking the source of the site created by joomla, editing it and then using it as any other website I created before the days of Joomla? can I then go back to Joomla (say to add another category) or will it then only be able to handle its own creations and I will have to re-edit the the lines each time?
|
|
| Author: | Ifrit [ Fri Oct 13, 2006 9:33 am ] |
| Post subject: | Re: JOOMFISH 1.7 Tips & tricks |
akede wrote: Very well done 55, just one side note. In some circumstances the $mosConfig_lang variable isn't directly accessable in the template. In that case you need to make sure the template script knows it by using a: global $mosConfig_lang; prior the first use. I require a bit of help here, I do not fully understand what it is I need to do exactly... I need to use the $mosConfig_lang variable, but it I need to call it in a place that is out of reach, or "not directly accessable in the template", I need to call it on VirtueMart template (browse_1.php template), it's simply not returning anything if I do a Can you help me, Alex? I have a bit of an urgency here
|
|
| Author: | dweezil99 [ Fri Oct 13, 2006 9:44 am ] |
| Post subject: | Re: JOOMFISH 1.7 Tips & tricks |
Regarding TIP 4 - HOW TO LOAD A MODULE DEPENDING OF THE LANGUAGE... Imagine I wanted 2 "Random Image" modules. One picking random English images and one picking random Spanish Images, I could use this tip to do this but how can I install 2 random image modules. Surely they cannot co exist as they will be called the same thing. Any thoughts? |
|
| Author: | akede [ Fri Oct 13, 2006 12:36 pm ] |
| Post subject: | Re: JOOMFISH 1.7 Tips & tricks |
Ifrit wrote: I require a bit of help here, I do not fully understand what it is I need to do exactly... I need to use the $mosConfig_lang variable, but it I need to call it in a place that is out of reach, or "not directly accessable in the template", I need to call it on VirtueMart template (browse_1.php template), it's simply not returning anything if I do a Can you help me, Alex? I have a bit of an urgency here ![]() Just add a global $mosConfig_lang; before the first use. This should make it available in general. I do not know anything about virtualmart, just that there are some special things to have a look on. Have you seen the other threads about it? Alex |
|
| Author: | akede [ Fri Oct 13, 2006 12:39 pm ] |
| Post subject: | Re: JOOMFISH 1.7 Tips & tricks |
dweezil99 wrote: Regarding TIP 4 - HOW TO LOAD A MODULE DEPENDING OF THE LANGUAGE... Imagine I wanted 2 "Random Image" modules. One picking random English images and one picking random Spanish Images, I could use this tip to do this but how can I install 2 random image modules. Surely they cannot co exist as they will be called the same thing. Any thoughts? You do not need to install them. You can copy modules in the module manager. With that you can create more than one instance of the module in your system. BTW: nice idea Alex |
|
| Author: | infograf768 [ Sat Oct 14, 2006 9:02 am ] |
| Post subject: | Re: JOOMFISH 1.7 Tips & tricks |
New soltion for Pathway here: http://forum.joomla.org/index.php/topic ... #msg520940 Enjoy! |
|
| Author: | gg4j [ Thu Oct 19, 2006 2:11 pm ] |
| Post subject: | Re: JOOMFISH 1.7 Tips & tricks |
Tryed the code: if ($mosConfig_lang== italian ) {mosLoadModules ( 'advert1', 0 );} ?> if ($mosConfig_lang== english ) {mosLoadModules ( 'advert3', -1 );} ?> Works, but error reported: Use of undefined variable italian - assumed 'italian' in ..templates\nametemplate\index.php line ... I tryed inserting the line global $mosConfig_lang; above the if declaration, but it's the same.. Why does it say it's an undefined variable (or constant, after global $mosConfig_lang; declaration) if it can properly read it? About the position of modules: is it possible to load the order of modules in the same position horizontally? |
|
| Author: | consigliere [ Fri Oct 20, 2006 10:10 pm ] |
| Post subject: | Re: JOOMFISH 1.7 Tips & tricks |
What is the Joomla Variable to print the ISO language Code? |
|
| Author: | consigliere [ Fri Oct 20, 2006 10:40 pm ] |
| Post subject: | Re: JOOMFISH 1.7 Tips & tricks |
I found it, it wasn't a var, it was a constant, the _LANGUAGE constant. I consider this piece of code very useful to segment sites in search engines depending on the language. The code below is used in the index.php template file. If you are interested, I grab it from http://www.compassdesigns.net/tutorials ... orial.html Code: <html xmlns="http://www.w3.org/1999/xhtml" lang="<?php echo _LANGUAGE; ?>" xml:lang="<?php echo _LANGUAGE; ?>">
|
|
| Author: | Azrael [ Mon Nov 13, 2006 11:01 am ] |
| Post subject: | Re: JOOMFISH 1.7 Tips & tricks |
Great tips, this is most helpful. But how do I configure the menu names and links for each language?
|
|
| Author: | rued [ Thu Dec 14, 2006 10:47 am ] |
| Post subject: | Re: JOOMFISH 1.7 Tips & tricks |
Regarding Tip 3, an better solution was missing in the Wiki so I wrote it today: http://forge.joomla.org/sf/wiki/do/view ... itleTricks @Joom!Fish Devs. please review and correct if needed. NOTE! There seems to be an issue with 3. pd components for site title, the meta tags are translated but not site title - any idea why and what to do about it? On core Joomla! components the title is translated correctly.. |
|
| Author: | akede [ Thu Dec 14, 2006 1:09 pm ] |
| Post subject: | Re: JOOMFISH 1.7 Tips & tricks |
As far as I know there is an overall issue with the Metatag information and site title in general. This should be solved in 1.8 release. I'm still not 100% sure where to place those dialogs. They are supossed to be related to the language configuration. But I do not want to blow up this table with those information as I think they do not really belong there. I don't have a clear idea in mind yet. Suggestions welcome Alex PS: As the forge seems to be very slow again I will review your entry a bit later |
|
| Author: | rued [ Thu Dec 14, 2006 11:31 pm ] |
| Post subject: | Re: JOOMFISH 1.7 Tips & tricks |
Ok, thanks for your reply Alex. akede wrote: I'm still not 100% sure where to place those dialogs. They are supossed to be related to the language configuration. But I do not want to blow up this table with those information as I think they do not really belong there. I don't have a clear idea in mind yet. Suggestions welcome As I newer has been digging deeper into the Joom!Fish code, I can't tell you whats best to do from a coders view. But for me as an site admin and/or user I would expect to find those in the list with the rest of the translations, maybe under the name "Site Title/Metas" (or something like that) in the drop down list. Hope this helps..
|
|
| Author: | akede [ Fri Dec 15, 2006 9:26 am ] |
| Post subject: | Re: JOOMFISH 1.7 Tips & tricks |
Joop helps a lot as this is definitly one option. Alex |
|
| Page 1 of 2 | All times are UTC |
| Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group http://www.phpbb.com/ |
|