VirtueMart Forum

VirtueMart 2 + 3 + 4 => General Questions => Topic started by: behemoth on June 20, 2019, 14:05:34 PM

Title: Targetable Homepage
Post by: behemoth on June 20, 2019, 14:05:34 PM
What's the best way to target the homepage? (I have modules that I only want displaying on the homepage)

Previously I used the following MetaMod check:


if ( $vm->check( "pagetype = frontpage" ) )


but now the homepage is deprecated, this won't work (well, it still works, but it's not the correct approach). If as recommended I use a category for the homepage, I need to target it by ID which might change from site to site. Is there a definitive hook or anchor I can use that won't change?

I can't imagine you need version numbers, but I'm currently on VM3.4.2 on J3.9.6
Title: Re: Targetable Homepage
Post by: Jörgen on June 20, 2019, 14:20:45 PM
Assign what You call the "homepage", probably a VM top category page, to a Joomla menu item and use this menu id?

Jörgen @ Kreativ Fotografi
Title: Re: Targetable Homepage
Post by: behemoth on June 21, 2019, 10:51:58 AM
It still relies on me knowing (or looking up) an ID before I can target it.

I've decided to use an article instead because the home category was showing in my menu and I didn't want it to.