Duplicate a View

  • Posts: 440
  • Thank you received: 20
  • Hikashop Essential
7 years 3 months ago #286436

-- HikaShop version -- : 3.2.2
-- Joomla version -- : 3.8.3
-- PHP version -- : 7.1.13

Hi

I was wondering if it is possible to actually duplicate a view. I have a site where latest products will be displayed on the home page, using the latest products module. In views I have listing_img_title, is it possible to create another version with a slightly different name listing_img_title_njr for instance? I would like to add a button along the lines of View Product but only for that display. If I change the listing_img_title this is reflected on the whole site.

Thanks

Dave B)

Please Log in or Create an account to join the conversation.

  • Posts: 83778
  • Thank you received: 13564
  • MODERATOR
7 years 3 months ago #286448

Hi,

Well, you don't necessarily need to create a new view file.
First, you can use listing_img. Just copy the copy from listing_img_title in it and change it like you want.
Then, in the module, you can select "image" instead of "image and title" so that it used your modified view file instead of the default.
Also, when you edit the listing_img_title view file, you can change the name of the file in the input field at the top and when you save, it will save the code in a file with that new name as a template override and you'll be able to select it in your modules.
Also, even without a new view, in the same view file, you can add changes that will only happen for one specific module like that:

if($this->params->get('id') == XXX) {
 // specific code for the module with the id XXX
}

The following user(s) said Thank You: davec

Please Log in or Create an account to join the conversation.

Time to create page: 0.052 seconds
Powered by Kunena Forum