JRequest::getVar('view') returns 'Frontpage' on VM pages and URL problems

<< < (2/17) > >>

jenkinhill:
I have looked & tested this but I cannot see a real problem except for the difference between going to cart from the info popup when product is added to the cart (cart1 attached) and going to the crt from the show cart link on the minicart (cart2). This second view is also seen if a product is deleted or updated from the info popup-cart. Is this what is being reported here?

unleash.it:
Jenkinhill, a big problem with this is that template designers right now don't have a way to use conditional statements based on Joomla views like frontpage. In your screen shots, I believe the reason the modules at the top appear is because Joomla thinks it's on the home page. If you like, take a look at my site:

http://tomanddave.web.aplus.net/

Click on Shop or Order Coffee then add something to the cart. Next try to delete or refesh something in the cart. The whole layout collapses. Notice what happens to the url. The problem also happens during the checkout stages. If you want to test that, you can use "tester" and "lemmein" for a fake shopper. Actually the first screen is ok, but all the rest have the problem.

I have several reasons for designing my site this way, not the least for ease of admin (and confusion) for my clients. For instance the top menu has a different background image for the home page than all other pages. I could have two separate menus in two separate positions and assign their modules page by page within Joomla, but I'd rather not if I can help it. I hope you guys can take a look at this. I'm sure I'm not the only one who would benefit.

unleash.it:
Just in case anyone is interested, I found a workaround to this problem. It's not exactly elegant, but it's pretty simple.

First, you must have a module position that is assigned only to the home page. There can be no other modules ever assigned to this position. If this isn't ideal, you can just use an empty position, assign a dummy module to it then in the CSS style it visibility:hidden. Then you simply test for a module being published in that position in your if statement. Here's an example:

Code:

<!-- in the head -->
   <?php if $this->countModules('top')) {$fp='frontpage';} ?>

<!--  in the body -->
   <?php if ($fp!="frontpage"){echo '<div id="bluebar">';}?>

<!-- close the div -->
<?php if ($fp!="frontpage"){echo '</div>';}?>

This creates a blue side bar on all pages that aren't the homepage. In other words, without managing two templates, you can have a different template for the homepage and other pages among other things. This also can make managing the site much less work, no need to constantly update the pages you have your modules assigned to whenever you add a new page (when you have more than one theme).

Still not sure and it seems kind of weird why this works while Joomla views do not. Even though Joomla thinks it's on the frontpage on certain VM pages, this method worked for me.

karlis:
Hello,
i've got the same problem.
I'm using 2 different templates for my site.
when user goes through checkout process template changes.

however on step 2 (shipping method) the template defaults to the front page template.

im using joomla 1.5 and virtuemart 1.1.0 Stable.

I don't understand the workaround explained by unleash.it.

unleash.it:
If anyone reads this who understands how the Joomla framework interacts w/Virtuemart, it might help all of us who are trying to vary our templates if you can explain this. Specifically, why does JRequest::getVar('view') sometimes return 'Frontpage' on certain VM pages (certain checkout and cart pages) that are not the front page?

Karlis, the workaround I have found has not been tested with assigning different Joomla templates in the back end as it sounds like you are doing. The problems you're having might be related to my problem or something different.

Instead of using multiple "templates", I created my template changes with conditional statements in PHP. I only have two "looks". One is for the front page (based on the Joomla "view" of 'frontpage'), and the other is all other pages (i.e. not 'frontpage'). If this is all you need, you may be able to achieve what you're looking to do w/my workaround for now.

Navigation

[0] Message Index

[#] Next page

[*] Previous page