Keyword

Greater image control and attachment ordering

  • Alan Sparkes
  • Alan Sparkes's Avatar Topic Author
  • Offline
  • Premium Member
More
13 years 10 months ago #90303 by Alan Sparkes
Greater image control and attachment ordering was created by Alan Sparkes
I quite frequently am unhappy with the centered images in item layouts. Doesnt look great with smaller images. Also ever added a load of attachments and found the order abit annoying? Me too. So here's a few modification:
Files:
Admin model folder model files (administrator/components/com_k2/models)
category.xml
item.xml

Template file:
path = wherever your template is!
default template path: components/com_k2/templates/default
item.php

What they do:
The model files add som extra params to categories and items. In short they add:

image alignment left right none*
Attachment ordering A-Z/Z-A

When editing items you'll see som extra params for items - align image and order of attachments

The template file:
Item.php has some replacement code for images which calls the alignment and adds a float style. There is a more complex version which keeps large images centred/full-wdth and doesn't float but uses a css style to align rather than inline styles. The more complex version also added some height calculation for the images but I am not sure this is necessary - depends on your design/style needs and caption length really.


Instructions:
Backup your model files in admin folder, add these in the attached zip.
Back up your item.php from your template and add the one attached
You'll need to save an item for the params to save to the database.
Attachments:

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


Powered by Kunena Forum