category and layout

  • Posts: 846
  • Thank you received: 92
8 years 10 months ago #252080

-- HikaShop version -- : 2.7
-- Joomla version -- : 3.4
-- PHP version -- : 5.4

Hi

Here are questions about all the hiearchy of call of php (html structure) and css/js style
it try to compare hikashop way to d othing refer to joomla ( already ask for item menu comparison )

A.) I see when create hikashop category that there is a field call layout with many options ( all the selected option the category_name =reversed. Is there documentation about howto to create a new item like reversed ?



In joomla category the layout label can be view when go to options alternative layout !
Since hikashop is not base on joomla article ..many same result could be achieve but using different way . All those differents way should be documented . In this case , does the alternative layout concept still exist in hiakshop category ?


B.) in product i also see this layout item choice
Does add category name t o product apply layout to this product ?


C.) 1 )Is there a way to define a layout for a filter apply to a specific list of product ?
2) Can we mix filter product and menuitem type "hks Article List " ?
3) Does category name is use by article list ?



Thank"s

Attachments:
Last edit: 8 years 10 months ago by lionel75.

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

  • Posts: 84233
  • Thank you received: 13675
  • MODERATOR
8 years 10 months ago #252103

Hi,

1. Edit the 'show_default' view file, and change the name of the file before saving it and you'll get a new entry there with the name of your view file.

2. There is no different layout setting for categories listings besides the "list" and "div" displays. That setting is for the product page display (as the name imply).

3. If you leave the option to "inherit" in the product, the product will try to use the layout selected in the categories that you attached the product to. If you fill it, it will override the layout selected in the categories.

4. For the products listings, similarily to the categories listings, you can use the "list", "div" and "table" layouts that you can select in the settings of your products listings.

5. I didn't understand your last two questions.

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

  • Posts: 846
  • Thank you received: 92
8 years 10 months ago #252184

nicolas wrote:
1. Edit the 'show_default' view file, and change the name of the file before saving it and you'll get a new entry there with the name of your view file.

ok to be more explicit the file location is components\com_hikashop\views\product\tmpl\show_default.php
the tmpl file contain many files name that begin by show_* . Where to configure joomla/hikashop to show only show_* ( * = default quantity reversed tabular) in the gui back end and not the others (


nicolas wrote: 4. For the products listings, similarily to the categories listings, you can use the "list", "div" and "table" layouts that you can select in the settings of your products listings.

is there a way to define our custom /own layout ( for example table instead list and div table ) using php file for category


I don't master php and joomla php and less hikashop php APIt ....but to make short ":" do we have in hikashop ( product) all the fonctionnalities that joomla article/content has when we want to custom/override layout ( see here joomla doc )

Last edit: 8 years 10 months ago by lionel75.

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

  • Posts: 84233
  • Thank you received: 13675
  • MODERATOR
8 years 10 months ago #252202

Hi,

1. I don't understand your question.

2. Yes. Edit the file "listing_list" for example for your template There, you can have such code:
if($this->element->category_name=='My first category'){
echo "something";
}else{
echo "something else";
}
So based on that, you can even include different template view files for different categories, or base yourself on the value of a custom category field to select the template view file you want for each category.

3. Yes, all that applies to HikaShop views too.

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

  • Posts: 846
  • Thank you received: 92
8 years 10 months ago #252305

the first question could be how can i define/create my own layout on product page call Mylayout ( red) ?
an be shure tha the php file of name mylayout.php ll be choose among other php file locate under the same directory .

Attachments:
Last edit: 8 years 10 months ago by lionel75.

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

  • Posts: 84233
  • Thank you received: 13675
  • MODERATOR
8 years 10 months ago #252336

Hi,

I've already replied to that in my first message:

Edit the 'show_default' view file, and change the name of the file before saving it and you'll get a new entry there with the name of your view file.

I'm not sure what more I can tell you ? Is there something you don't understand with my answer maybe ?

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

  • Posts: 846
  • Thank you received: 92
8 years 10 months ago #252410

Hi

What i don't like in general of many posts of forum ( less on tutorial ) is that people don't explicit name the file or the path of the file . Many time in post i see that behaviour and people continue to ask how can i do this. This is efficient if people already has a good knowledge of the context but some hikashop user don't and in this case we can't understand the answer . To avoid that ...many time i use a capture screen with red arrow / rectangle to show them where they have to click on the gui html page ....... or name the file with extension and give the line number .....or capture a hiearchy directory tree that show the location of files and the location of directories ....


in the capture screen i copy and rename show_default.php file to Mylayout.php ( higlight in red) without changing the content
As you can see the file is here but the name don't appear in th HTML page !!! there also many files in the directory so why some appear and not all of them ? there a missing information locate inside an another file but perhaps it is not a hikashop question but joomla question ?



regard's

Attachments:
Last edit: 8 years 10 months ago by lionel75.

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

  • Posts: 26264
  • Thank you received: 4043
  • MODERATOR
8 years 10 months ago #252413

Hi,

When you edit the view "show_default" via the HikaShop view edition interface you have an input which allow you to change the suffix of the view.
As you can see in your screenshot ; to be listed, the view must start with show_ and that is why the HikaShop interface just allow you to change the suffix (aka: the end of the name) without touching the "show_".
Now, with a little bit of deduction it is possible to see that the view "show_block_" are excluded because these are sub elements for the product pages.

So, if you were following the Nicolas' instruction exactly like he explained it, you would have directly a working new view !
pasteboard.co/eC6NdA313.png

I am very sorry but the Nicolas message was clear and simple.
Unfortunately, you decided to make it much more complicated.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.
The following user(s) said Thank You: lionel75

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

  • Posts: 846
  • Thank you received: 92
8 years 10 months ago #252531

Thank's for the capture .
I have never see (think ... do care) that we can edit the name of the file !!

great .....

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

Time to create page: 0.112 seconds
Powered by Kunena Forum