Read more option for category list

  • Posts: 78
  • Thank you received: 0
13 years 8 months ago #9412

Using title and description option for displaying products and categories and using the readmore break to hide information after the first few lines.

For products this works fine but we have just tried to do the same with the category descriptions and the full description is displayed in the menu.

As best as I can makeout the read more option is controlled within the file SHOW of the view PRODUCT but the CATEGORY view does not have a SHOW file, is there a way to do this?

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
13 years 8 months ago #9426

Indeed, there is no support for the "read more" function on categories description. You will have to go to the menu Display->Views to add it:
First, edit the file listing_img_desc of the view category and change the line:
echo $this->row->category_description;
to:
echo preg_replace('#<hr *id="system-readmore" */>.*#is','',$this->row->category_description);

Second edit the file listing of both product and category views and change the line:
echo JHTML::_('content.prepare',$this->element->category_description);
to:
echo JHTML::_('content.prepare',preg_replace('#<hr *id="system-readmore" */>#i','',$this->element->category_description));

Then, you will be able to use the read more tag <hr id="system-readmore" /> in your categories description so that only the part before is shown on the listing of categories with the item box layout to "image and description" while the full category description will be displayed on listing products and categories where the "show description" option is toggled on.

Please let us know how it goes and we will add that function to next release of HikaShop.

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

  • Posts: 78
  • Thank you received: 0
13 years 8 months ago #9513

Tried it from the email sent by the forums but the emails dont contain some of the code. When I realised that and inserted the code directly from the forum, thats done the trick. I'm not sure whether you can customise the forum emails to warn people not to take code from the email?

On the wider topic of views, we are now working on a second site and have brought across some of the views and the language file from our first which was started at rev 1.4.3. When we do an update and the customisations are kept, is it the whole customised file that is kept. If so we could be missing out on fixes and updates like this anywhere we have made a small adjustment.

Also as a feature request, is it possible via the 'remove customisation' to track multiple versions, ie rather than having either the current version or the default version by removing any customisations, to add the option of reverting to a version from a week ago?

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
13 years 8 months ago #9515

- The emails are generated by Kunena... We didn't look too much into it. I suppose that if I had used the [ code ][ /code ] tags it might have been better in the email...

- For language files, you need to put your modifications in the override zone. That way, you can update the language files without loosing your modifications. For the views, indeed, the whole customized file is kept so you might not be able to use new functionalities or get bugs (when we change something, we try to not break stuff for people who might have customized the views and so far, the problems were quite limited).

- It's not possible at the moment but that could be something we could add in the future.

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

Time to create page: 0.058 seconds
Powered by Kunena Forum