DIV Layouts - templating idea for wish list

  • Posts: 292
  • Thank you received: 5
  • Hikashop Business
13 years 6 months ago #18932

In Joomla go to Extensions / Modules / Select a menu module.
Go to Advanced Options / Alternative Layout is a drop-down list which looks like:

-- From Module --
Default
-- From My Template --
type1
type2
type3

In the Hikashop Parameters for DIV / Type of Item Layout dropdown would it be possible at some point to do something similar and pickup template defined layouts in addition to the standard Hikashop ones? I guess feature would need to be controlled somehow by an XML file in the template.

Can achieve this currently by using a custom category / product field and then coding the view override according to the setting of that field, so its not a high priority.

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

  • Posts: 83007
  • Thank you received: 13400
  • MODERATOR
13 years 6 months ago #18935

You can add your file in the folder components/com_hikashop/views/product/html/ and make its name start with listing_ and it will be added automatically to the dropdown selection.
However, if you use joomla 1.6, the installation process of joomla removes the whole component folder before installing the new files so you would loose the file when you update. That works fine with joomla 1.5 though.

The solution should be easy... Just changing the file administrator/components/com_hikashop/types/item.php to add the views folders of the main template. Do you see what I mean ?

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

  • Posts: 292
  • Thank you received: 5
  • Hikashop Business
13 years 6 months ago #18962

I got this working - modified administrator/components/com_hikashop/types/item.php as attached.

Create a template file listing_mydemo.php (say copy listing_title.php) and place it in:
templates/mytemplate/html/com_hikashop/category/listing_mydemo.php

Tested with PHP 5.3 and Joomla 1.6.

One bug, I could not quickly figure out - the optgroup is not being shown for the templates.
Can you see what I am doing wrong?

Already found this very useful and a better way of managing custom template views.

Could this be incorporated into core Hikashop please?

File Attachment:

File Name: item.zip
File Size:1 KB

Attachments:

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

  • Posts: 83007
  • Thank you received: 13400
  • MODERATOR
13 years 6 months ago #19082

Thanks. In joomla 1.6, the optgroup needs to be called twice. Once before the options and once after.
We've added your modifications and fixed that. It will be in next release.

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

Time to create page: 0.059 seconds
Powered by Kunena Forum