This is the sollution: http://forum.virtuemart.net/index.php?topic=66513.0
{ 0 comments }
Welcome to our professional web development blog. Here you can find some helpful stuff about web design, coding, Joomla, WordPress and more...
Posts tagged as:
This is the sollution: http://forum.virtuemart.net/index.php?topic=66513.0
{ 0 comments }
In Joomla! 1.0.x it was possible to determine if the user was viewing the front page by using code like this:
<?php
if ($option == 'com_frontpage' || $option == '') {
echo 'This is the front page';
}
?>
But in Joomla! 1.5.x the com_frontpage component is no longer present. This is how to achieve the same result in Joomla! 1.5.x
<?php
$menu = & JSite::getMenu();
if ($menu->getActive() == $menu->getDefault()) {
echo 'This is the front page';
}
?>
This works by checking to see if the current active menu item is the default one.
This is one of the ways:
<?php if (JRequest::getInt('Itemid') == your_id) : ?>
<!-- special javascript -->
<?php endif; ?>
There are some differences in 1.6/1.7/2.5 to avoid Strict Standards errors. Use the following code for a site where all content is in the same language:
<?php
$app = JFactory::getApplication();
$menu = $app->getMenu();
if ($menu->getActive() == $menu->getDefault()) {
echo 'This is the front page';
}
?>
For multi-lingual sites the front page is dependent on the currently selected language, so you will need to use code like this:
<?php
$app = JFactory::getApplication();
$menu = $app->getMenu();
if ($menu->getActive() == $menu->getDefault( 'en-GB' )) {
echo 'This is the front page';
}
elseif ($menu->getActive() == $menu->getDefault( 'fr-FR' )) {
echo 'Accueil';
}
?>
For multi-lingual sites, it could also be necessary to display a specific code/html for all Default Home pages.
<?php $app = JFactory::getApplication(); ?> <?php $menu = $app->getMenu(); ?> <?php $lang = JFactory::getLanguage(); ?> <?php if ($menu->getActive() == $menu->getDefault($lang->getTag())) : ?> etc.
For more info: http://docs.joomla.org/How_to_determine_if_the_user_is_viewing_the_front_page
{ 0 comments }
One way to remove the text “View Full-Size Image” from beneath your product thumbnail on your flypage, make a copy of, then edit this file:
components/com_virtuemart/themes/your_theme/theme.php
Find the function vmBuildFullImageLink and within that find this line:
$text = ps_product::image_tag($product['product_thumb_image'], $img_attributes, 0)."<br/>".$VM_LANG->_('PHPSHOP_FLYPAGE_ENLARGE_IMAGE');
Change it so it looks like this:
$text = ps_product::image_tag($product['product_thumb_image'], $img_attributes, 0);
Save and test.
Another method would be to clear out the ‘PHPSHOP_FLYPAGE_ENLARGE_IMAGE’ text in your langauge file.
{ 3 comments }
First, we need to find out what the page class suffix is for the page we are visiting. To do this, you will need add some code to your template:
To load the page class suffix associated with the current Itemid, add this to the top of the index.php file:
<?php
$itemid = JRequest::getVar('Itemid');
$menu = &JSite::getMenu();
$active = $menu->getItem($itemid);
$params = $menu->getParams( $active->id );
$pageclass = $params->get( 'pageclass_sfx' );
?>
To load the page class suffix associated with the active menu item, add this to the top of the index.php file: (For sub-pages with no active menu item, this will load the page class suffix for the default menu item.)
<?php $menus = &JSite::getMenu(); $menu = $menus->getActive(); $pageclass = ""; if (is_object( $menu )) : $params = new JParameter( $menu->params ); $pageclass = $params->get( 'pageclass_sfx' ); endif; ?>
(credit: Page Class Suffix in template code)
You should always use htmlspecialchars() in your code before writing something into an HTML attribute, else you open up an attack vector to inject script code into your page.
The next step is to use the page class suffix somewhere in the template.
The more common method would be to apply the page class suffix as an id or class to the <body> tag. Find the <body> tag (below the </head> tag) and replace it with this:
<body id="<?php echo $pageclass ? htmlspecialchars($pageclass) : 'default'; ?>">
The second method would be to load a stylesheet unique to the page in question. Instead of modifying the <body> tag, look for the stylesheet link within the <head></head> tags and add the following line directly beneath it:
<link rel="stylesheet" href="templates/<?php echo $this->template ?>/css/<?php echo htmlspecialchars($pageclass) ?>.css" type="text/css"/>
For more info: http://docs.joomla.org/Using_the_Page_Class_Suffix_in_Template_Code
{ 2 comments }
Of course Joom!Fish has no competitors in providing multilanguage solutions for Joomla! But what we always wanted to achieve is to give more and more power to the administrators. And these people care about design, images, language dependents modules and such stuff.
We had some nice tricks with Joom!Fish 1.8.x, but I will provide you now some nice advanced features in respect to the design posibilities with Joom!Fish in terms of different visualisation of your web site in different languages.
As usual, there is no other alternative in the Joomla! multilanguage world to what we offer. Check out our design tricks coming with Joomla! 1.5 and Joom!Fish 2.0.
Note: these tricks require intermediate knowledge in Joomla! and might not be easy to implement for a new users.
Load different CSS file, based on the language.
Place this instead of the default load of a CSS file:
<link rel="stylesheet" href="<?php echo $this->baseurl ?>/templates/<?php echo $this->template ?>/css/<?php echo $this->language ?>.css" type="text/css" />
Now name your CSS files like en-GB.css or bg-BG.css or de-DE.css or whatever language you use.
Want to display certain module position only into one language?
Add this to the correct place in you template:
<?php
if ($this->language=="de-de") {
?>
<jdoc:include type="modules" name="germanmoduleposition" />
<?php } ?>
Now you should place the modules that you want to appear only into the template position named germanmoduleposition.
Load different image with the different languages.
Lets imagine you have an image named logo.gif that is the logo of your site. But you want to use different logo for each language.<br /><br />On default the logo will be called with the following command in your template (if it is not called via the CSS):
<img src="/<?php echo $this->baseurl ?>/templates/<?php echo $this->template ?>/images/logo.gif" width="260" height="180" alt="Logo" />
Or at least it should be something similar.
Now in order your logo to change with the languages, you need to do replace the following code with:
<img src="/<?php echo $this->baseurl ?>/templates/<?php echo $this->template ?>/images/<?php echo $this->language ?>.gif" width="260" height="180" alt="_?php echo JText::_('Logo'); ?>" />
What else you have to do is to name your logo images for the different languages en-GB.gif, bg-BG.gif etc.
You also need to add the language definition of the alt text. Lets imagine your template is named nice_template. If it is 1.5 compatible should have a language file under language/en-GB/en-GB.tpl_nice_template.ini
Add at the bottom of this file:
LOGO=Logo
Add the same line for the translation file of each language you use (i.e.
language/de-DE/de-DE.tpl_nice_template.ini : LOGO=Logo German)
For more info: http://www.joomfish.net/en/documentation/joomfish-20/25-tips/90-language-dependent-design-of-course-with-joomfish-only
{ 0 comments }
There is a bug in 1.5.22 causing Section Blogs to be ordered differently.
Quick fix: change the file /components/com_content/models/section.php on line 447 from:
$filter_order = ‘a.ordering’;
to:
$filter_order = ”;
Original post:
http://docs.joomla.org/Why_are_the_arti … erently%3F
{ 0 comments }